On 2 Aug 2007, at 21:33, Hans (Req man) wrote:
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?
I am not sure exactly what you are out for (i,e,, how these programs
you mention work), but it is difficult to use Flex and Bison in
natural language processing, in view of that natural languages are
grammatically ambiguous even on the lexical level. For example, take
the sentence:
Time flies like an arrow, fruit flies like a banana.
Here, there are a number of ways of resolving the grammatical
components, leading to different meanings. So Flex would need to
return a set of possibilities, instead of just one lexeme.
There is one constructed language Lojban <http://lojban.org/>, which
has been made so that it is Yaccable (LALR(1)-parsable).
Hans Aberg
_______________________________________________
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison