Afficher un message
Vieux 24/05/2008, 01h13   #3
Axel Etzold
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: #plural? or #singular?


-------- Original-Nachricht --------
> Datum: Sat, 24 May 2008 07:45:01 +0900
> Von: "Michael W. Ryder" <_mwryder@worldnet.att.net>
> An: ruby-talk@ruby-lang.org
> Betreff: Re: #plural? or #singular?


> Mark Dodwell wrote:
> > Does anybody know an easy way to test if a word is singular or plural --
> > something a bit smarter than just checking if there is an s on the end!
> >
> > Thanks,
> >
> > ~ Mark

>
> You might be able to use some form of dictionary lookup and that will
> with words like mice, but it still will not with words like
> moose where the singular and plural are the same.


Dear Mark,

for the simpler task, where there are different forms for singular and
plural (eg., mouse-mice, house-houses), you could use this:

http://api.rubyonrails.org/classes/Inflector.html

For the more difficult cases, where singular and plural forms coincide
(and for the easier cases as well), a part-of-speech tagger can be ful.

I don't know of any written in Ruby, but I can recommend the tree-tagger,
which you can script from Ruby to suit your needs.
It is available for several languages, so you can find irregular plurals
of words in different languages ....

It is here :

http://www.ims.uni-stuttgart.de/proj...ex/TreeTagger/


Best regards,

Axel
--
Super-Acktion nur in der GMX Spieleflat: 10 Tage für 1 Euro.
Über 180 Spiele downloaden und spiele: http://flat.games.gmx.de

  Réponse avec citation
 
Page generated in 1,69417 seconds with 9 queries