http://www.perlmonks.org?node_id=100657

Fellow Monks,

intentionally this goes to Meditation and not to "Seekers".
As we all know (or at least as Fatvamp thinks :-)) a simple
if clause does the magic of implication:

IF <ANALYZE> -> <GENERATE>
Now for the application I´m doing right now (some NLP just
for fun), ANALYZE and GENERATE could really
need to be interchanged (used both ways). I´ll try to
explain with some examples:

Consider the german language. A simple subset of rules
could be:

Word (male, singular) <-> Word + Suffix "in" (female,singular)
and
Word (female, singular) <-> Word + Suffix "en" (female, plural)
So now, consider those words: Ägypter (Egyptian), Ägypterin
(female Egyptian), Ägypterinen (female Egyptians). Ideally
one should be able to pass any of these 3 words to a "rule-
processor" containing only the 2 above mentioned rules to
get them analyzed. (And of course having in each case any of
the other 2 words being generated - if in "generating-mode")

The only alternative I see at the moment is to have 4 IF
tests instead of those 2 rules. And there is much redundancy
in them. And I´m so lazy. :-) And because I´m so lazy, I state
that the 4 IF solution is unelegant.

IF Word (male, singular) -> Word + Suffix "in" (female,singular)
IF Word + Suffix "in" (female,singular) -> Word (male, singular)
IF Word (female, singular) -> Word + Suffix "en" (female, plural)
IF Word + Suffix "en" (female, plural) -> Word (female, singular)
It really is. Don´t you think? Any thoughts on this?

Ciao