|We don't bite newbies here... much|
Getting impossible things right (behaviour of keys)by PetaMem (Priest)
|on Oct 24, 2001 at 13:05 UTC||Need Help??|
PetaMem has asked for the
wisdom of the Perl Monks concerning the following question:
Masters, we have a customer Database where contacts are stored with all their relevant Data, but in 1st person singular only. Now it happens that these are czech customers And if someones name is Jim Beam, you donīt just say Dear Mr. Beam, but Vazeny Mr. Beame, instead. Now theres a bunch of rules how to flex the names to this form called Vocativ. The most interesting experience was, that czech people were talking to me that it is IMPOSSIBLE to do this automatically. It took me 10 minutes of thought and 5 minutes to code to come up with something like that:
Now this works great for me and some more rules and weīre at ~100%. The biggest culprit is, that it works for me only... As written in the sourcecode, the longest suffixes MUST be the last ones, as the longest suffixes MUST be examined as the first ones at runtime.
The problem is, that the above piece of code indeed does examine the longest pieces first, but the people who applied this code in the DB-system say, the order of examination is completedly random.
So the behaviour of keys seems different, but we canīt see any difference (same perl version, same OS) the only difference is, that the code is just part of other code (but as separate routine also) and runs on a machine with less memory where it doesnīt seem to work "right".
Any suggestions how to FORCE the examination of longest keys first?
Any help greatly appreciated