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


In reply to Implication is not enough by PetaMem

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.