sentence.icn: Procedure to generate sentences in file

link sentence
August 14, 1996; Richard L. Goerwitz
Requires: co-expressions
This file is in the public domain.

sentence(f)   - suspends sentences from file f

A lot of grammatical and stylistic analysis programs are predicated
on the notion of a sentence.  For instance, some programs count the
number of words in each sentence.  Other count the number and length
of clauses.  Still others pedantically check for sentence-final par-
ticles and prepositions.

This procedure, sentence(), is supposed to be used as a filter for
ASCII text files, suspending everything that looks remotely like a
sentence in them.
____________________________________________________________

BUGS:  Cannot correctly parse sentences with constructs like "R. L.
Goerwitz" in them.  The algorithm can be much improved simply by
checking to see if the word after the period is in /usr/dict/words
or whatever your system dictionary file is.  If it isn't, then it's
likely not to be the beginning of a sentence (this also is not in-
fallible, naturally).

Source code | Program Library Page | Icon Home Page