caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Camomile library tutorial/examples?
@ 2009-09-05 21:42 Morozov Matvey
  2009-09-06  7:41 ` [Caml-list] " dmitry grebeniuk
  2009-09-06  7:49 ` dmitry grebeniuk
  0 siblings, 2 replies; 3+ messages in thread
From: Morozov Matvey @ 2009-09-05 21:42 UTC (permalink / raw)
  To: caml-list

Dear all,

I am an inexperienced OСaml coder, so my question may seem trivial.

Recently I tried to add some unicode support to my project (for instance I need to convert Cyrillic characters from uppercase to lowercase and vice versa). I found the impressive Camomile library, which should help me to solve my problems. However I had not found any tutorial or even up-to-date (simple!) examples of the library usage. Would you be so kind to point me to a good introduction to Camomile?

With best regards,

Matvey Morozov


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

* Re: [Caml-list] Camomile library tutorial/examples?
  2009-09-05 21:42 Camomile library tutorial/examples? Morozov Matvey
@ 2009-09-06  7:41 ` dmitry grebeniuk
  2009-09-06  7:49 ` dmitry grebeniuk
  1 sibling, 0 replies; 3+ messages in thread
From: dmitry grebeniuk @ 2009-09-06  7:41 UTC (permalink / raw)
  To: Morozov Matvey; +Cc: caml-list

> Recently I tried to add some unicode support to my project (for instance I need to convert Cyrillic characters from uppercase to lowercase and vice versa).

  I don't know of any good documentation on Camomile, but here is a
code that converts line from terminal to uppercase and lowercase,
assuming that your terminal's encoding is utf8.

===== camotest.ml =====
open Printf
module PREF = CamomileLibrary.Default.Camomile
module CE = PREF.CharEncoding
module CM = PREF.CaseMap.Make(PREF.UTF8)

let _ =
  try
    while true do printf "> %!";
      let line = input_line stdin in
      let up = CM.uppercase line
      and low = CM.lowercase line
      in printf "ORIG : %s\nUPPER: %s\nLOWER: %s\n%!" line up low
    done
  with
  | End_of_file -> ()
===== / camotest.ml =====

$ ocamlfind ocamlc -package camomile -linkpkg camotest.ml -o camotest
$ ./camotest


btw, if you speak russian (as I can guess), you can join the jabber conference
ocaml@conference.jabber.ru , some questions are solved faster than via
mail-lists.


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

* Re: [Caml-list] Camomile library tutorial/examples?
  2009-09-05 21:42 Camomile library tutorial/examples? Morozov Matvey
  2009-09-06  7:41 ` [Caml-list] " dmitry grebeniuk
@ 2009-09-06  7:49 ` dmitry grebeniuk
  1 sibling, 0 replies; 3+ messages in thread
From: dmitry grebeniuk @ 2009-09-06  7:49 UTC (permalink / raw)
  To: Morozov Matvey; +Cc: caml-list

> Recently I tried to add some unicode support to my project (for instance I need to convert Cyrillic characters from uppercase to lowercase and vice versa).

  I don't know of any good documentation on Camomile, but here is a
code that converts line from terminal to uppercase and lowercase,
assuming that your terminal's encoding is utf8.

===== camotest.ml =====
open Printf
module PREF = CamomileLibrary.Default.Camomile
module CE = PREF.CharEncoding
module CM = PREF.CaseMap.Make(PREF.UTF8)

let _ =
  try
    while true do printf "> %!";
      let line = input_line stdin in
      let up = CM.uppercase line
      and low = CM.lowercase line
      in printf "ORIG : %s\nUPPER: %s\nLOWER: %s\n%!" line up low
    done
  with
  | End_of_file -> ()
===== / camotest.ml =====

$ ocamlfind ocamlc -package camomile -linkpkg camotest.ml -o camotest
$ ./camotest


btw, if you speak russian (as I can guess), you can join the jabber conference
ocaml@conference.jabber.ru , some questions are solved faster than via
mail-lists.


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

end of thread, other threads:[~2009-09-06  7:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-05 21:42 Camomile library tutorial/examples? Morozov Matvey
2009-09-06  7:41 ` [Caml-list] " dmitry grebeniuk
2009-09-06  7:49 ` dmitry grebeniuk

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).