caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Inflection lib for ocaml ?
@ 2009-06-19  2:02 Conglun Yao
  2009-06-19  6:55 ` [Caml-list] " Pascal Rigaux
  2009-06-19  9:52 ` [Caml-list] " Richard Jones
  0 siblings, 2 replies; 5+ messages in thread
From: Conglun Yao @ 2009-06-19  2:02 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 327 bytes --]

Dear all,

I'm wondering is there any library in OCaml performing word inflection
between singular and plural, like Lingua-EN-Inflect in perl. Or someone is
already doing the work?

I can only find code snapshot  in Pleac_ocaml (Printing Correct Plurals)

http://pleac.sourceforge.net/pleac_ocaml/numbers.html

Cheers,
Conglun

[-- Attachment #2: Type: text/html, Size: 496 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] Inflection lib for ocaml ?
  2009-06-19  2:02 Inflection lib for ocaml ? Conglun Yao
@ 2009-06-19  6:55 ` Pascal Rigaux
  2009-06-19  7:59   ` Sylvain Le Gall
  2009-06-19  9:52 ` [Caml-list] " Richard Jones
  1 sibling, 1 reply; 5+ messages in thread
From: Pascal Rigaux @ 2009-06-19  6:55 UTC (permalink / raw)
  To: Conglun Yao; +Cc: caml-list

2009/6/19 Conglun Yao <yaoconglun@gmail.com>:

> I'm wondering is there any library in OCaml performing word inflection
> between singular and plural, like Lingua-EN-Inflect in perl. Or someone is
> already doing the work?

not really comparable to Lingua-EN-Inflect, but if you want one day to
have i18n and you are under linux, ngettext is quite powerful.
cf http://www.gnu.org/software/hello/manual/gettext/Plural-forms.html


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Inflection lib for ocaml ?
  2009-06-19  6:55 ` [Caml-list] " Pascal Rigaux
@ 2009-06-19  7:59   ` Sylvain Le Gall
  0 siblings, 0 replies; 5+ messages in thread
From: Sylvain Le Gall @ 2009-06-19  7:59 UTC (permalink / raw)
  To: caml-list

On 19-06-2009, Pascal Rigaux <pascal@rigaux.org> wrote:
> 2009/6/19 Conglun Yao <yaoconglun@gmail.com>:
>
>> I'm wondering is there any library in OCaml performing word inflection
>> between singular and plural, like Lingua-EN-Inflect in perl. Or someone is
>> already doing the work?
>
> not really comparable to Lingua-EN-Inflect, but if you want one day to
> have i18n and you are under linux, ngettext is quite powerful.
> cf http://www.gnu.org/software/hello/manual/gettext/Plural-forms.html
>

FYI, a pure OCaml implementation of ngettext, with plural support, can
be found in ocaml-gettext:
http://le-gall.net/sylvain+violaine/ocaml-gettext.html

Regards,
Sylvain Le Gall


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] Inflection lib for ocaml ?
  2009-06-19  2:02 Inflection lib for ocaml ? Conglun Yao
  2009-06-19  6:55 ` [Caml-list] " Pascal Rigaux
@ 2009-06-19  9:52 ` Richard Jones
  2009-06-19 15:03   ` Conglun Yao
  1 sibling, 1 reply; 5+ messages in thread
From: Richard Jones @ 2009-06-19  9:52 UTC (permalink / raw)
  To: Conglun Yao; +Cc: caml-list

On Fri, Jun 19, 2009 at 03:02:36AM +0100, Conglun Yao wrote:
> I'm wondering is there any library in OCaml performing word inflection
> between singular and plural, like Lingua-EN-Inflect in perl. Or someone is
> already doing the work?

You should be able to call the perl module directly using
perl4caml.

Rich.

-- 
Richard Jones
Red Hat


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] Inflection lib for ocaml ?
  2009-06-19  9:52 ` [Caml-list] " Richard Jones
@ 2009-06-19 15:03   ` Conglun Yao
  0 siblings, 0 replies; 5+ messages in thread
From: Conglun Yao @ 2009-06-19 15:03 UTC (permalink / raw)
  To: Richard Jones; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 1043 bytes --]

Thanks for all of your quick responses.

Gettext seems a bit more complex than what I want. It would be better to
have a simple function to implement the plural and singular conversion like
the one in Ruby on Rails.

Like
   Inflection.plural "some_word"
   Inflection.singular "some_word"

Inflection module defines the conversion roles.
http://www.csse.monash.edu.au/~damian/papers/HTML/Plurals.html

May be I should have a try with perl4caml + Lingua-En-Inflect,  but Lingua
only does conversion from singular to plural,  how to do the opposite
conversion (plural to singular)

Thanks.

Conglun



On Fri, Jun 19, 2009 at 10:52 AM, Richard Jones <rich@annexia.org> wrote:

> On Fri, Jun 19, 2009 at 03:02:36AM +0100, Conglun Yao wrote:
> > I'm wondering is there any library in OCaml performing word inflection
> > between singular and plural, like Lingua-EN-Inflect in perl. Or someone
> is
> > already doing the work?
>
> You should be able to call the perl module directly using
> perl4caml.
>
> Rich.
>
> --
> Richard Jones
> Red Hat
>

[-- Attachment #2: Type: text/html, Size: 1584 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-06-19 15:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-19  2:02 Inflection lib for ocaml ? Conglun Yao
2009-06-19  6:55 ` [Caml-list] " Pascal Rigaux
2009-06-19  7:59   ` Sylvain Le Gall
2009-06-19  9:52 ` [Caml-list] " Richard Jones
2009-06-19 15:03   ` Conglun Yao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).