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
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.