Hi,

That way, you stil have *only* implication but changed
the precedence of some steps (badly). Look:

If the word you get to test would be "Ägypterinen", you
never would come to the guts of if($word =~ /en$/)

Ok. Where am I going with this? Well - theres no correct
or complete morphological parser of the german language as
of today. I could write one, but I would like to write it
elegantly. Seems I´m missing a feature in Perl. Or just
some decent way to craft code that can potentially both
analyze and generate.

The task is easy.

Given 3 german words. Ägypter, Ägypterin, Ägypterinen

Write a routine that takes a list of 3 Arguments:
word, genus, numerus.

and returns a list of 3 elements:
word, genus, numerus

where "word" is the word that was given to the routine
after applying genus and numerus to it.
genus and numerus are the genus and numerus the word HAD
BEFORE applying the new genus and numerus to it.
Like so:
sub mystical_de_morphology_ruleprocessor { my $word = shift; my $new_genus = shift; my $new_numerus = shift; TRY_RULE1: (word (m,sg) <-> word + "in" (f, sg)) TRY_RULE2: (word (f,sg) <-> word + "en" (f,pl)) return newword, old_gen, old_num; }
The TRY_RULE part is it. I just want to apply rules
2 rules = 4 IFs, 3 rules = 8 IFs, 10 rules = forget it.
Prolog would be nice, but I want stick with perl for that.

Ciao


In reply to Re: Re: Implication is not enough by PetaMem
in thread 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.