t-suw****@users*****
t-suw****@users*****
2007年 9月 8日 (土) 22:35:19 JST
Index: AquaSKK/src/test/Makefile diff -u AquaSKK/src/test/Makefile:1.1.2.1 AquaSKK/src/test/Makefile:1.1.2.2 --- AquaSKK/src/test/Makefile:1.1.2.1 Sun Aug 26 01:34:45 2007 +++ AquaSKK/src/test/Makefile Sat Sep 8 22:35:19 2007 @@ -5,7 +5,7 @@ VPATH = $(shell find .. -type d -a ! -name CVS -a ! -name test -a ! -name ..) ../.. CXXFLAGS= -g $(foreach dir,$(VPATH),-I$(dir)) -TARGET = SKKKeymapEntry_TEST SKKKeymap_TEST +TARGET = SKKKeymapEntry_TEST SKKKeymap_TEST SKKRomanKanaConverter_TEST define BUILD_template $(1): $(1).o @@ -22,10 +22,10 @@ ### rule ### clean: - $(RM) $(TARGET) *.o + $(RM) $(TARGET) *.o $(LOG) test: build - for i in $(TARGET); do ./$$i; done + for i in $(TARGET); do ./$$i ; done ### ### dependencies @@ -33,3 +33,4 @@ SKKKeymapEntry_TEST.o: SKKKeymapEntry_TEST.cpp SKKKeymapEntry.cpp SKKKeymapEntry.h SKKKeymap_TEST.o: SKKKeymap_TEST.cpp SKKKeymapEntry.cpp SKKKeymapEntry.h SKKKeymap.cpp SKKKeymap.h +SKKRomanKanaConverter_TEST.o: SKKRomanKanaConverter_TEST.cpp SKKRomanKanaConverter.h SKKRomanKanaConverter.cpp Index: AquaSKK/src/test/SKKKeymap_TEST.cpp diff -u AquaSKK/src/test/SKKKeymap_TEST.cpp:1.1.2.1 AquaSKK/src/test/SKKKeymap_TEST.cpp:1.1.2.2 --- AquaSKK/src/test/SKKKeymap_TEST.cpp:1.1.2.1 Sun Aug 26 01:34:45 2007 +++ AquaSKK/src/test/SKKKeymap_TEST.cpp Sat Sep 8 22:35:19 2007 @@ -33,5 +33,4 @@ param = keymap.Fetch('f', 0, true); assert(param == SKKEventParam(SKK_RIGHT, 'f', 0)); - std::cerr << param.dump() << std::endl; } Index: AquaSKK/src/test/SKKRomanKanaConverter_TEST.cpp diff -u /dev/null AquaSKK/src/test/SKKRomanKanaConverter_TEST.cpp:1.1.2.1 --- /dev/null Sat Sep 8 22:35:19 2007 +++ AquaSKK/src/test/SKKRomanKanaConverter_TEST.cpp Sat Sep 8 22:35:19 2007 @@ -0,0 +1,75 @@ +#include "SKKRomanKanaConverter.cpp" +#include "jconv.cpp" + +int main() { + SKKRomanKanaConverter& conv = SKKRomanKanaConverter::theInstance(); + + conv.Initialize("kana-rule-list.test"); + + bool result; + std::string in; + std::string out; + std::string next; + + result = conv.Execute(SKK::Hirakana, "a", out, next); + assert(result == true && next == "" && out == "ã"); + + result = conv.Execute(SKK::Katakana, "a", out, next); + assert(next == "" && out == "ã¢"); + result = conv.Execute(SKK::Jisx0201Kana, "a", out, next); + assert(next == "" && out == "ï½±"); + + result = conv.Execute(SKK::Hirakana, "gg", out, next); + assert(next == "g" && out == "ã£"); + + result = conv.Execute(SKK::Hirakana, ",", out, next); + assert(next == "" && out == "ã"); + + result = conv.Execute(SKK::Hirakana, "#", out, next); + assert(next == "" && out == "ï¼"); + + result = conv.Execute(SKK::Hirakana, " ", out, next); + assert(next == "" && out == " "); + + result = conv.Execute(SKK::Hirakana, "kyl", out, next); + assert(next == "" && out == "l"); + + result = conv.Execute(SKK::Hirakana, "z,", out, next); + assert(next == "" && out == "â¥"); + + result = conv.Execute(SKK::Hirakana, "co", out, next); + assert(next == "" && out == "ã"); + + result = conv.Execute(SKK::Hirakana, "'", out, next); + assert(next == "" && out == "'"); + + result = conv.Execute(SKK::Hirakana, "k1", out, next); + assert(next == "" && out == "1"); + + result = conv.Execute(SKK::Hirakana, "kgya", out, next); + assert(next == "" && out == "ãã"); + + result = conv.Execute(SKK::Hirakana, "k1234gya", out, next); + assert(next == "" && out == "1234ãã"); + + result = conv.Execute(SKK::Hirakana, "gyagyugyo", out, next); + assert(next == "" && out == "ãããã ãã"); + + result = conv.Execute(SKK::Hirakana, "chho", out, next); + assert(next == "" && out == "ã»"); + + result = conv.Execute(SKK::Hirakana, "c", out, next); + assert(next == "c" && out == ""); + + result = conv.Execute(SKK::Hirakana, "pmp", out, next); + assert(next == "p" && out == ""); + + result = conv.Execute(SKK::Hirakana, "pmpo", out, next); + assert(next == "" && out == "ã½"); + + result = conv.Execute(SKK::Hirakana, "kanji", out, next); + assert(next == "" && out == "ããã"); + + result = conv.Execute(SKK::Hirakana, "/", out, next); + assert(next == "" && out == "/"); +} Index: AquaSKK/src/test/kana-rule-list.test diff -u /dev/null AquaSKK/src/test/kana-rule-list.test:1.1.2.1 --- /dev/null Sat Sep 8 22:35:19 2007 +++ AquaSKK/src/test/kana-rule-list.test Sat Sep 8 22:35:19 2007 @@ -0,0 +1,278 @@ +# $Id: kana-rule-list.test,v 1.1.2.1 2007/09/08 13:35:19 t-suwa Exp $ + +# このファイルは改行コードがLF、文字エンコーディングがEUC-JPでなければなりません。 +# 五つ目の項目は次状態です。無ければ項目自体を省略します。 +# エントリの順序には気を付けて下さい。例えば「ba」というエントリに出会うと、 +# AquaSKKはまず「b」という枝を探しますが、ここではまだ存在しないので +# 「b」という空の枝を作成します。この後に「b」というエントリが現れると +# そのエントリ「b」は既に定義されているのでどうなるか分かりません。 + +# 最初の項目の,は半角カンマに置換されます。 + +a,あ,ア,ア + +bb,っ,ッ,ッ,b +ba,ば,バ,バ +bi,び,ビ,ビ +bu,ぶ,ブ,ブ +be,べ,ベ,ベ +bo,ぼ,ボ,ボ +bya,びゃ,ビャ,ビャ +byi,びぃ,ビィ,ビィ +byu,びゅ,ビュ,ビュ +bye,びぇ,ビェ,ビェ +byo,びょ,ビョ,ビョ + +cc,っ,ッ,ッ,c +cha,ちゃ,チャ,チャ +chi,ち,チ,チ +chu,ちゅ,チュ,チュ +che,ちぇ,チェ,チェ +cho,ちょ,チョ,チョ +cya,ちゃ,チャ,チャ +cyi,ちぃ,チィ,チィ +cyu,ちゅ,チュ,チュ +cye,ちぇ,チェ,チェ +cyo,ちょ,チョ,チョ + +dd,っ,ッ,ッ,d +da,だ,ダ,ダ +di,ぢ,ヂ,ヂ +du,づ,ヅ,ヅ +de,で,デ,デ +do,ど,ド,ド +dha,でゃ,デャ,デャ +dhi,でぃ,ディ,ディ +dhu,でゅ,デュ,デュ +dhe,でぇ,デェ,デェ +dho,でょ,デョ,デョ +dya,ぢゃ,ヂャ,ヂャ +dyi,ぢぃ,ヂィ,ヂィ +dyu,ぢゅ,ヂュ,ヂュ +dye,ぢぇ,ヂェ,ヂェ +dyo,ぢょ,ヂョ,ヂョ + +e,え,エ,エ + +ff,っ,ッ,ッ,f +fa,ふぁ,ファ,ファ +fi,ふぃ,フィ,フィ +fu,ふ,フ,フ +fe,ふぇ,フェ,フェ +fo,ふぉ,フォ,フォ +fya,ふゃ,フャ,フャ +fyi,ふぃ,フィ,フィ +fyu,ふゅ,フュ,フュ +fye,ふぇ,フェ,フェ +fyo,ふょ,フョ,フョ + +gg,っ,ッ,ッ,g +ga,が,ガ,ガ +gi,ぎ,ギ,ギ +gu,ぐ,グ,グ +ge,げ,ゲ,ゲ +go,ご,ゴ,ゴ +gya,ぎゃ,ギャ,ギャ +gyi,ぎぃ,ギィ,ギィ +gyu,ぎゅ,ギュ,ギュ +gye,ぎぇ,ギェ,ギェ +gyo,ぎょ,ギョ,ギョ + +hh,っ,ッ,ッ,h +ha,は,ハ,ハ +hi,ひ,ヒ,ヒ +hu,ふ,フ,フ +he,へ,ヘ,ヘ +ho,ほ,ホ,ホ +hya,ひゃ,ヒャ,ヒャ +hyi,ひぃ,ヒィ,ヒィ +hyu,ひゅ,ヒュ,ヒュ +hye,ひぇ,ヒェ,ヒェ +hyo,ひょ,ヒョ,ヒョ + +i,い,イ,イ + +jj,っ,ッ,ッ,j +ja,じゃ,ジャ,ジャ +ji,じ,ジ,ジ +ju,じゅ,ジュ,ジュ +je,じぇ,ジェ,ジェ +jo,じょ,ジョ,ジョ +jya,じゃ,ジャ,ジャ +jyi,じぃ,ジィ,ジィ +jyu,じゅ,ジュ,ジュ +jye,じぇ,ジェ,ジェ +jyo,じょ,ジョ,ジョ + +kk,っ,ッ,ッ,k +ka,か,カ,カ +ki,き,キ,キ +ku,く,ク,ク +ke,け,ケ,ケ +ko,こ,コ,コ +kya,きゃ,キャ,キャ +kyi,きぃ,キィ,キィ +kyu,きゅ,キュ,キュ +kye,きぇ,キェ,キェ +kyo,きょ,キョ,キョ + +mm,っ,ッ,ッ,m +ma,ま,マ,マ +mi,み,ミ,ミ +mu,む,ム,ム +me,め,メ,メ +mo,も,モ,モ +mya,みゃ,ミャ,ミャ +myi,みぃ,ミィ,ミィ +myu,みゅ,ミュ,ミュ +mye,みぇ,ミェ,ミェ +myo,みょ,ミョ,ミョ + +n,ん,ン,ン +n',ん,ン,ン +nn,ん,ン,ン +na,な,ナ,ナ +ni,に,ニ,ニ +nu,ぬ,ヌ,ヌ +ne,ね,ネ,ネ +no,の,ノ,ノ +nya,にゃ,ニャ,ニャ +nyi,にぃ,ニィ,ニィ +nyu,にゅ,ニュ,ニュ +nye,にぇ,ニェ,ニェ +nyo,にょ,ニョ,ニョ + +o,お,オ,オ + +pp,っ,ッ,ッ,p +pa,ぱ,パ,パ +pi,ぴ,ピ,ピ +pu,ぷ,プ,プ +pe,ぺ,ペ,ペ +po,ぽ,ポ,ポ +pya,ぴゃ,ピャ,ピャ +pyi,ぴぃ,ピィ,ピィ +pyu,ぴゅ,ピュ,ピュ +pye,ぴぇ,ピェ,ピェ +pyo,ぴょ,ピョ,ピョ + +rr,っ,ッ,ッ,r +ra,ら,ラ,ラ +ri,り,リ,リ +ru,る,ル,ル +re,れ,レ,レ +ro,ろ,ロ,ロ +rya,りゃ,リャ,リャ +ryi,りぃ,リィ,リィ +ryu,りゅ,リュ,リュ +rye,りぇ,リェ,リェ +ryo,りょ,リョ,リョ + +ss,っ,ッ,ッ,s +sa,さ,サ,サ +si,し,シ,シ +su,す,ス,ス +se,せ,セ,セ +so,そ,ソ,ソ +sha,しゃ,シャ,シャ +shi,し,シ,シ +shu,しゅ,シュ,シュ +she,しぇ,シェ,シェ +sho,しょ,ショ,ショ +sya,しゃ,シャ,シャ +syi,しぃ,シィ,シィ +syu,しゅ,シュ,シュ +sye,しぇ,シェ,シェ +syo,しょ,ショ,ショ + +tt,っ,ッ,ッ,t +ta,た,タ,タ +ti,ち,チ,チ +tu,つ,ツ,ツ +te,て,テ,テ +to,と,ト,ト +tha,てぁ,テァ,テァ +thi,てぃ,ティ,ティ +thu,てゅ,テュ,テュ +the,てぇ,テェ,テェ +tho,てょ,テョ,テョ +tsu,つ,ツ,ツ +tya,ちゃ,チャ,チャ +tyi,ちぃ,チィ,チィ +tyu,ちゅ,チュ,チュ +tye,ちぇ,チェ,チェ +tyo,ちょ,チョ,チョ + +u,う,ウ,ウ + +vv,っ,ッ,ッ,v +va,う゛ぁ,ヴァ,ヴァ +vi,う゛ぃ,ヴィ,ヴィ +vu,う゛,ヴ,ヴ +ve,う゛ぇ,ヴェ,ヴェ +vo,う゛ぉ,ヴォ,ヴォ + +ww,っ,ッ,ッ,w +wa,わ,ワ,ワ +wi,うぃ,ウィ,ウィ +wu,う,ウ,ウ +we,うぇ,ウェ,ウェ +wo,を,ヲ,ヲ + +xx,っ,ッ,ッ,x +xa,ぁ,ァ,ァ +xi,ぃ,ィ,ィ +xu,ぅ,ゥ,ゥ +xe,ぇ,ェ,ェ +xo,ぉ,ォ,ォ +xka,ヵ,ヵ,カ +xke,ヶ,ヶ,ケ +xtsu,っ,ッ,ッ +xtu,っ,ッ,ッ +xu,ぅ,ゥ,ゥ +xwa,ゎ,ヮ,ワ +xwe,ゑ,ヱ,エ +xwi,ゐ,ヰ,イ +xya,ゃ,ャ,ャ +xyo,ょ,ョ,ョ +xyu,ゅ,ュ,ュ + +yy,っ,ッ,ッ,y +ya,や,ヤ,ヤ +yi,い,イ,イ +yu,ゆ,ユ,ユ +ye,いぇ,イェ,イェ +yo,よ,ヨ,ヨ + +zz,っ,ッ,ッ,z +za,ざ,ザ,ザ +zi,じ,ジ,ジ +zu,ず,ズ,ズ +ze,ぜ,ゼ,ゼ +zo,ぞ,ゾ,ゾ +zya,じゃ,ジャ,ジャ +zyi,じぃ,ジィ,ジィ +zyu,じゅ,ジュ,ジュ +zye,じぇ,ジェ,ジェ +zyo,じょ,ジョ,ジョ +z,,‥,‥,‥ +z-,〜,〜,〜 +z.,…,…,… +z/,・,・,・ +z[,『,『,『 +z],』,』,』 +zh,←,←,← +zj,↓,↓,↓ +zk,↑,↑,↑ +zl,→,→,→ + +-,ー,ー,ー +:,:,:,: +;,;,;,; +[,「,「,「 +],」,」,」 + +.,。,。,。 +,,、,、,、 +♯,#,#,♯ +&space;,&space;,&space;,&space;