SlideShare uma empresa Scribd logo
1 de 19
Baixar para ler offline
Camomile

OCaml用Unicodeライブラリ
                 山形賴之
           2011年12月29日
                    京大
Agenda
Unicodeとは?

OCamlとは?

 Camomile
Agenda
Unicodeとは?

OCamlとは?

 Camomile
A   U+0041   Ậ   U+1EAC
                 = U+0041 + U+0302
                 + U+0323
    U+3042
あ            既   U+65E2



ᚠ   U+16A0   旣   U+65E3
文字集合は民族の財産だ!



    勝手に統合するな!


Code Set Independeceにこだわる
Character, not glyph

AAAAA ←すべて同じ文字
原則:文字という論理的な対象をコード
論理的とは?
  ≒意味
  でも、既≠旣とかわかりにくい
意味



                 士≠土



                         抽象的な構造
                   既≠旣
とめ、はね、など


    具体的な形
BMP:よく使われる文字


0 10000 20000 30000               E0000 F0000    10FFFF
            拡
            張                               Private
            漢                                Zone
            字
                                  タグ


                Plane 1: 特殊記号、歴史的な文字
A Ω 語                ������
41 CE A9 E8 AA 9E F0 A0 80 94



 A Ω 語 ������
0041 03A9 8A9E D840 DC14


   A         Ω        語         ������
00000041 000003A9 0000819E 00020014
Ậ=Ậ
  1EAC


 = A + ̂+ ̣
  0041   0302   0323


 = A + ̣+ ̂
  0041   0323   0302
NFD:できるだけ分解
    NFD(Â+ ̣)=A + ̣+ ̂

NFC:できるだけ合成
    NFC(A + ̂+ ̣)= Ậ

NFKD,NFKC:
    NFKD(カ)= カ
    NFKD(Dž)= D + z + ̆
Unicode Algorithm
• Unicode collation algorithm (UCA)
• Case mapping algorithm
• Bidirectional algorithm (BIDI)
Agenda
Unicodeとは?

OCamlとは?

 Camomile
Lisp,Scheme,Erlang




       ML系言語
        OCaml        Haskell
         F#




         Scala
OCaml vs Haskell
• 関数型言語
  – 副作用のないプログラミングスタイルを奨励
• Hindley-Milner type systemがベース
  – 強い静的型付け
  – 型推論
  – 多相型
OCaml vs Haskell(続き)
      OCaml             Haskell
Eager              Lazy
副作用あり              モナド
begin … end etc.   オフサイドルール
独自機能               独自機能
      モジュール             タイプクラス
      オブジェクト指向
Agenda
Unicodeとは?

OCamlとは?

 Camomile
Camomile
•   基本データ型
•   文字コード変換
•   正規化
•   Unicode Algorithms
    – UCA (文字列照合)
    – Case mappings
• 正規表現
サイト
• Github / yoriyuki / Camomile
• 課題
  – ulib
  – Unicode 6.X対応
  – まともな正規表現エンジン
  – バグ、バグ、バグ…

Mais conteúdo relacionado

Mais de Yamagata Yoriyuki

CSPを用いたログ解析その他
CSPを用いたログ解析その他CSPを用いたログ解析その他
CSPを用いたログ解析その他Yamagata Yoriyuki
 
Consistency proof of a feasible arithmetic inside a bounded arithmetic
Consistency proof of a feasible arithmetic inside a bounded arithmeticConsistency proof of a feasible arithmetic inside a bounded arithmetic
Consistency proof of a feasible arithmetic inside a bounded arithmeticYamagata Yoriyuki
 
Consistency proof of a feasible arithmetic inside a bounded arithmetic
Consistency proof of a feasible arithmetic inside a bounded arithmeticConsistency proof of a feasible arithmetic inside a bounded arithmetic
Consistency proof of a feasible arithmetic inside a bounded arithmeticYamagata Yoriyuki
 
Rubyでデータマイニング: RubyKaigi2007ライトニングトーク
Rubyでデータマイニング: RubyKaigi2007ライトニングトークRubyでデータマイニング: RubyKaigi2007ライトニングトーク
Rubyでデータマイニング: RubyKaigi2007ライトニングトークYamagata Yoriyuki
 
CSPによる並行システムの検証(2)
CSPによる並行システムの検証(2)CSPによる並行システムの検証(2)
CSPによる並行システムの検証(2)Yamagata Yoriyuki
 
CSPによるコンカレントシステムの検証(1)
CSPによるコンカレントシステムの検証(1)CSPによるコンカレントシステムの検証(1)
CSPによるコンカレントシステムの検証(1)Yamagata Yoriyuki
 
Bounded arithmetic in free logic
Bounded arithmetic in free logicBounded arithmetic in free logic
Bounded arithmetic in free logicYamagata Yoriyuki
 
Bounded arithmetic in free logic
Bounded arithmetic in free logicBounded arithmetic in free logic
Bounded arithmetic in free logicYamagata Yoriyuki
 
Camomile : A Unicode library for OCaml
Camomile : A Unicode library for OCamlCamomile : A Unicode library for OCaml
Camomile : A Unicode library for OCamlYamagata Yoriyuki
 
Google 日本語入力 TechTalk 2010
Google 日本語入力 TechTalk 2010Google 日本語入力 TechTalk 2010
Google 日本語入力 TechTalk 2010Yamagata Yoriyuki
 

Mais de Yamagata Yoriyuki (14)

CSPを用いたログ解析その他
CSPを用いたログ解析その他CSPを用いたログ解析その他
CSPを用いたログ解析その他
 
Consistency proof of a feasible arithmetic inside a bounded arithmetic
Consistency proof of a feasible arithmetic inside a bounded arithmeticConsistency proof of a feasible arithmetic inside a bounded arithmetic
Consistency proof of a feasible arithmetic inside a bounded arithmetic
 
Consistency proof of a feasible arithmetic inside a bounded arithmetic
Consistency proof of a feasible arithmetic inside a bounded arithmeticConsistency proof of a feasible arithmetic inside a bounded arithmetic
Consistency proof of a feasible arithmetic inside a bounded arithmetic
 
OCamlとUnicode
OCamlとUnicodeOCamlとUnicode
OCamlとUnicode
 
Rubyでデータマイニング: RubyKaigi2007ライトニングトーク
Rubyでデータマイニング: RubyKaigi2007ライトニングトークRubyでデータマイニング: RubyKaigi2007ライトニングトーク
Rubyでデータマイニング: RubyKaigi2007ライトニングトーク
 
CSPによる並行システムの検証(2)
CSPによる並行システムの検証(2)CSPによる並行システムの検証(2)
CSPによる並行システムの検証(2)
 
CSPによるコンカレントシステムの検証(1)
CSPによるコンカレントシステムの検証(1)CSPによるコンカレントシステムの検証(1)
CSPによるコンカレントシステムの検証(1)
 
Bounded arithmetic in free logic
Bounded arithmetic in free logicBounded arithmetic in free logic
Bounded arithmetic in free logic
 
Bounded arithmetic in free logic
Bounded arithmetic in free logicBounded arithmetic in free logic
Bounded arithmetic in free logic
 
UML&FM 2012
UML&FM 2012UML&FM 2012
UML&FM 2012
 
Translating STM to CSP
Translating STM to CSPTranslating STM to CSP
Translating STM to CSP
 
Camomile : A Unicode library for OCaml
Camomile : A Unicode library for OCamlCamomile : A Unicode library for OCaml
Camomile : A Unicode library for OCaml
 
Google 日本語入力 TechTalk 2010
Google 日本語入力 TechTalk 2010Google 日本語入力 TechTalk 2010
Google 日本語入力 TechTalk 2010
 
CamomileでUnicode
CamomileでUnicodeCamomileでUnicode
CamomileでUnicode
 

Camomile - OCaml用Unicodeライブラリ