BioGeek has asked for the wisdom of the Perl Monks concerning the following question:

Hi Perlmonks, I'm in the proces of translating a site into Dutch. Users can subscribe to the site, and choose a username. At several places I have to form possessives with the username, like "Richard's library". Unfortunatly, the grammar rules in Dutch are quite complex, and depend on the endsound of the word

Rules for forming possessive forms of words in Dutch

Ground Rule:

Write the s directly connected to the word

Exceptions

Now are there any regexes or modules I can use to know whether a vowel is stressed or unstressed, or whether the last letter "e" in a word is mute or not?

Replies are listed 'Best First'.
Re: Possessive forms in Dutch.
by Cody Pendant (Prior) on Jan 31, 2005 at 02:38 UTC
    Every time someone subscribes and is potentially in one of the exception cases, have it add a record to a "people needing their possessives checked" database. Use a default of "s" or whatever's the most common in the meantime, then when you have a few moments to spare, view and tweak the ones which need tweaking.


    ($_='kkvvttuubbooppuuiiffssqqffssmmiibbddllffss')
    =~y~b-v~a-z~s; print
      You could also jumpstart it by finding a list of the thousand or so most common Dutch names and paying some poor student a few guilders to make them possessive.

      -b

        paying some poor student a few guilders
        The fellow would be quite upset to be remunerated in worthless money... ;)

      Or just make it a user option: "The possesive of my name is:". And after a while you would have a good reference built up to use for defaults...

      --
      Do not seek to follow in the footsteps of the wise. Seek what they sought. -Basho

Re: Possessive forms in Dutch.
by pijll (Beadle) on Jan 31, 2005 at 11:53 UTC
    Why would you need to know whether a vowel is stressed or not? It only depends on the length of the vowel. All vowels other than "e" at the end of a word are either long, accented, or part of a diphthong ("tweeklank"). A long "e" is always written as "ee" at the end of a word, so "e" is always either short, or accented, or part of a diphthong, and never needs an apostrophe.

    Something like this (untested!)

    if ($name =~ /[^aeiou][aiouy]$/) { $possessive = $name . "'s"; } elsif ($name =~ /(s|z|x|sj|sch)$/) { $possessive = $name . "'"; } else } $possessive = $name . "s"; }
    should work for all Dutch (native) names. You can't do thing correctly for foreign names (such as Dutroux), as they are not spelled according to Dutch rules.
Re: Possessive forms in Dutch.
by Old_Gray_Bear (Bishop) on Jan 30, 2005 at 23:32 UTC
    Sorry, I can't directly point you to a CPAN module, but have you considered ducking the issue by revising the text slightly? Translate "Richard's Library" into "The Library" (under the Heading "Richard") or "The Library of Richard".

    ----
    I Go Back to Sleep, Now.

    OGB

      I can do that in some places, but not all of them. I'm not the siteowner, and so somewhat bound to the framework made by someone else. This framework was previously used to translate the site in Russian, Norwegian and French, so if I mess to much with the framework, I migth end up breaking the other-language versions of the site.

        I agree with the idea that it would be better to have a different structure, such as Dave :: Library :: Fiction or somesuch. That's much more portable across languages - and unless you're quite sure that the Russian, Norwegian and French translators did a perfect job then the site owner may well be interested in rethinking his/her posessives.

        If you absolutely positively have to keep Willem's Library and so on, you might want to store the posessive form in your database and only change it when the name changes. My guess is that you'll have a monster bit of code - if a very wise monk steps forth maybe a monster regexp - and you may not want to run it too often.

        I'm not an expert in these things but you might also want to look into lexemes/morphemes, though I honestly have no idea how applicable they are to proper names.

        Good luck! It's an interesting challenge, and I hope you're being paid by the hour :-)

Re: Possessive forms in Dutch.
by Anonymous Monk on Jan 31, 2005 at 09:31 UTC
    Just use the ground rule. Always. Complain it's otherwise too difficult for the children to learn. Then, in a few years time, a spellings reform will say putting an s behind the word is ok. (Except for names that are derived from plants or animals, or some other silly exception).

    <rant>Dutch spelling reforms are great. It makes that the longer ago an author wrote his book, the harder it is to read. And hence, Dutch people don't quote Vondel like the British do with Shakespeare. (In fact, for Dutch people, it's easier to read Shakespeare than Vondel)</rant>