sekka 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,942 @@
1
+ ;;-*- mode: nendo; syntax: scheme -*-
2
+ ;;;
3
+ ;;; henkan-main.nnd - 変換エンジンのコア部分のテストスイート
4
+ ;;;
5
+ ;;; Copyright (c) 2010 Kiyoka Nishiyama <kiyoka@sumibi.org>
6
+ ;;;
7
+ ;;; Redistribution and use in source and binary forms, with or without
8
+ ;;; modification, are permitted provided that the following conditions
9
+ ;;; are met:
10
+ ;;;
11
+ ;;; 1. Redistributions of source code must retain the above copyright
12
+ ;;; notice, this list of conditions and the following disclaimer.
13
+ ;;;
14
+ ;;; 2. Redistributions in binary form must reproduce the above copyright
15
+ ;;; notice, this list of conditions and the following disclaimer in the
16
+ ;;; documentation and/or other materials provided with the distribution.
17
+ ;;;
18
+ ;;; 3. Neither the name of the authors nor the names of its contributors
19
+ ;;; may be used to endorse or promote products derived from this
20
+ ;;; software without specific prior written permission.
21
+ ;;;
22
+ ;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23
+ ;;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24
+ ;;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25
+ ;;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26
+ ;;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27
+ ;;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
28
+ ;;; TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29
+ ;;; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30
+ ;;; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31
+ ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32
+ ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
+ ;;;
34
+ ;;; $Id:
35
+ ;;;
36
+ (require "sekka/kvs")
37
+ (use nendo.test)
38
+ (use sekka.convert-jisyo)
39
+ (use sekka.henkan)
40
+ (load "./test/common.nnd")
41
+
42
+ (define dbtype (string->symbol (first *argv*)))
43
+ (define userid "dummy")
44
+ (define userid2 "dummy2")
45
+
46
+ (test-start "henkan engine")
47
+ ;;===================================================================
48
+
49
+ ;;-------------------------------------------------------------------
50
+ (define target nil)
51
+ (cond
52
+ ((eq? dbtype 'tokyocabinet)
53
+ (set! target "./test.tch"))
54
+ ((eq? dbtype 'memcache)
55
+ (set! target "localhost:11211"))
56
+ (else
57
+ (errorf "Unsupported db type [%s]" (symbol->string dbtype))))
58
+
59
+
60
+ ;;-------------------------------------------------------------------
61
+ (test-section "Create jisyo for test suite")
62
+
63
+ (let ((_input (StringIO.new
64
+ (string-join
65
+ '(
66
+ "わたしh /私/"
67
+ "おこなu /行/行な;※送り位置補正/"
68
+ "へんかん /変換/返還/"
69
+ "へんか /変化/返歌/"
70
+ "へんかs /変化/"
71
+ "しぜんげんご /自然言語/"
72
+ "しぜんげんごしょり /自然言語処理/"
73
+ "しぜんげんごりかい /自然言語理解/"
74
+ "developer /デベロッパー/ディベロッパー/デベロッパ/"
75
+ ">あん /案/"
76
+ "{ /{/"
77
+ "かっこ /確固/括弧/各個/各戸/確乎/羯鼓;雅楽の打楽器/格好/『』/【】/[]/〔〕/〈〉/《》/{}/「」/()/‘’/“”/"
78
+ "こっか /国家;state/国歌;anthem.「-斉唱」/国花/骨化/國家;「国」旧字/黒化/刻下/】/)/]/』/"
79
+ "! /!/感嘆符/"
80
+ ". /./・/。/…;.../"
81
+ "* /*/※/×/"
82
+ "? /?/"
83
+ "/ ///÷/"
84
+ "!= /≠/"
85
+ "こーひー /コーヒー/"
86
+ "かに /蟹/可児/蠏/"
87
+ "かんい /簡易/官位/冠位;-十二階/漢医;漢方医/敢為/官医/寛衣/換位/簡意/"
88
+ "いっち /一致/"
89
+ "いっち /イッチ/"
90
+ "えr /得/獲;NB:「とr」と同形/選;NB:「よr」「すぐr」と同形/"
91
+ "を /小/緒/雄/男/牡/尾/悪/汚/惡;「悪」の旧字(人名用漢字)/"
92
+ "みr /見/観;(字義:みわたす)/視;(字義:じっとみる)/診;(diagnose) 患者を診る/看;(nurse) 病母を看る/觀;「観」の旧字/"
93
+ "wake /ウェイク/"
94
+ "わけ /訳/和気;地名/理由;当て字/分け/分/譯;「訳」の旧字/戯奴/"
95
+ "あu /合;(一致) 話が合う/会;人と会う/遭;(偶然、特によくないことにあう) 事故に遭う/逢;(人と|運命的にあう) 巡り逢う/遇;≒遭う/會;「会」の旧字/"
96
+ "さく /策/柵/作/佐久;地名/朔;朔日 ⇔晦/槊;ほこ/搾;搾取/昨;昨夜/咋;(くう)/窄;狭窄/酢;酢酸/柞;いすのき/炸;炸裂/筰;山田耕筰/削;削除/索;検索/錯;錯誤/筴/縒;より/鑿/做;「作」の異体字/簀;す/嘖;さいな・む/捉;(漢音) とら・える/齪;齷齪/冊;(慣用音)竹冊/册;「冊」の旧字/辟;?/乍;?/"
97
+ "さき /先/崎/左記/前/早紀/沙樹/早岐/沙貴/咲/埼/尖/嵜/碕/早記/"
98
+ "いんにょう /飲尿/廴繞;[部首]/"
99
+ "いんよう /引用/飲用/陰陽/"
100
+ "かt /勝/買/飼/刈;(crop)草を刈る")
101
+ "\n")))
102
+ (sekka-jisyo-data
103
+ '("watashiH Cわたしh" "watasiH Cわたしh" "wtshiH Cわたしh" "wtsiH Cわたしh" "わたしh /私" "okonaU Cおこなu" "おこなu /行/行な;※送り位置補正" "hdkn Cへんかん" "hdkz Cへんかん" "henkan Cへんかん" "henkann Cへんかん" "henkaq Cへんかん" "hennkan Cへんかん" "hennkann Cへんかん" "hennkaq Cへんかん" "heqkan Cへんかん" "heqkann Cへんかん" "heqkaq Cへんかん" "へんかん /変換/返還" "hdka Cへんか" "henka Cへんか" "hennka Cへんか" "heqka Cへんか" "へんか /変化/返歌" "hdkaS Cへんかs" "henkaS Cへんかs" "hennkaS Cへんかs" "heqkaS Cへんかs" "へんかs /変化" "shizdgdgo Cしぜんげんご" "shizengengo Cしぜんげんご" "shizengenngo Cしぜんげんご" "shizengeqgo Cしぜんげんご" "shizenngengo Cしぜんげんご" "shizenngenngo Cしぜんげんご" "shizenngeqgo Cしぜんげんご" "shizeqgengo Cしぜんげんご" "shizeqgenngo Cしぜんげんご" "shizeqgeqgo Cしぜんげんご" "sizdgdgo Cしぜんげんご" "sizengengo Cしぜんげんご" "sizengenngo Cしぜんげんご" "sizengeqgo Cしぜんげんご" "sizenngengo Cしぜんげんご" "sizenngenngo Cしぜんげんご" "sizenngeqgo Cしぜんげんご" "sizeqgengo Cしぜんげんご" "sizeqgenngo Cしぜんげんご" "sizeqgeqgo Cしぜんげんご" "しぜんげんご /自然言語" "shizdgdgoshori Cしぜんげんごしょり" "shizdgdgosyori Cしぜんげんごしょり" "shizdgdgoxori Cしぜんげんごしょり" "shizengengoshori Cしぜんげんごしょり" "shizengengosyori Cしぜんげんごしょり" "shizengengoxori Cしぜんげんごしょり" "shizengenngoshori Cしぜんげんごしょり" "shizengenngosyori Cしぜんげんごしょり" "shizengenngoxori Cしぜんげんごしょり" "shizengeqgoshori Cしぜんげんごしょり" "shizengeqgosyori Cしぜんげんごしょり" "shizengeqgoxori Cしぜんげんごしょり" "shizenngengoshori Cしぜんげんごしょり" "shizenngengosyori Cしぜんげんごしょり" "shizenngengoxori Cしぜんげんごしょり" "shizenngenngoshori Cしぜんげんごしょり" "shizenngenngosyori Cしぜんげんごしょり" "shizenngenngoxori Cしぜんげんごしょり" "shizenngeqgoshori Cしぜんげんごしょり" "shizenngeqgosyori Cしぜんげんごしょり" "shizenngeqgoxori Cしぜんげんごしょり" "shizeqgengoshori Cしぜんげんごしょり" "shizeqgengosyori Cしぜんげんごしょり" "shizeqgengoxori Cしぜんげんごしょり" "shizeqgenngoshori Cしぜんげんごしょり" "shizeqgenngosyori Cしぜんげんごしょり" "shizeqgenngoxori Cしぜんげんごしょり" "shizeqgeqgoshori Cしぜんげんごしょり" "shizeqgeqgosyori Cしぜんげんごしょり" "shizeqgeqgoxori Cしぜんげんごしょり" "sizdgdgoshori Cしぜんげんごしょり" "sizdgdgosyori Cしぜんげんごしょり" "sizdgdgoxori Cしぜんげんごしょり" "sizengengoshori Cしぜんげんごしょり" "sizengengosyori Cしぜんげんごしょり" "sizengengoxori Cしぜんげんごしょり" "sizengenngoshori Cしぜんげんごしょり" "sizengenngosyori Cしぜんげんごしょり" "sizengenngoxori Cしぜんげんごしょり" "sizengeqgoshori Cしぜんげんごしょり" "sizengeqgosyori Cしぜんげんごしょり" "sizengeqgoxori Cしぜんげんごしょり" "sizenngengoshori Cしぜんげんごしょり" "sizenngengosyori Cしぜんげんごしょり" "sizenngengoxori Cしぜんげんごしょり" "sizenngenngoshori Cしぜんげんごしょり" "sizenngenngosyori Cしぜんげんごしょり" "sizenngenngoxori Cしぜんげんごしょり" "sizenngeqgoshori Cしぜんげんごしょり" "sizenngeqgosyori Cしぜんげんごしょり" "sizenngeqgoxori Cしぜんげんごしょり" "sizeqgengoshori Cしぜんげんごしょり" "sizeqgengosyori Cしぜんげんごしょり" "sizeqgengoxori Cしぜんげんごしょり" "sizeqgenngoshori Cしぜんげんごしょり" "sizeqgenngosyori Cしぜんげんごしょり" "sizeqgenngoxori Cしぜんげんごしょり" "sizeqgeqgoshori Cしぜんげんごしょり" "sizeqgeqgosyori Cしぜんげんごしょり" "sizeqgeqgoxori Cしぜんげんごしょり" "しぜんげんごしょり /自然言語処理" "shizdgdgorikq Cしぜんげんごりかい" "shizengengorikai Cしぜんげんごりかい" "shizengenngorikai Cしぜんげんごりかい" "shizengeqgorikai Cしぜんげんごりかい" "shizenngengorikai Cしぜんげんごりかい" "shizenngenngorikai Cしぜんげんごりかい" "shizenngeqgorikai Cしぜんげんごりかい" "shizeqgengorikai Cしぜんげんごりかい" "shizeqgenngorikai Cしぜんげんごりかい" "shizeqgeqgorikai Cしぜんげんごりかい" "sizdgdgorikq Cしぜんげんごりかい" "sizengengorikai Cしぜんげんごりかい" "sizengenngorikai Cしぜんげんごりかい" "sizengeqgorikai Cしぜんげんごりかい" "sizenngengorikai Cしぜんげんごりかい" "sizenngenngorikai Cしぜんげんごりかい" "sizenngeqgorikai Cしぜんげんごりかい" "sizeqgengorikai Cしぜんげんごりかい" "sizeqgenngorikai Cしぜんげんごりかい" "sizeqgeqgorikai Cしぜんげんごりかい" "しぜんげんごりかい /自然言語理解" "developer /デベロッパー/ディベロッパー/デベロッパ" ">an C>あん" ">ann C>あん" ">aq C>あん" ">あん /案" "{ /{" "ka;ko Cかっこ" "ka@ko Cかっこ" "kakko Cかっこ" "かっこ /確固/括弧/各個/各戸/確乎/羯鼓;雅楽の打楽器/格好/『』/【】/[]/〔〕/〈〉/《》/{}/「」/()/‘’/“”" "ko;ka Cこっか" "ko@ka Cこっか" "kokka Cこっか" "こっか /国家;state/国歌;anthem.「-斉唱」/国花/骨化/國家;「国」旧字/黒化/刻下/】/)/]/』" "! /!/感嘆符" ". /./・/。/…;..." "* /*/※/×" "? /?" "/ ///÷" "!= /≠" "ko-hi- Cこーひー" "ko-hi: Cこーひー" "ko-hi^ Cこーひー" "ko:hi- Cこーひー" "ko:hi: Cこーひー" "ko:hi^ Cこーひー" "ko^hi- Cこーひー" "ko^hi: Cこーひー" "ko^hi^ Cこーひー" "こーひー /コーヒー" "kani Cかに" "かに /蟹/可児/蠏" "kani Cかんい" "kanni Cかんい" "kaqi Cかんい" "kni Cかんい" "kzi Cかんい" "かんい /簡易/官位/冠位;-十二階/漢医;漢方医/敢為/官医/寛衣/換位/簡意" "i;chi Cいっち" "i;ci Cいっち" "i;tyi Cいっち" "i@chi Cいっち" "i@ci Cいっち" "i@tyi Cいっち" "icchi Cいっち" "icci Cいっち" "ittyi Cいっち" "いっち /一致" "i;chi Cいっち" "i;ci Cいっち" "i;tyi Cいっち" "i@chi Cいっち" "i@ci Cいっち" "i@tyi Cいっち" "icchi Cいっち" "icci Cいっち" "ittyi Cいっち" "いっち /イッチ" "eR Cえr" "えr /得/獲;NB:「とr」と同形/選;NB:「よr」「すぐr」と同形" "wo Cを" "を /小/緒/雄/男/牡/尾/悪/汚/惡;「悪」の旧字(人名用漢字)" "miR Cみr" "みr /見/観;(字義:みわたす)/視;(字義:じっとみる)/診;(diagnose) 患者を診る/看;(nurse) 病母を看る/觀;「観」の旧字" "wake /ウェイク" "wake Cわけ" "わけ /訳/和気;地名/理由;当て字/分け/分/譯;「訳」の旧字/戯奴" "aU Cあu" "あu /合;(一致) 話が合う/会;人と会う/遭;(偶然、特によくないことにあう) 事故に遭う/逢;(人と|運命的にあう) 巡り逢う/遇;≒遭う/會;「会」の旧字" "saku Cさく" "さく /策/柵/作/佐久;地名/朔;朔日 ⇔晦/槊;ほこ/搾;搾取/昨;昨夜/咋;(くう)/窄;狭窄/酢;酢酸/柞;いすのき/炸;炸裂/筰;山田耕筰/削;削除/索;検索/錯;錯誤/筴/縒;より/鑿/做;「作」の異体字/簀;す/嘖;さいな・む/捉;(漢音) とら・える/齪;齷齪/冊;(慣用音)竹冊/册;「冊」の旧字/辟;?/乍;?" "saki Cさき" "さき /先/崎/左記/前/早紀/沙樹/早岐/沙貴/咲/埼/尖/嵜/碕/早記" "inngou Cいんにょう" "innngou Cいんにょう" "innnyou Cいんにょう" "innyou Cいんにょう" "iqngou Cいんにょう" "iqnyou Cいんにょう" "いんにょう /飲尿/廴繞;[部首]" "innyou Cいんよう" "innyp Cいんよう" "inyou Cいんよう" "inyp Cいんよう" "iqyou Cいんよう" "iqyp Cいんよう" "いんよう /引用/飲用/陰陽" "kaT Cかt" "かt /勝/買/飼/刈;(crop)草を刈る" "ka` Cか`" "か` /勝/買/飼/刈;(crop)草を刈る" "ka+ Cか+" "か+ /勝/買/飼/刈;(crop)草を刈る")
104
+ ))
105
+
106
+ (test* "Create test jisyo"
107
+ sekka-jisyo-data
108
+ (convert-skk-jisyo-f _input))
109
+
110
+ (test* "default KVS type" 'tokyocabinet (get-kvs-type))
111
+
112
+ (set-kvs-type dbtype)
113
+ (test* "changed KVS type" dbtype (get-kvs-type))
114
+
115
+ (let1 sio (StringIO.new (string-join sekka-jisyo-data "\n"))
116
+ (sio.set_encoding "utf-8")
117
+ (load-sekka-jisyo-f sio target)))
118
+
119
+
120
+ ;;-------------------------------------------------------------------
121
+ (when (eq? dbtype 'tokyocabinet)
122
+ (require "digest/sha1")
123
+ (test-section "dump db")
124
+ (let1 _output (StringIO.new)
125
+ (_output.set_encoding "utf-8")
126
+ (test* "dump DB to SEKKA jisyo file. (1)"
127
+ "0e9dee43c79144807cac67a848f6887296482d58"
128
+ (begin
129
+ (dump-sekka-jisyo-f _output target)
130
+ (Digest::SHA1.hexdigest (_output.string))
131
+ ;;(_output.string)
132
+ ))))
133
+
134
+
135
+
136
+ (test-section "Open the test-suite DB")
137
+ (define a-search (ApproximateSearch.new 0.94))
138
+ (define kvs (Kvs.new dbtype))
139
+ (cond
140
+ ((eq? dbtype 'tokyocabinet)
141
+ (kvs.open target)
142
+ (require "tokyocabinet"))
143
+ ((eq? dbtype 'memcache)
144
+ (kvs.open target)
145
+ (require "memcache"))
146
+ (else
147
+ (errorf "Unsupported db type [%s]" (symbol->string dbtype))))
148
+
149
+ (define db (kvs._db))
150
+
151
+
152
+ ;;-------------------------------------------------------------------
153
+ (test-section "Register User dict")
154
+ (for-each
155
+ (lambda (x)
156
+ (let ((_answer (first x))
157
+ (_user (second x))
158
+ (_dict-line (third x)))
159
+ (test* (sprintf "register dict [%s] from queue" _dict-line)
160
+ _answer
161
+ (registerUserJisyo _user kvs _dict-line))))
162
+ `(
163
+ (#t ,userid "まじぱねぇ /マジパネェ/")
164
+ (#t ,userid "ぶろぐr /ブログ/")
165
+ (#t ,userid "ぶろぐt /ブログ/")
166
+ (#t ,userid "へんかんえんじん /変換エンジン/")
167
+ (#t ,userid "はてぶ /はてブ/はてなブックマーク/")
168
+ (#f ,userid "はてぶ /はてブ/はてなブックマーク/")
169
+ (#t ,userid "まじぱねぇ /マジパネェ/まじパネェ/マジ半端ネェ/まじ半端ネェ/")
170
+ (#f ,userid "まじぱねぇ /マジパネェ/まじパネェ/マジ半端ネェ/まじ半端ネェ/")
171
+ (#f ,userid "まじぱねぇ /マジパネェ/まじパネェ/マジ半端ネェ/まじ半端ネェ/")
172
+ (#t ,userid "てすとようえんとり /エントリA/エントリB/エントリC/")
173
+ (#f ,userid ";; コメント")
174
+ (#f ,userid ";;-------- 罫線 -------")
175
+ (#f ,userid "") ;; 空行
176
+ (#f ,userid "aaaa") ;; 明らかなフォーマットエラー
177
+ (#f ,userid "単語 /たんご/") ;; フォーマットエラー
178
+ ))
179
+
180
+
181
+ ;;-------------------------------------------------------------------
182
+ (test-section "simple db fetch")
183
+ (test* "db fetch 1"
184
+ "Cへんかん"
185
+ (. (hash-table-get db "MASTER::henkan" #f) force_encoding "UTF-8"))
186
+
187
+ (test* "db fetch 2"
188
+ "Cかに/かんい"
189
+ (. (hash-table-get db "MASTER::kani" #f) force_encoding "UTF-8"))
190
+
191
+ (test* "db fetch 3"
192
+ "Cかんい"
193
+ (. (hash-table-get db "MASTER::kanni" #f) force_encoding "UTF-8"))
194
+
195
+ (test* "db fetch 4"
196
+ #f
197
+ (hash-table-get db "MASTER::aaaa" #f))
198
+
199
+ (test* "db fetch 5"
200
+ "Cへんかんえんじん"
201
+ (. (hash-table-get db "dummy::henkanenjin" #f) force_encoding "UTF-8"))
202
+
203
+ (test* "db fetch 6"
204
+ "ka;ko ka@ko kakko kani kanni kaqi"
205
+ (. (hash-table-get db "MASTER::(ka)" #f) force_encoding "UTF-8"))
206
+
207
+ (test* "db fetch 7"
208
+ "ka+ kaT ka`"
209
+ (. (hash-table-get db "MASTER::(KA)" #f) force_encoding "UTF-8"))
210
+
211
+ (test* "db fetch 8"
212
+ "burogu+ buroguR buroguT burogu`"
213
+ (. (hash-table-get db "dummy::(BU)" #f) force_encoding "UTF-8"))
214
+
215
+ (test* "db fetch 9"
216
+ "tesutoyouenntori tesutoyouentori tesutoyoueqtori tesutoypenntori tesutoypentori tesutoypeqtori"
217
+ (. (hash-table-get db "dummy::(te)" #f) force_encoding "UTF-8"))
218
+
219
+ (test* "db fetch 10"
220
+ "/エントリA/エントリB/エントリC"
221
+ (. (hash-table-get db "dummy::てすとようえんとり" #f) force_encoding "UTF-8"))
222
+
223
+
224
+
225
+ ;;-------------------------------------------------------------------
226
+ (test-section "Replace user dict entry")
227
+ (test* "replace information of user dict entry"
228
+ #t
229
+ (registerUserJisyo userid kvs
230
+ "てすとようえんとり /エントリA/エントリC/\n"))
231
+
232
+ ;; FIX-ME: このテストがまだパスしない。エントリB という単語が消えないといけない。
233
+ ;;(test* "db fetch 11"
234
+ ;; "/エントリA/エントリC"
235
+ ;; (. (hash-table-get db "dummy::てすとようえんとり" #f) force_encoding "UTF-8"))
236
+
237
+
238
+ ;;-------------------------------------------------------------------
239
+ (test* "db fetch 10"
240
+ "tesutoyouenntori tesutoyouentori tesutoyoueqtori tesutoypenntori tesutoypentori tesutoypeqtori"
241
+ (. (hash-table-get db "dummy::(te)" #f) force_encoding "UTF-8"))
242
+
243
+
244
+ ;;-------------------------------------------------------------------
245
+ (test-section "approximate-search core")
246
+
247
+ (test* "search keyword list 1"
248
+ '((1.0 "henkan") (0.981 "henkann") (0.9722 "henka") (0.9611 "hennka") (0.9444 "henkaq"))
249
+ (my-round-map
250
+ (arr->list
251
+ (a-search.search userid kvs "henkan" #f))))
252
+
253
+ (test* "search keyword list 2"
254
+ '((1.0 "hennkan") (0.9875 "hennkann") (0.981 "hennka") (0.9667 "henkann") (0.9619 "hennkaq") (0.9421 "hennkanenzin") (0.9421 "hennkanenjiq") (0.9421 "hennkaneqjin") (0.9421 "hennkaneqjiq") (0.9421 "hennkaneqzin") (0.9421 "hennkaneqziq") (0.9421 "hennkanenjin") (0.9421 "hennkanenziq"))
255
+ (my-round-map
256
+ (arr->list
257
+ (a-search.search userid kvs "hennkan" #f))))
258
+
259
+ (test* "search keyword list 3"
260
+ '((1.0 "henkann") (0.981 "henkan") (0.9667 "hennkan") (0.9524 "henka") (0.9449 "henkanenzin") (0.9449 "henkanenziq") (0.9449 "henkaneqjin") (0.9449 "henkaneqzin") (0.9449 "henkanenjiq") (0.9449 "henkanenjin") (0.9421 "henkannenzin") (0.9421 "henkannenjiq") (0.9421 "henkannenziq") (0.9421 "henkanneqjin") (0.9421 "henkanneqjiq") (0.9421 "henkanneqzin") (0.9421 "henkanneqziq") (0.9421 "henkannenjin"))
261
+ (my-round-map
262
+ (arr->list
263
+ (a-search.search userid kvs "henkann" #f))))
264
+
265
+ (test* "search keyword list 4"
266
+ '((1.0 "hennkann") (0.9875 "hennkan") (0.9667 "hennka") (0.9537 "hennkanenjiq") (0.9537 "hennkanenjin") (0.9537 "hennkanenzin") (0.9537 "hennkaneqjin") (0.9537 "hennkanenziq") (0.9537 "hennkaneqzin") (0.9507 "hennkannenjiq") (0.9507 "hennkannenzin") (0.9507 "hennkannenjin") (0.9507 "hennkanneqziq") (0.9507 "hennkanneqzin") (0.9507 "hennkannenziq") (0.9507 "hennkanneqjin") (0.9507 "hennkanneqjiq") (0.9476 "hennkaq") (0.9444 "hennkaqenjin") (0.9444 "hennkaqenzin") (0.9408 "hennkanenjinn") (0.9408 "hennkaneqzinn") (0.9408 "hennkanennjin") (0.9408 "hennkaneqjinn") (0.9408 "hennkanennjiq") (0.9408 "hennkanennzin") (0.9408 "hennkanenzinn") (0.9408 "hennkanennziq"))
267
+ (my-round-map
268
+ (arr->list
269
+ (a-search.search userid kvs "hennkann" #f))))
270
+
271
+ (test* "search keyword list 5"
272
+ '((1.0 "heqkaq") (0.9722 "heqka") (0.9444 "heqkan"))
273
+ (my-round-map
274
+ (arr->list
275
+ (a-search.search userid kvs "heqkaq" #f))))
276
+
277
+ (test* "search keyword list 6"
278
+ '((0.9762 "henkaS") (0.9667 "hennkaS"))
279
+ (my-round-map
280
+ (arr->list
281
+ (a-search.search userid kvs "henkanS" #t))))
282
+
283
+ (test* "search keyword list 7"
284
+ '((0.9833 "hennkaS") (0.9417 "henkaS"))
285
+ (my-round-map
286
+ (arr->list
287
+ (a-search.search userid kvs "hennkanS" #t))))
288
+
289
+ (test* "approximate search 1"
290
+ '((1.0 "henka" "Cへんか") (0.9722 "henkan" "Cへんかん") (0.9722 "henkaq" "Cへんかん") (0.9611 "hennka" "Cへんか") (0.9524 "henkann" "Cへんかん"))
291
+ (my-round-map
292
+ (approximate-search userid kvs "henka" #f 0)))
293
+
294
+ (test* "approximate search 2"
295
+ '((1.1 "hennka" "Cへんか") (1.079 "hennkaq" "Cへんかん") (1.079 "hennkan" "Cへんかん") (1.0633 "hennkann" "Cへんかん") (0.9611 "henkan" "Cへんかん") (0.9611 "henka" "Cへんか"))
296
+ (my-round-map
297
+ (approximate-search userid kvs "hennka" #f 0)))
298
+
299
+ (test* "approximate search 3"
300
+ '((0.9722 "henka" "Cへんか") (0.9444 "henkan" "Cへんかん") (0.9444 "henkaq" "Cへんかん"))
301
+ (my-round-map
302
+ (approximate-search userid kvs "henkaS" #f 0)))
303
+
304
+ (test* "approximate search 4"
305
+ '((1.079 "hennka" "Cへんか") (1.0581 "hennkan" "Cへんかん") (1.0581 "hennkaq" "Cへんかん") (1.0424 "hennkann" "Cへんかん"))
306
+ (my-round-map
307
+ (approximate-search userid kvs "hennkaS" #f 0)))
308
+
309
+ (test* "approximate search 5"
310
+ '((1.0 "kani" "Cかに") (1.0 "kani" "Cかんい") (0.9533 "kanni" "Cかんい"))
311
+ (my-round-map
312
+ (approximate-search userid kvs "kani" #f 0)))
313
+
314
+ (test* "approximate search 6"
315
+ '((1.1 "hennka" "Cへんか"))
316
+ (my-round-map
317
+ (approximate-search userid kvs "hennka" #f 1)))
318
+
319
+ (test* "approximate search 7"
320
+ '((1.1 "hennka" "Cへんか") (1.079 "hennkaq" "Cへんかん"))
321
+ (my-round-map
322
+ (approximate-search userid kvs "hennka" #f 2)))
323
+
324
+ (test* "approximate search 8"
325
+ '((1.0 "saki" "Cさき"))
326
+ (my-round-map
327
+ (approximate-search userid kvs "saki" #f 0)))
328
+
329
+ (test* "approximate search 9"
330
+ '((1.0 "inyou" "Cいんよう") (0.9556 "innyou" "Cいんにょう") (0.9556 "innyou" "Cいんよう"))
331
+ (my-round-map
332
+ (approximate-search userid kvs "inyou" #f 0)))
333
+
334
+ (test* "approximate search 10"
335
+ '((1.1 "innyou" "Cいんよう") (1.0 "innyou" "Cいんにょう") (0.9667 "innnyou" "Cいんにょう") (0.9556 "inyou" "Cいんよう"))
336
+ (my-round-map
337
+ (approximate-search userid kvs "innyou" #f 0)))
338
+
339
+
340
+ ;;-------------------------------------------------------------------
341
+ (test-section "henkan (okuri nashi)")
342
+
343
+ (test* "okuri nashi 1"
344
+ '(("変換" #f "へんかん" j) ("返還" #f "へんかん" j) ("変化" #f "へんか" j) ("返歌" #f "へんか" j))
345
+ (henkan-okuri-nashi userid kvs "henkan" 0))
346
+
347
+ (test* "okuri nashi 2"
348
+ '(("変化" #f "へんか" j) ("返歌" #f "へんか" j) ("変換" #f "へんかん" j) ("返還" #f "へんかん" j))
349
+ (henkan-okuri-nashi userid kvs "henka" 0))
350
+
351
+ (test* "okuri nashi 3"
352
+ '(("変換" #f "へんかん" j) ("返還" #f "へんかん" j) ("変換エンジン" #f "へんかんえんじん" j) ("変化" #f "へんか" j) ("返歌" #f "へんか" j))
353
+ (henkan-okuri-nashi userid kvs "henkann" 0))
354
+
355
+ (test* "okuri nashi 4"
356
+ '(("変換" #f "へんかん" j) ("返還" #f "へんかん" j) ("変化" #f "へんか" j) ("返歌" #f "へんか" j) ("変換エンジン" #f "へんかんえんじん" j))
357
+ (henkan-okuri-nashi userid kvs "hennkan" 0))
358
+
359
+ (test* "okuri nashi 5"
360
+ '(("変換" #f "へんかん" j) ("返還" #f "へんかん" j) ("変換エンジン" #f "へんかんえんじん" j) ("変化" #f "へんか" j) ("返歌" #f "へんか" j))
361
+ (henkan-okuri-nashi userid kvs "hennkann" 0))
362
+
363
+ (test* "okuri nashi 6"
364
+ '(("自然言語" #f "しぜんげんご" j) ("自然言語処理" #f "しぜんげんごしょり" j) ("自然言語理解" #f "しぜんげんごりかい" j))
365
+ (henkan-okuri-nashi userid kvs "shizengengo" 0))
366
+
367
+ (test* "okuri nashi 7"
368
+ '(("自然言語処理" #f "しぜんげんごしょり" j) ("自然言語" #f "しぜんげんご" j) ("自然言語理解" #f "しぜんげんごりかい" j))
369
+ (henkan-okuri-nashi userid kvs "shizengengosyo" 0))
370
+
371
+ (test* "okuri nashi 8"
372
+ '(("案" #f ">あん" j))
373
+ (henkan-okuri-nashi userid kvs ">an" 0))
374
+
375
+ (test* "okuri nashi 9"
376
+ '(("案" #f ">あん" j))
377
+ (henkan-okuri-nashi userid kvs ">ann" 0))
378
+
379
+ (test* "okuri nashi 10"
380
+ '(("デベロッパー" #f "developper" j) ("ディベロッパー" #f "developper" j) ("デベロッパ" #f "developper" j))
381
+ (henkan-okuri-nashi userid kvs "developper" 0))
382
+
383
+ (test* "okuri nashi 11"
384
+ '(("蟹" #f "かに" j) ("可児" #f "かに" j) ("蠏" #f "かに" j) ("簡易" #f "かんい" j) ("官位" #f "かんい" j) ("冠位" "-十二階" "かんい" j) ("漢医" "漢方医" "かんい" j) ("敢為" #f "かんい" j) ("官医" #f "かんい" j) ("寛衣" #f "かんい" j) ("換位" #f "かんい" j) ("簡意" #f "かんい" j))
385
+ (henkan-okuri-nashi userid kvs "kani" 0))
386
+
387
+ (test* "okuri nashi 12"
388
+ '(("簡易" #f "かんい" j) ("官位" #f "かんい" j) ("冠位" "-十二階" "かんい" j) ("漢医" "漢方医" "かんい" j) ("敢為" #f "かんい" j) ("官医" #f "かんい" j) ("寛衣" #f "かんい" j) ("換位" #f "かんい" j) ("簡意" #f "かんい" j) ("蟹" #f "かに" j) ("可児" #f "かに" j) ("蠏" #f "かに" j))
389
+ (henkan-okuri-nashi userid kvs "kanni" 0))
390
+
391
+ (test* "okuri nashi 13"
392
+ '(("蟹" #f "かに" j))
393
+ (henkan-okuri-nashi userid kvs "kani" 1))
394
+
395
+ (test* "okuri nashi 14"
396
+ '(("先" #f "さき" j) ("崎" #f "さき" j) ("左記" #f "さき" j) ("前" #f "さき" j) ("早紀" #f "さき" j) ("沙樹" #f "さき" j) ("早岐" #f "さき" j) ("沙貴" #f "さき" j) ("咲" #f "さき" j) ("埼" #f "さき" j) ("尖" #f "さき" j) ("嵜" #f "さき" j) ("碕" #f "さき" j) ("早記" #f "さき" j))
397
+ (henkan-okuri-nashi userid kvs "Saki" 0))
398
+
399
+ (test* "okuri nashi 15"
400
+ '(("確固" #f "かっこ" j) ("括弧" #f "かっこ" j) ("各個" #f "かっこ" j) ("各戸" #f "かっこ" j) ("確乎" #f "かっこ" j) ("羯鼓" "雅楽の打楽器" "かっこ" j) ("格好" #f "かっこ" j) ("『』" #f "かっこ" j) ("【】" #f "かっこ" j) ("[]" #f "かっこ" j) ("〔〕" #f "かっこ" j) ("〈〉" #f "かっこ" j) ("《》" #f "かっこ" j) ("{}" #f "かっこ" j) ("「」" #f "かっこ" j) ("()" #f "かっこ" j) ("‘’" #f "かっこ" j) ("“”" #f "かっこ" j))
401
+ (henkan-okuri-nashi userid kvs "Kakko" 0))
402
+
403
+ (test* "okuri nashi 16"
404
+ '(("確固" #f "かっこ" j) ("括弧" #f "かっこ" j) ("各個" #f "かっこ" j) ("各戸" #f "かっこ" j) ("確乎" #f "かっこ" j) ("羯鼓" "雅楽の打楽器" "かっこ" j) ("格好" #f "かっこ" j) ("『』" #f "かっこ" j) ("【】" #f "かっこ" j) ("[]" #f "かっこ" j) ("〔〕" #f "かっこ" j) ("〈〉" #f "かっこ" j) ("《》" #f "かっこ" j) ("{}" #f "かっこ" j) ("「」" #f "かっこ" j) ("()" #f "かっこ" j) ("‘’" #f "かっこ" j) ("“”" #f "かっこ" j))
405
+ (henkan-okuri-nashi userid kvs "Ka@ko" 0))
406
+
407
+ (test* "okuri nashi 17"
408
+ '(("確固" #f "かっこ" j) ("括弧" #f "かっこ" j) ("各個" #f "かっこ" j) ("各戸" #f "かっこ" j) ("確乎" #f "かっこ" j) ("羯鼓" "雅楽の打楽器" "かっこ" j) ("格好" #f "かっこ" j) ("『』" #f "かっこ" j) ("【】" #f "かっこ" j) ("[]" #f "かっこ" j) ("〔〕" #f "かっこ" j) ("〈〉" #f "かっこ" j) ("《》" #f "かっこ" j) ("{}" #f "かっこ" j) ("「」" #f "かっこ" j) ("()" #f "かっこ" j) ("‘’" #f "かっこ" j) ("“”" #f "かっこ" j))
409
+ (henkan-okuri-nashi userid kvs "Ka;ko" 0))
410
+
411
+ (test* "okuri nashi 18"
412
+ '(("一致" #f "いっち" j) ("イッチ" #f "いっち" j))
413
+ (henkan-okuri-nashi userid kvs "icchi" 0))
414
+
415
+ (test* "okuri nashi 19"
416
+ '(("一致" #f "いっち" j) ("イッチ" #f "いっち" j))
417
+ (henkan-okuri-nashi userid kvs "i@chi" 0))
418
+
419
+ (test* "okuri nashi 20"
420
+ '(("一致" #f "いっち" j) ("イッチ" #f "いっち" j))
421
+ (henkan-okuri-nashi userid kvs "i;chi" 0))
422
+
423
+
424
+ ;;-------------------------------------------------------------------
425
+ (test-section "henkan (okuri ari)")
426
+
427
+ (test* "approximate search 1"
428
+ '((1.0 "henkaS" "Cへんかs") (0.9667 "hennkaS" "Cへんかs"))
429
+ (my-round-map
430
+ (approximate-search userid kvs "henkaS" #t 0)))
431
+
432
+ (test* "approximate search 2"
433
+ '((0.9762 "henkaS" "Cへんかs") (0.9667 "hennkaS" "Cへんかs"))
434
+ (my-round-map
435
+ (approximate-search userid kvs "henkanS" #t 0)))
436
+
437
+ (test* "approximate search 3"
438
+ '((1.0 "okonaU" "Cおこなu"))
439
+ (my-round-map
440
+ (approximate-search userid kvs "okonaU" #t 0)))
441
+
442
+ (test* "approximate search 4"
443
+ '((0.9667 "okonaU" "Cおこなu"))
444
+ (my-round-map
445
+ (approximate-search userid kvs "okonU" #t 0)))
446
+
447
+ (test* "approximate search 5"
448
+ '((1.0 "eR" "Cえr"))
449
+ (my-round-map
450
+ (approximate-search userid kvs "eR" #t 0)))
451
+
452
+ (test* "approximate search 6"
453
+ '((1.0 "henkaS" "Cへんかs"))
454
+ (my-round-map
455
+ (approximate-search userid kvs "henkaS" #t 1)))
456
+
457
+ (test* "approximate search 7"
458
+ '((1.0 "henkaS" "Cへんかs") (0.9667 "hennkaS" "Cへんかs"))
459
+ (my-round-map
460
+ (approximate-search userid kvs "henkaS" #t 2)))
461
+
462
+
463
+ (test* "okuri ari 1"
464
+ '(("私は" #f "わたしh" j))
465
+ (henkan-okuri-ari userid kvs "watashiHa" 0 :normal))
466
+
467
+ (test* "okuri ari 2"
468
+ '(("変化する" #f "へんかs" j))
469
+ (henkan-okuri-ari userid kvs "henkaSuru" 0 :normal))
470
+
471
+ (test* "okuri ari 3"
472
+ '(("変化する" #f "へんかs" j))
473
+ (henkan-okuri-ari userid kvs "HenkaSuru" 0 :normal))
474
+
475
+ (test* "okuri ari 4"
476
+ '(("変化する" #f "へんかs" j))
477
+ (henkan-okuri-ari userid kvs "HenkaSURU" 0 :normal))
478
+
479
+ (test* "okuri ari 5"
480
+ '(("変化する" #f "へんかs" j))
481
+ (henkan-okuri-ari userid kvs "HenkaSuRu" 0 :normal))
482
+
483
+ (test* "okuri ari 6"
484
+ '(("行う" #f "おこなu" j) ("行なう" "※送り位置補正" "おこなu" j))
485
+ (henkan-okuri-ari userid kvs "okonaU" 0 :normal))
486
+
487
+ (test* "okuri ari 7"
488
+ '(("行う" #f "おこなu" j) ("行なう" "※送り位置補正" "おこなu" j))
489
+ (henkan-okuri-ari userid kvs "OkonaU" 0 :normal))
490
+
491
+ (test* "okuri ari 8"
492
+ '(("行う" #f "おこなu" j) ("行なう" "※送り位置補正" "おこなu" j))
493
+ (henkan-okuri-ari userid kvs "okonU" 0 :normal))
494
+
495
+ (test* "okuri ari 9"
496
+ '(("見る" #f "みr" j) ("観る" "(字義:みわたす)" "みr" j) ("視る" "(字義:じっとみる)" "みr" j) ("診る" "(diagnose) 患者を診る" "みr" j) ("看る" "(nurse) 病母を看る" "みr" j) ("觀る" "「観」の旧字" "みr" j))
497
+ (henkan-okuri-ari userid kvs "miRu" 0 :normal))
498
+
499
+ (test* "okuri ari 10"
500
+ '(("見" #f "みr" j) ("観" "(字義:みわたす)" "みr" j) ("視" "(字義:じっとみる)" "みr" j) ("診" "(diagnose) 患者を診る" "みr" j) ("看" "(nurse) 病母を看る" "みr" j) ("觀" "「観」の旧字" "みr" j))
501
+ (henkan-okuri-ari userid kvs "miR" 0 :normal))
502
+
503
+ (test* "okuri ari 11"
504
+ '(("見る" #f "みr" j))
505
+ (henkan-okuri-ari userid kvs "miRu" 1 :normal))
506
+
507
+ (test* "okuri ari 12"
508
+ '(("見る" #f "みr" j) ("観る" "(字義:みわたす)" "みr" j))
509
+ (henkan-okuri-ari userid kvs "miRu" 2 :normal))
510
+
511
+ (test* "okuri ari 13"
512
+ '(("変化すんじゃ" #f "へんかs" j) ("変化すぬんあ" #f "へんかs" j))
513
+ (henkan-okuri-ari userid kvs "henkaSunja" 4 :normal))
514
+
515
+ (test* "okuri ari 14"
516
+ '(("変化すぬんあ" #f "へんかs" j) ("変化すんじゃ" #f "へんかs" j))
517
+ (henkan-okuri-ari userid kvs "henkaSunja" 4 :azik))
518
+
519
+ (test* "okuri ari 15"
520
+ '(("変化すること" #f "へんかs" j))
521
+ (henkan-okuri-ari userid kvs "henkaSrkt" 2 :normal))
522
+
523
+ (test* "okuri ari 16"
524
+ '(("変化すること" #f "へんかs" j))
525
+ (henkan-okuri-ari userid kvs "henkaSrkt" 2 :azik))
526
+
527
+ (test* "okuri ari 17"
528
+ '(("変化するかも" #f "へんかs" j))
529
+ (henkan-okuri-ari userid kvs "henkaSrkm" 2 :normal))
530
+
531
+ (test* "okuri ari 18"
532
+ '(("変化するかも" #f "へんかs" j))
533
+ (henkan-okuri-ari userid kvs "henkaSrkm" 2 :azik))
534
+
535
+ (test* "okuri ari 19"
536
+ '(("勝つ" #f "かt" j) ("買つ" #f "かt" j) ("飼つ" #f "かt" j) ("刈つ" "(crop)草を刈る" "かt" j))
537
+ (henkan-okuri-ari userid kvs "kaTu" 0 :normal))
538
+
539
+ (test* "okuri ari 20"
540
+ '(("勝った" #f "かt" j) ("買った" #f "かt" j) ("飼った" #f "かt" j) ("刈った" "(crop)草を刈る" "かt" j))
541
+ (henkan-okuri-ari userid kvs "kaTta" 0 :normal))
542
+
543
+ (test* "okuri ari 21"
544
+ '(("勝った" #f "か`" j) ("買った" #f "か`" j) ("飼った" #f "か`" j) ("刈った" "(crop)草を刈る" "か`" j))
545
+ (henkan-okuri-ari userid kvs "ka`ta" 0 :normal))
546
+
547
+ (test* "okuri ari 22"
548
+ '(("勝った" #f "か`" j) ("買った" #f "か`" j) ("飼った" #f "か`" j) ("刈った" "(crop)草を刈る" "か`" j))
549
+ (henkan-okuri-ari userid kvs "ka`ta" 0 :azik))
550
+
551
+ ;; 送り仮名が "R" で始っているのに、"t" や "`" もマッチしている理由は、送り仮名の開始子音1文字まで含めたJaro-WInkler distanceで候補で並べており、送り仮名が違うからといって排除しない方針をとっているため。
552
+ ;; それにより送り仮名のミスタイプの許容をしている。
553
+ (test* "okuri ari 23"
554
+ '(("ブログりました" #f "ぶろぐr" j) ("ブログりました" #f "ぶろぐ+" j) ("ブログりました" #f "ぶろぐt" j) ("ブログりました" #f "ぶろぐ`" j))
555
+ (henkan-okuri-ari userid kvs "buroguRimashita" 0 :normal))
556
+
557
+ (test* "okuri ari 24"
558
+ '(("ブログった" #f "ぶろぐt" j) ("ブログった" #f "ぶろぐr" j) ("ブログった" #f "ぶろぐ+" j) ("ブログった" #f "ぶろぐ`" j))
559
+ (henkan-okuri-ari userid kvs "buroguTta" 0 :normal))
560
+
561
+ ;;-------------------------------------------------------------------
562
+ (test-section "henkan hiragana")
563
+
564
+ (test* "hiragana 1"
565
+ '(("あいうえお" #f "aiueo" h) ("アイウエオ" #f "aiueo" k))
566
+ (henkan-hiragana kvs "aiueo" :normal))
567
+
568
+ (test* "hiragana 2"
569
+ '(("の" #f "no" h) ("ノ" #f "no" k))
570
+ (henkan-hiragana kvs "no" :normal))
571
+
572
+ (test* "hiragana 3"
573
+ '(("b" #f "b" j))
574
+ (henkan-hiragana kvs "b" :normal))
575
+
576
+ (test* "hiragana 4"
577
+ '(("if" #f "if" j))
578
+ (henkan-hiragana kvs "if" :normal))
579
+
580
+ (test* "hiragana 5"
581
+ '(("ぁぃぅぇぉゃゅょ" #f "lalilulelolyalyulyo" h) ("ァィゥェォャュョ" #f "lalilulelolyalyulyo" k))
582
+ (henkan-hiragana kvs "lalilulelolyalyulyo" :normal))
583
+
584
+ (test* "hiragana 6"
585
+ '(("することです" #f "srktds" h) ("スルコトデス" #f "srktds" k))
586
+ (henkan-hiragana kvs "srktds" :normal))
587
+
588
+ (test* "hiragana 7"
589
+ '(("することです" #f "srktds" h) ("スルコトデス" #f "srktds" k))
590
+ (henkan-hiragana kvs "srktds" :azik))
591
+
592
+ (test* "hiragana 8"
593
+ '(("んんあんはんわんぱ" #f "nqanhanwanpa" h) ("ンンアンハンワンパ" #f "nqanhanwanpa" k) ("ないあぬうあねいあのうあ" #f "nqanhanwanpa" h) ("ナイアヌウアネイアノウア" #f "nqanhanwanpa" k))
594
+ (henkan-hiragana kvs "nqanhanwanpa" :normal))
595
+
596
+ (test* "hiragana 9"
597
+ '(("ないあぬうあねいあのうあ" #f "nqanhanwanpa" h) ("ナイアヌウアネイアノウア" #f "nqanhanwanpa" k) ("んんあんはんわんぱ" #f "nqanhanwanpa" h) ("ンンアンハンワンパ" #f "nqanhanwanpa" k))
598
+ (henkan-hiragana kvs "nqanhanwanpa" :azik))
599
+
600
+
601
+
602
+ ;;-------------------------------------------------------------------
603
+ (test-section "henkan alphabet")
604
+
605
+ (test* "alphabet 1"
606
+ '(("abczABCZ" #f "abczABCZ" z) ("abczABCZ" #f "abczABCZ" l))
607
+ (henkan-alphabet kvs "abczABCZ"))
608
+ (test* "alphabet 2"
609
+ '(("!abcdefg}" #f "!abcdefg}" z) ("!abcdefg}" #f "!abcdefg}" l))
610
+ (henkan-alphabet kvs "!abcdefg}"))
611
+ (test* "alphabet 3"
612
+ '(("mail@example.com" #f "mail@example.com" z) ("mail@example.com" #f "mail@example.com" l))
613
+ (henkan-alphabet kvs "mail@example.com"))
614
+ (test* "alphabet 4"
615
+ '(("http://www.example.com/?arg1=aaa&arg1=bbb#tag" #f "http://www.example.com/?arg1=aaa&arg1=bbb#tag" z) ("http://www.example.com/?arg1=aaa&arg1=bbb#tag" #f "http://www.example.com/?arg1=aaa&arg1=bbb#tag" l))
616
+ (henkan-alphabet kvs "http://www.example.com/?arg1=aaa&arg1=bbb#tag"))
617
+ (test* "alphabet 5"
618
+ '(("(){}[]" #f "(){}[]" z) ("(){}[]" #f "(){}[]" l))
619
+ (henkan-alphabet kvs "(){}[]"))
620
+
621
+
622
+ ;;-------------------------------------------------------------------
623
+ (test-section "henkan non-kanji")
624
+
625
+ (test* "non-kanji 1"
626
+ '(("{" #f "{" j))
627
+ (henkan-non-kanji userid kvs "{"))
628
+
629
+ (test* "non-kanji 2"
630
+ '(("!" #f "!" j) ("感嘆符" #f "!" j))
631
+ (henkan-non-kanji userid kvs "!"))
632
+
633
+ (test* "non-kanji 3"
634
+ '(("/" #f "/" j) ("÷" #f "/" j))
635
+ (henkan-non-kanji userid kvs "/"))
636
+
637
+ (test* "non-kanji 4"
638
+ '(("≠" #f "!=" j))
639
+ (henkan-non-kanji userid kvs "!="))
640
+
641
+ (test* "non-kanji 5"
642
+ '(("." #f "." j) ("・" #f "." j) ("。" #f "." j) ("…" "..." "." j))
643
+ (henkan-non-kanji userid kvs "."))
644
+
645
+
646
+ ;;-------------------------------------------------------------------
647
+ (test-section "sekka henkan toplevel")
648
+
649
+ (test* "henkan toplevel 1"
650
+ '(("*" #f "*" j 0) ("※" #f "*" j 1) ("×" #f "*" j 2) ("*" #f "*" z 3) ("*" #f "*" l 4))
651
+ (sekka-henkan userid kvs "*" 0 :normal))
652
+
653
+ (test* "henkan toplevel 2"
654
+ '(("しぜんげんごりか" #f "shizengengorika" h 0) ("シゼンゲンゴリカ" #f "shizengengorika" k 1) ("しぜにぇにょりか" #f "shizengengorika" h 2) ("シゼニェニョリカ" #f "shizengengorika" k 3) ("shizengengorika" #f "shizengengorika" z 4) ("shizengengorika" #f "shizengengorika" l 5) ("自然言語理解" #f "しぜんげんごりかい" j 6) ("自然言語" #f "しぜんげんご" j 7) ("自然言語処理" #f "しぜんげんごしょり" j 8))
655
+ (sekka-henkan userid kvs "shizengengorika" 0 :normal))
656
+
657
+ (test* "henkan toplevel 3"
658
+ '(("自然言語理解" #f "しぜんげんごりかい" j 0) ("自然言語" #f "しぜんげんご" j 1) ("自然言語処理" #f "しぜんげんごしょり" j 2) ("しぜんげんごりか" #f "shizengengorika" h 3) ("シゼンゲンゴリカ" #f "shizengengorika" k 4) ("しぜにぇにょりか" #f "shizengengorika" h 5) ("シゼニェニョリカ" #f "shizengengorika" k 6) ("Shizengengorika" #f "Shizengengorika" z 7) ("Shizengengorika" #f "Shizengengorika" l 8))
659
+ (sekka-henkan userid kvs "Shizengengorika" 0 :normal))
660
+
661
+ (test* "henkan toplevel 4"
662
+ '(("変化する" #f "へんかs" j 0) ("へんかする" #f "henkasuru" h 1) ("ヘンカスル" #f "henkasuru" k 2) ("へにんあする" #f "henkasuru" h 3) ("ヘニンアスル" #f "henkasuru" k 4) ("henkaSuru" #f "henkaSuru" z 5) ("henkaSuru" #f "henkaSuru" l 6))
663
+ (sekka-henkan userid kvs "henkaSuru" 0 :normal))
664
+
665
+ (test* "henkan toplevel 5"
666
+ '(("変換" #f "へんかん" j 0) ("返還" #f "へんかん" j 1) ("変化" #f "へんか" j 2) ("返歌" #f "へんか" j 3) ("へんかん" #f "henkan" h 4) ("ヘンカン" #f "henkan" k 5) ("へにんあん" #f "henkan" h 6) ("ヘニンアン" #f "henkan" k 7) ("Henkan" #f "Henkan" z 8) ("Henkan" #f "Henkan" l 9))
667
+ (sekka-henkan userid kvs "Henkan" 0 :normal))
668
+
669
+ (test* "henkan toplevel 6"
670
+ '(("へんかん" #f "henkan" h 0) ("ヘンカン" #f "henkan" k 1) ("へにんあん" #f "henkan" h 2) ("ヘニンアン" #f "henkan" k 3) ("HEnkan" #f "HEnkan" z 4) ("HEnkan" #f "HEnkan" l 5))
671
+ (sekka-henkan userid kvs "HEnkan" 0 :normal))
672
+
673
+ (test* "henkan toplevel 7"
674
+ '(("へんかん" #f "henkan" h 0) ("ヘンカン" #f "henkan" k 1) ("へにんあん" #f "henkan" h 2) ("ヘニンアン" #f "henkan" k 3) ("HENkan" #f "HENkan" z 4) ("HENkan" #f "HENkan" l 5))
675
+ (sekka-henkan userid kvs "HENkan" 0 :normal))
676
+
677
+ (test* "henkan toplevel 8"
678
+ '(("こーひー" #f "ko-hi-" h 0) ("コーヒー" #f "ko-hi-" k 1) ("Ko-hi-" #f "Ko-hi-" z 2) ("Ko-hi-" #f "Ko-hi-" l 3))
679
+ (sekka-henkan userid kvs "Ko-hi-" 0 :normal))
680
+
681
+ (test* "henkan toplevel 9"
682
+ '(("得る" #f "えr" j 0) ("獲る" "NB:「とr」と同形" "えr" j 1) ("選る" "NB:「よr」「すぐr」と同形" "えr" j 2) ("える" #f "eru" h 3) ("エル" #f "eru" k 4) ("eRu" #f "eRu" z 5) ("eRu" #f "eRu" l 6))
683
+ (sekka-henkan userid kvs "eRu" 0 :normal))
684
+
685
+ (test* "henkan toplevel 10"
686
+ '(("得る" #f "えr" j 0) ("獲る" "NB:「とr」と同形" "えr" j 1) ("選る" "NB:「よr」「すぐr」と同形" "えr" j 2) ("える" #f "eru" h 3) ("エル" #f "eru" k 4) ("ERu" #f "ERu" z 5) ("ERu" #f "ERu" l 6))
687
+ (sekka-henkan userid kvs "ERu" 0 :normal))
688
+
689
+ (test* "henkan toplevel 11"
690
+ '(("を" #f "wo" h 0) ("ヲ" #f "wo" k 1) ("wo" #f "wo" z 2) ("wo" #f "wo" l 3) ("小" #f "を" j 4) ("緒" #f "を" j 5) ("雄" #f "を" j 6) ("男" #f "を" j 7) ("牡" #f "を" j 8) ("尾" #f "を" j 9) ("悪" #f "を" j 10) ("汚" #f "を" j 11) ("惡" "「悪」の旧字(人名用漢字)" "を" j 12))
691
+ (sekka-henkan userid kvs "wo" 0 :normal))
692
+
693
+ (test* "henkan toplevel 12"
694
+ '(("S" #f "S" z 0) ("S" #f "S" l 1))
695
+ (sekka-henkan userid kvs "S" 0 :normal))
696
+
697
+ (test* "henkan toplevel 13"
698
+ '(("H" #f "H" z 0) ("H" #f "H" l 1))
699
+ (sekka-henkan userid kvs "H" 0 :normal))
700
+
701
+ (test* "henkan toplevel 14"
702
+ '(("gitHuB" #f "gitHuB" z 0) ("gitHuB" #f "gitHuB" l 1))
703
+ (sekka-henkan userid kvs "gitHuB" 0 :normal))
704
+
705
+ (test* "henkan toplevel 15"
706
+ '(("ChangeLog" #f "ChangeLog" z 0) ("ChangeLog" #f "ChangeLog" l 1))
707
+ (sekka-henkan userid kvs "ChangeLog" 0 :normal))
708
+
709
+ (test* "henkan toplevel 16"
710
+ '(("訳" #f "わけ" j 0) ("和気" "地名" "わけ" j 1) ("理由" "当て字" "わけ" j 2) ("分け" #f "わけ" j 3) ("分" #f "わけ" j 4) ("譯" "「訳」の旧字" "わけ" j 5) ("戯奴" #f "わけ" j 6) ("わけ" #f "wake" h 7) ("ワケ" #f "wake" k 8) ("Wake" #f "Wake" z 9) ("Wake" #f "Wake" l 10))
711
+ (sekka-henkan userid kvs "Wake" 0 :normal))
712
+
713
+ (test* "henkan toplevel 17"
714
+ '(("合う" "(一致) 話が合う" "あu" j 0) ("会う" "人と会う" "あu" j 1) ("遭う" "(偶然、特によくないことにあう) 事故に遭う" "あu" j 2) ("逢う" "(人と|運命的にあう) 巡り逢う" "あu" j 3) ("遇う" "≒遭う" "あu" j 4) ("會う" "「会」の旧字" "あu" j 5) ("あう" #f "au" h 6) ("アウ" #f "au" k 7) ("AU" #f "AU" z 8) ("AU" #f "AU" l 9))
715
+ (sekka-henkan userid kvs "AU" 0 :normal))
716
+
717
+ (test* "henkan toplevel 18"
718
+ '(("*" #f "*" j 0) ("※" #f "*" j 1) ("×" #f "*" j 2) ("*" #f "*" z 3) ("*" #f "*" l 4))
719
+ (sekka-henkan userid kvs "*" 1 :normal))
720
+
721
+ (test* "henkan toplevel 19"
722
+ '(("しぜんげんごりか" #f "shizengengorika" h 0) ("シゼンゲンゴリカ" #f "shizengengorika" k 1) ("しぜにぇにょりか" #f "shizengengorika" h 2) ("シゼニェニョリカ" #f "shizengengorika" k 3) ("shizengengorika" #f "shizengengorika" z 4) ("shizengengorika" #f "shizengengorika" l 5) ("自然言語理解" #f "しぜんげんごりかい" j 6))
723
+ (sekka-henkan userid kvs "shizengengorika" 1 :normal))
724
+
725
+ (test* "henkan toplevel 20"
726
+ '(("自然言語理解" #f "しぜんげんごりかい" j 0) ("しぜんげんごりか" #f "shizengengorika" h 1) ("シゼンゲンゴリカ" #f "shizengengorika" k 2) ("しぜにぇにょりか" #f "shizengengorika" h 3) ("シゼニェニョリカ" #f "shizengengorika" k 4) ("Shizengengorika" #f "Shizengengorika" z 5) ("Shizengengorika" #f "Shizengengorika" l 6))
727
+ (sekka-henkan userid kvs "Shizengengorika" 1 :normal))
728
+
729
+ (test* "henkan toplevel 21"
730
+ '(("合う" "(一致) 話が合う" "あu" j 0) ("あう" #f "au" h 1) ("アウ" #f "au" k 2) ("AU" #f "AU" z 3) ("AU" #f "AU" l 4))
731
+ (sekka-henkan userid kvs "AU" 1 :normal))
732
+
733
+ (test* "henkan toplevel 22"
734
+ '(("いっち" #f "i@chi" h 0) ("イッチ" #f "i@chi" k 1) ("i@chi" #f "i@chi" z 2) ("i@chi" #f "i@chi" l 3) ("一致" #f "いっち" j 4))
735
+ (sekka-henkan userid kvs "i@chi" 1 :normal))
736
+
737
+ (test* "henkan toplevel 23"
738
+ '(("一致" #f "いっち" j 0) ("いっち" #f "i@chi" h 1) ("イッチ" #f "i@chi" k 2) ("I@chi" #f "I@chi" z 3) ("I@chi" #f "I@chi" l 4))
739
+ (sekka-henkan userid kvs "I@chi" 1 :normal))
740
+
741
+ (test* "henkan toplevel 24"
742
+ '(("かった" #f "ka@ta" h 0) ("カッタ" #f "ka@ta" k 1) ("ka@ta" #f "ka@ta" z 2) ("ka@ta" #f "ka@ta" l 3))
743
+ (sekka-henkan userid kvs "ka@ta" 1 :normal))
744
+
745
+ (test* "henkan toplevel 25"
746
+ '(("勝った" #f "か`" j 0) ("かった" #f "ka@ta" h 1) ("カッタ" #f "ka@ta" k 2) ("ka`ta" #f "ka`ta" z 3) ("ka`ta" #f "ka`ta" l 4))
747
+ (sekka-henkan userid kvs "ka`ta" 1 :normal))
748
+
749
+ (test* "henkan toplevel 26"
750
+ '(("確固" #f "かっこ" j 0) ("かっこ" #f "kakko" h 1) ("カッコ" #f "kakko" k 2) ("Kakko" #f "Kakko" z 3) ("Kakko" #f "Kakko" l 4))
751
+ (sekka-henkan userid kvs "Kakko" 1 :normal))
752
+
753
+ (test* "henkan toplevel 27"
754
+ '(("確固" #f "かっこ" j 0) ("かっこ" #f "ka@ko" h 1) ("カッコ" #f "ka@ko" k 2) ("Ka@ko" #f "Ka@ko" z 3) ("Ka@ko" #f "Ka@ko" l 4))
755
+ (sekka-henkan userid kvs "Ka@ko" 1 :normal))
756
+
757
+ (test* "henkan toplevel 28"
758
+ '(("かっこ" #f "ka;ko" h 0) ("カッコ" #f "ka;ko" k 1) ("ka;ko" #f "ka;ko" z 2) ("ka;ko" #f "ka;ko" l 3) ("確固" #f "かっこ" j 4))
759
+ (sekka-henkan userid kvs "ka;ko" 1 :normal))
760
+
761
+ (test* "henkan toplevel 29"
762
+ '(("確固" #f "かっこ" j 0) ("かっこ" #f "ka;ko" h 1) ("カッコ" #f "ka;ko" k 2) ("Ka;ko" #f "Ka;ko" z 3) ("Ka;ko" #f "Ka;ko" l 4))
763
+ (sekka-henkan userid kvs "Ka;ko" 1 :normal))
764
+
765
+
766
+
767
+ (test* "henkan toplevel(for Elisp) 1"
768
+ '(("*" nil "*" j 0) ("※" nil "*" j 1) ("×" nil "*" j 2) ("*" nil "*" z 3) ("*" nil "*" l 4))
769
+ (sekkaHenkan userid kvs #f "*" 0 "normal"))
770
+
771
+ (test* "henkan toplevel(for Elisp) 2"
772
+ '(("しぜんげんごりか" nil "shizengengorika" h 0) ("シゼンゲンゴリカ" nil "shizengengorika" k 1) ("しぜにぇにょりか" nil "shizengengorika" h 2) ("シゼニェニョリカ" nil "shizengengorika" k 3) ("shizengengorika" nil "shizengengorika" z 4) ("shizengengorika" nil "shizengengorika" l 5) ("自然言語理解" nil "しぜんげんごりかい" j 6) ("自然言語" nil "しぜんげんご" j 7) ("自然言語処理" nil "しぜんげんごしょり" j 8))
773
+ (sekkaHenkan userid kvs #f "shizengengorika" 0 "normal"))
774
+
775
+ (test* "henkan toplevel(for Elisp) 3"
776
+ '(("自然言語理解" nil "しぜんげんごりかい" j 0) ("自然言語" nil "しぜんげんご" j 1) ("自然言語処理" nil "しぜんげんごしょり" j 2) ("しぜんげんごりか" nil "shizengengorika" h 3) ("シゼンゲンゴリカ" nil "shizengengorika" k 4) ("しぜにぇにょりか" nil "shizengengorika" h 5) ("シゼニェニョリカ" nil "shizengengorika" k 6) ("Shizengengorika" nil "Shizengengorika" z 7) ("Shizengengorika" nil "Shizengengorika" l 8))
777
+ (sekkaHenkan userid kvs #f "Shizengengorika" 0 "normal"))
778
+
779
+ (test* "henkan toplevel(for Elisp) 4"
780
+ '(("変化する" nil "へんかs" j 0) ("へんかする" nil "henkasuru" h 1) ("ヘンカスル" nil "henkasuru" k 2) ("へにんあする" nil "henkasuru" h 3) ("ヘニンアスル" nil "henkasuru" k 4) ("henkaSuru" nil "henkaSuru" z 5) ("henkaSuru" nil "henkaSuru" l 6))
781
+ (sekkaHenkan userid kvs #f "henkaSuru" 0 "normal"))
782
+
783
+ (test* "henkan toplevel(for Elisp) 5"
784
+ '(("変換" nil "へんかん" j 0) ("返還" nil "へんかん" j 1) ("変化" nil "へんか" j 2) ("返歌" nil "へんか" j 3) ("へんかん" nil "henkan" h 4) ("ヘンカン" nil "henkan" k 5) ("へにんあん" nil "henkan" h 6) ("ヘニンアン" nil "henkan" k 7) ("Henkan" nil "Henkan" z 8) ("Henkan" nil "Henkan" l 9))
785
+ (sekkaHenkan userid kvs #f "Henkan" 0 "normal"))
786
+
787
+ (test* "henkan toplevel(for Elisp) 6"
788
+ '(("マジパネェ" nil "まじぱねぇ" j 0) ("まじパネェ" nil "まじぱねぇ" j 1) ("マジ半端ネェ" nil "まじぱねぇ" j 2) ("まじ半端ネェ" nil "まじぱねぇ" j 3) ("まじぱねえ" nil "majipanee" h 4) ("マジパネエ" nil "majipanee" k 5) ("Majipanee" nil "Majipanee" z 6) ("Majipanee" nil "Majipanee" l 7))
789
+ (sekkaHenkan userid kvs #f "Majipanee" 0 "normal"))
790
+
791
+ (test* "henkan toplevel(for Elisp) 7"
792
+ '(("変換エンジン" nil "へんかんえんじん" j 0) ("変換" nil "へんかん" j 1) ("返還" nil "へんかん" j 2) ("へんかねんじ" nil "henkanenji" h 3) ("ヘンカネンジ" nil "henkanenji" k 4) ("へにんあねぬんい" nil "henkanenji" h 5) ("ヘニンアネヌンイ" nil "henkanenji" k 6) ("Henkanenji" nil "Henkanenji" z 7) ("Henkanenji" nil "Henkanenji" l 8))
793
+ (sekkaHenkan userid kvs #f "Henkanenji" 0 "normal"))
794
+
795
+ (test* "henkan toplevel(for Elisp) 8"
796
+ '(("ブログった" nil "ぶろぐt" j 0) ("ブログった" nil "ぶろぐr" j 1) ("ブログった" nil "ぶろぐ+" j 2) ("ブログった" nil "ぶろぐ`" j 3) ("ぶろぐった" nil "burogutta" h 4) ("ブログッタ" nil "burogutta" k 5) ("buroguTta" nil "buroguTta" z 6) ("buroguTta" nil "buroguTta" l 7))
797
+ (sekkaHenkan userid kvs #f "buroguTta" 0 "normal"))
798
+
799
+ (test* "henkan toplevel(for Elisp) 9"
800
+ '(("ブログりました" nil "ぶろぐr" j 0) ("ブログりました" nil "ぶろぐ+" j 1) ("ブログりました" nil "ぶろぐt" j 2) ("ブログりました" nil "ぶろぐ`" j 3) ("ぶろぐりました" nil "burogurimashita" h 4) ("ブログリマシタ" nil "burogurimashita" k 5) ("buroguRimashita" nil "buroguRimashita" z 6) ("buroguRimashita" nil "buroguRimashita" l 7))
801
+ (sekkaHenkan userid kvs #f "buroguRimashita" 0 "normal"))
802
+
803
+ (test* "henkan toplevel(for Elisp) 10"
804
+ '(("はてブ" nil "はてぶ" j 0) ("はてなブックマーク" nil "はてぶ" j 1) ("はてぶ" nil "hatebu" h 2) ("ハテブ" nil "hatebu" k 3) ("Hatebu" nil "Hatebu" z 4) ("Hatebu" nil "Hatebu" l 5))
805
+ (sekkaHenkan userid kvs #f "Hatebu" 0 "normal"))
806
+
807
+ (test* "henkan toplevel(for Elisp) 11"
808
+ '(("かに" nil "kani" h 0) ("カニ" nil "kani" k 1) ("kani" nil "kani" z 2) ("kani" nil "kani" l 3) ("蟹" nil "かに" j 4) ("可児" nil "かに" j 5) ("蠏" nil "かに" j 6) ("簡易" nil "かんい" j 7) ("官位" nil "かんい" j 8) ("冠位" "-十二階" "かんい" j 9) ("漢医" "漢方医" "かんい" j 10) ("敢為" nil "かんい" j 11) ("官医" nil "かんい" j 12) ("寛衣" nil "かんい" j 13) ("換位" nil "かんい" j 14) ("簡意" nil "かんい" j 15))
809
+ (sekkaHenkan userid kvs #f "kani" 0 "normal"))
810
+
811
+ (test* "henkan toplevel(for Elisp) 12"
812
+ '(("かんい" nil "kanni" h 0) ("カンイ" nil "kanni" k 1) ("kanni" nil "kanni" z 2) ("kanni" nil "kanni" l 3) ("簡易" nil "かんい" j 4) ("官位" nil "かんい" j 5) ("冠位" "-十二階" "かんい" j 6) ("漢医" "漢方医" "かんい" j 7) ("敢為" nil "かんい" j 8) ("官医" nil "かんい" j 9) ("寛衣" nil "かんい" j 10) ("換位" nil "かんい" j 11) ("簡意" nil "かんい" j 12) ("蟹" nil "かに" j 13) ("可児" nil "かに" j 14) ("蠏" nil "かに" j 15))
813
+ (sekkaHenkan userid kvs #f "kanni" 0 "normal"))
814
+
815
+ (test* "henkan toplevel(for Elisp) 13"
816
+ '(("確固" nil "かっこ" j 0) ("括弧" nil "かっこ" j 1) ("かっこ" nil "ka@ko" h 2) ("カッコ" nil "ka@ko" k 3) ("Ka@ko" nil "Ka@ko" z 4) ("Ka@ko" nil "Ka@ko" l 5))
817
+ (sekkaHenkan userid kvs #f "Ka@ko" 2 "normal"))
818
+
819
+ (test* "henkan toplevel(for Elisp) 14"
820
+ '(("かっこ" nil "ka@ko" h 0) ("カッコ" nil "ka@ko" k 1) ("ka@ko" nil "ka@ko" z 2) ("ka@ko" nil "ka@ko" l 3) ("確固" nil "かっこ" j 4) ("括弧" nil "かっこ" j 5))
821
+ (sekkaHenkan userid kvs #f "ka@ko" 2 "normal"))
822
+
823
+ (test* "henkan toplevel(for Elisp) 15"
824
+ '(("確固" nil "かっこ" j 0) ("括弧" nil "かっこ" j 1) ("かっこ" nil "ka;ko" h 2) ("カッコ" nil "ka;ko" k 3) ("Ka;ko" nil "Ka;ko" z 4) ("Ka;ko" nil "Ka;ko" l 5))
825
+ (sekkaHenkan userid kvs #f "Ka;ko" 2 "normal"))
826
+
827
+ (test* "henkan toplevel(for Elisp) 16"
828
+ '(("かっこ" nil "ka;ko" h 0) ("カッコ" nil "ka;ko" k 1) ("ka;ko" nil "ka;ko" z 2) ("ka;ko" nil "ka;ko" l 3) ("確固" nil "かっこ" j 4) ("括弧" nil "かっこ" j 5))
829
+ (sekkaHenkan userid kvs #f "ka;ko" 2 "normal"))
830
+
831
+
832
+ ;;-------------------------------------------------------------------
833
+ (test-section "henkan kakutei")
834
+ (test* "henkan kakutei(for Elisp) 1"
835
+ '(("返還" nil "へんかん" j 0) ("変換" nil "へんかん" j 1) ("変化" nil "へんか" j 2) ("返歌" nil "へんか" j 3) ("へんかん" nil "henkan" h 4) ("ヘンカン" nil "henkan" k 5) ("へにんあん" nil "henkan" h 6) ("ヘニンアン" nil "henkan" k 7) ("Henkan" nil "Henkan" z 8) ("Henkan" nil "Henkan" l 9))
836
+ (begin
837
+ (sekkaKakutei userid kvs #f "へんかん" "返還")
838
+ (sekkaHenkan userid kvs #f "Henkan" 0 "normal")))
839
+
840
+ (test* "DB check after henkan kakutei 1"
841
+ "/返還/変換"
842
+ (. (hash-table-get db (+ userid "::へんかん") #f) force_encoding "UTF-8"))
843
+
844
+ (test* "henkan kakutei(for Elisp) 2"
845
+ '(("変換" nil "へんかん" j 0) ("返還" nil "へんかん" j 1) ("変化" nil "へんか" j 2) ("返歌" nil "へんか" j 3) ("へんかん" nil "henkan" h 4) ("ヘンカン" nil "henkan" k 5) ("へにんあん" nil "henkan" h 6) ("ヘニンアン" nil "henkan" k 7) ("Henkan" nil "Henkan" z 8) ("Henkan" nil "Henkan" l 9))
846
+ (begin
847
+ (sekkaKakutei userid kvs #f "へんかん" "変換")
848
+ (sekkaHenkan userid kvs #f "Henkan" 0 "normal")))
849
+
850
+ (test* "DB check after henkan kakutei 2"
851
+ "/変換/返還"
852
+ (. (hash-table-get db (+ userid "::へんかん") #f) force_encoding "UTF-8"))
853
+
854
+ (test* "henkan kakutei(for Elisp) 3"
855
+ '(("デベロッパ" nil "developer" j 0) ("デベロッパー" nil "developer" j 1) ("ディベロッパー" nil "developer" j 2) ("developer" nil "developer" z 3) ("developer" nil "developer" l 4))
856
+ (begin
857
+ (sekkaKakutei userid kvs #f "developer" "デベロッパ")
858
+ (sekkaHenkan userid kvs #f "developer" 0 "normal")))
859
+
860
+ (test* "henkan kakutei(for Elisp) 4"
861
+ '(("。" nil "." j 0) ("." nil "." j 1) ("・" nil "." j 2) ("…" "..." "." j 3) ("." nil "." z 4) ("." nil "." l 5))
862
+ (begin
863
+ (sekkaKakutei userid kvs #f "." "。")
864
+ (sekkaHenkan userid kvs #f "." 0 "normal")))
865
+
866
+ (test* "henkan kakutei(for Elisp) 5"
867
+ nil
868
+ (sekkaKakutei userid kvs #f "." "。"))
869
+
870
+ (test* "henkan kakutei(for Elisp) 6"
871
+ nil
872
+ (sekkaKakutei userid kvs #f "developper" "デベロッパ"))
873
+
874
+ (test* "henkan kakutei(for Elisp) 7"
875
+ nil
876
+ (sekkaKakutei userid kvs #f "wo" "を"))
877
+
878
+ (test* "henkan kakutei(for Elisp) 8"
879
+ '(("はてなブックマーク" nil "はてぶ" j 0) ("はてブ" nil "はてぶ" j 1) ("はてぶ" nil "hatebu" h 2) ("ハテブ" nil "hatebu" k 3) ("Hatebu" nil "Hatebu" z 4) ("Hatebu" nil "Hatebu" l 5))
880
+ (begin
881
+ (sekkaKakutei userid kvs #f "はてぶ" "はてなブックマーク")
882
+ (sekkaHenkan userid kvs #f "Hatebu" 0 "normal")))
883
+
884
+
885
+ (test* "henkan kakutei(for Elisp) 9"
886
+ '(("." nil "." j 0) ("・" nil "." j 1) ("。" nil "." j 2) ("…" "..." "." j 3) ("." nil "." z 4) ("." nil "." l 5))
887
+ (begin
888
+ (sekkaHenkan userid2 kvs #f "." 0 "normal"))) ;; userid2
889
+
890
+ (test* "henkan kakutei(for Elisp) 10"
891
+ '(("。" nil "." j 0) ("." nil "." j 1) ("・" nil "." j 2) ("…" "..." "." j 3) ("." nil "." z 4) ("." nil "." l 5))
892
+ (begin
893
+ (sekkaKakutei userid2 kvs #f "." "。") ;; userid2
894
+ (sekkaHenkan userid2 kvs #f "." 0 "normal"))) ;; userid2
895
+
896
+ (test* "henkan kakutei(for Elisp) 11"
897
+ '(("。" nil "." j 0) ("." nil "." j 1) ("・" nil "." j 2) ("…" "..." "." j 3) ("." nil "." z 4) ("." nil "." l 5))
898
+ (begin
899
+ (sekkaHenkan userid2 kvs #f "." 0 "normal"))) ;; userid2
900
+
901
+ (test* "henkan kakutei(for Elisp) 12"
902
+ nil
903
+ (sekkaKakutei userid2 kvs #f "wo" "を")) ;; userid2
904
+
905
+
906
+ (test* "henkan kakutei(for Elisp) 13"
907
+ '(("観" "(字義:みわたす)" "みr" j 0) ("見" nil "みr" j 1) ("視" "(字義:じっとみる)" "みr" j 2) ("診" "(diagnose) 患者を診る" "みr" j 3) ("看" "(nurse) 病母を看る" "みr" j 4) ("觀" "「観」の旧字" "みr" j 5) ("miR" nil "miR" z 6) ("miR" nil "miR" l 7))
908
+ (begin
909
+ (sekkaKakutei userid kvs #f "みr" "観")
910
+ (sekkaHenkan userid kvs #f "miR" 0 "normal")))
911
+
912
+ (test* "henkan kakutei(for Elisp) 14"
913
+ '(("視" "(字義:じっとみる)" "みr" j 0) ("観" "(字義:みわたす)" "みr" j 1) ("見" nil "みr" j 2) ("診" "(diagnose) 患者を診る" "みr" j 3) ("看" "(nurse) 病母を看る" "みr" j 4) ("觀" "「観」の旧字" "みr" j 5) ("miR" nil "miR" z 6) ("miR" nil "miR" l 7))
914
+ (begin
915
+ (sekkaKakutei userid kvs #f "みr" "視")
916
+ (sekkaHenkan userid kvs #f "miR" 0 "normal")))
917
+
918
+ (test* "henkan kakutei(for Elisp) 15"
919
+ '(("観る" "(字義:みわたす)" "みr" j 0) ("見る" nil "みr" j 1) ("視る" "(字義:じっとみる)" "みr" j 2) ("診る" "(diagnose) 患者を診る" "みr" j 3) ("看る" "(nurse) 病母を看る" "みr" j 4) ("觀る" "「観」の旧字" "みr" j 5) ("みる" nil "miru" h 6) ("ミル" nil "miru" k 7) ("miRu" nil "miRu" z 8) ("miRu" nil "miRu" l 9))
920
+ (begin
921
+ (sekkaKakutei userid2 kvs #f "みr" "観る") ;; userid2
922
+ (sekkaHenkan userid2 kvs #f "miRu" 0 "normal"))) ;; userid2
923
+
924
+ (test* "henkan kakutei(for Elisp) 16"
925
+ '(("かに" nil "kani" h 0) ("カニ" nil "kani" k 1) ("kani" nil "kani" z 2) ("kani" nil "kani" l 3) ("可児" nil "かに" j 4) ("蟹" nil "かに" j 5) ("蠏" nil "かに" j 6) ("簡易" nil "かんい" j 7) ("官位" nil "かんい" j 8) ("冠位" "-十二階" "かんい" j 9) ("漢医" "漢方医" "かんい" j 10) ("敢為" nil "かんい" j 11) ("官医" nil "かんい" j 12) ("寛衣" nil "かんい" j 13) ("換位" nil "かんい" j 14) ("簡意" nil "かんい" j 15))
926
+ (begin
927
+ (sekkaKakutei userid kvs #f "かに" "可児")
928
+ (sekkaHenkan userid kvs #f "kani" 0 "normal")))
929
+ (test* "henkan kakutei(for Elisp) 17"
930
+ '(("かんい" nil "kanni" h 0) ("カンイ" nil "kanni" k 1) ("kanni" nil "kanni" z 2) ("kanni" nil "kanni" l 3) ("官位" nil "かんい" j 4) ("簡易" nil "かんい" j 5) ("冠位" "-十二階" "かんい" j 6) ("漢医" "漢方医" "かんい" j 7) ("敢為" nil "かんい" j 8) ("官医" nil "かんい" j 9) ("寛衣" nil "かんい" j 10) ("換位" nil "かんい" j 11) ("簡意" nil "かんい" j 12) ("可児" nil "かに" j 13) ("蟹" nil "かに" j 14) ("蠏" nil "かに" j 15))
931
+ (begin
932
+ (sekkaKakutei userid kvs #f "かんい" "官位")
933
+ (sekkaHenkan userid kvs #f "kanni" 0 "normal")))
934
+
935
+ ;;===================================================================
936
+
937
+ ;; ---後処理---
938
+ (db.close)
939
+ ;; 最終的な辞書の状態を目視するためのダンプ
940
+ (dump-sekka-jisyo-f STDOUT target)
941
+
942
+ (test-end)