Hi!
Currently I am a user of the Gnu diction program. I am translating
diction and style. Release 1.11 RC3 provides Dutch messages and can
check the diction and style of Dutch documents. From the Gnu website
http://directory.fsf.org/GNU/diction.html:
"diction - Checks text for readability and bad usage
This program includes both 'diction' and 'style'. 'Diction' identifies
wordy and commonly misused phrases; 'style' analyzes surface
characteristics of a document, including sentence length and other
readability measures.
While these programs cannot help you structure a document well, they can
help to avoid poor wording and compare the readability of your document
with others. Both commands support English and German documents."
While translating and editing the diction package I noticed that style
is rather a lexical analyzer, and diction is more of a parser.
Specifications are entered either in the C sources or in companying
database. When you want to add a phrase you must be sure to spell out
all possible instances. Two examples:
example 1: be able to
=========
Identifier Beginner Instances Advised user action
---------- -------- --------- -------------------
to be able to Yes be able to (weak definition)
to be able to Yes am able to (weak definition)
to be able to Yes are able to (weak definition)
to be able to Yes was able to (weak definition)
to be able to Yes were able to (weak definition)
example 2: along the line
=========
Identifier Beginner Instances Advised user action
---------- -------- --------- -------------------
along the line No along the line (avoid)
along the line No along the line of like (or omit)
along the line No along the lines (avoid)
along the line No along the lines of like (or omit)
along the line No along these lines (overworked
phrase, avoid)
along the line No along those lines (avoid)
Beginner indicates errors usually made by people not fluent in the language.
This spelling out all possibilities brought to my mind the usage of flex
and bison in one of my projects in the early nineties:
Generalization example 1:
1. <form of 'to be'>'able to' /* I am able to
... */
2. <form of 'to be'><some text>'able to /* were yo able
to ... */
Generalization of example 2:
1. 'along'(<the> | <these>)(line | lines)(of | NIL) /* along the line
of */
Currently the three languages together check about 1,000 phrases. Only
one language can be active at any time. If the language is unknown then
only language independent checks can be executed (like the counting of
sentences and words).
Now my question: How much work is it to specify this type of 'complex'
phrases in flex and bison?
Any suggestion is appreciated.
Kind regards,
Hans Lodder
_______________________________________________
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison