Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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":



  • 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.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (7)
As of 2024-04-25 08:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found