sekka 1.1.1.pre → 1.1.3.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +39 -19
- data/VERSION.yml +1 -1
- data/bin/sekka-jisyo +11 -3
- data/bin/sekka-server +51 -30
- data/emacs/sekka.el +1 -1
- data/lib/sekka/approximatesearch.rb +6 -6
- data/lib/sekka/convert-jisyo.nnd +69 -76
- data/lib/sekka/henkan.nnd +11 -11
- data/lib/sekka/jisyo-db.nnd +10 -19
- data/lib/sekka/roman-lib.nnd +83 -6
- data/lib/sekka/sekkaversion.rb +2 -2
- data/lib/sekka/util.nnd +9 -1
- data/lib/sekkaserver.rb +3 -3
- data/test/approximate-bench.nnd +1 -1
- data/test/azik-verification.nnd +1 -1
- data/test/henkan-main.nnd +30 -30
- data/test/memcache.nnd +10 -10
- data/test/redis.nnd +6 -6
- data/test/roman-lib.nnd +10 -10
- data/test/sekka-dump-out-1.txt +1338 -1338
- metadata +2 -2
data/test/henkan-main.nnd
CHANGED
@@ -198,77 +198,77 @@
|
|
198
198
|
(test-section "simple db fetch")
|
199
199
|
(test* "db fetch 1"
|
200
200
|
"Cへんかん"
|
201
|
-
(kvs.get "
|
201
|
+
(kvs.get "M:henkan"))
|
202
202
|
|
203
203
|
(test* "db fetch 2"
|
204
204
|
"Cかに/かんい"
|
205
|
-
(kvs.get "
|
205
|
+
(kvs.get "M:kani"))
|
206
206
|
|
207
207
|
(test* "db fetch 3"
|
208
208
|
"Cかんい"
|
209
|
-
(kvs.get "
|
209
|
+
(kvs.get "M:kanni"))
|
210
210
|
|
211
211
|
(test* "db fetch 4"
|
212
212
|
#f
|
213
|
-
(kvs.get "
|
213
|
+
(kvs.get "M:aaaa"))
|
214
214
|
|
215
215
|
(test* "db fetch 5"
|
216
216
|
"Cへんかんえんじん"
|
217
|
-
(kvs.get "dummy
|
217
|
+
(kvs.get "dummy:henkanenjin"))
|
218
218
|
|
219
219
|
(test* "db fetch 6"
|
220
220
|
"i$ n"
|
221
|
-
(kvs.get "Ik
|
221
|
+
(kvs.get "Ik:M:kan"))
|
222
222
|
|
223
223
|
(test* "db fetch 7"
|
224
224
|
"n$ q$"
|
225
|
-
(kvs.get "Ik
|
225
|
+
(kvs.get "Ik:M:henka"))
|
226
226
|
|
227
227
|
(test* "db fetch 8"
|
228
228
|
"c t"
|
229
|
-
(kvs.get "Ik
|
229
|
+
(kvs.get "Ik:M:#neq#gatsu#ni"))
|
230
230
|
|
231
231
|
(test* "db fetch 9"
|
232
232
|
"f u"
|
233
|
-
(kvs.get "Ik
|
233
|
+
(kvs.get "Ik:dummy:y"))
|
234
234
|
|
235
235
|
(test* "db fetch 10"
|
236
236
|
"' - : ^"
|
237
|
-
(kvs.get "Ik
|
237
|
+
(kvs.get "Ik:dummy:yu"))
|
238
238
|
|
239
239
|
(test* "db fetch 11"
|
240
240
|
"/ユーザー辞書"
|
241
|
-
(kvs.get "dummy
|
241
|
+
(kvs.get "dummy:ゆーざーじしょ"))
|
242
242
|
|
243
243
|
(test* "db fetch 12"
|
244
244
|
"する"
|
245
|
-
(kvs.get "dummy
|
245
|
+
(kvs.get "dummy:=sr"))
|
246
246
|
|
247
247
|
(test* "db fetch 13"
|
248
248
|
'("r" "u$")
|
249
|
-
(list (kvs.get "Ih
|
250
|
-
(kvs.get "Ih
|
249
|
+
(list (kvs.get "Ih:dummy:=su")
|
250
|
+
(kvs.get "Ih:dummy:=sur")))
|
251
251
|
|
252
252
|
(test* "db fetch 14"
|
253
253
|
"したい"
|
254
|
-
(kvs.get "dummy
|
254
|
+
(kvs.get "dummy:=shitai"))
|
255
255
|
|
256
256
|
(test* "db fetch 15"
|
257
257
|
'("i" "t")
|
258
|
-
(list (kvs.get "Ih
|
259
|
-
(kvs.get "Ih
|
258
|
+
(list (kvs.get "Ih:dummy:=sh")
|
259
|
+
(kvs.get "Ih:dummy:=shi")))
|
260
260
|
|
261
261
|
(test* "db fetch 16"
|
262
262
|
"Cへんかん"
|
263
|
-
(kvs.get "
|
263
|
+
(kvs.get "M:henkaq"))
|
264
264
|
|
265
265
|
(test* "db fetch 17"
|
266
266
|
"n$ q$"
|
267
|
-
(kvs.get "Ik
|
267
|
+
(kvs.get "Ik:M:henka"))
|
268
268
|
|
269
269
|
(test* "db fetch 18"
|
270
270
|
"しています"
|
271
|
-
(kvs.get "dummy
|
271
|
+
(kvs.get "dummy:=siteimasu"))
|
272
272
|
|
273
273
|
;;-------------------------------------------------------------------
|
274
274
|
(test-section "Replace user dict entry")
|
@@ -279,11 +279,11 @@
|
|
279
279
|
|
280
280
|
(test* "check user dict 1"
|
281
281
|
"/エントリA/エントリB/エントリC"
|
282
|
-
(kvs.get "dummy2
|
282
|
+
(kvs.get "dummy2:てすとようえんとり"))
|
283
283
|
|
284
284
|
(test* "check user dict 2"
|
285
285
|
"i$"
|
286
|
-
(kvs.get "Ik
|
286
|
+
(kvs.get "Ik:dummy2:tesutoyouentor"))
|
287
287
|
|
288
288
|
(test* "flush user dict"
|
289
289
|
11
|
@@ -292,11 +292,11 @@
|
|
292
292
|
;; 直前にflushしているのでgetに失敗しないといけない。
|
293
293
|
(test* "check user dict 3"
|
294
294
|
:no-entry
|
295
|
-
(kvs.get "dummy2
|
295
|
+
(kvs.get "dummy2:てすとようえんとり" :no-entry))
|
296
296
|
|
297
297
|
(test* "check user dict 4"
|
298
298
|
:no-entry
|
299
|
-
(kvs.get "dummy2
|
299
|
+
(kvs.get "dummy2:(te)" :no-entry))
|
300
300
|
|
301
301
|
(test* "register user dict 2"
|
302
302
|
#t
|
@@ -306,14 +306,14 @@
|
|
306
306
|
;; "エントリB" という単語が消えないといけない。
|
307
307
|
(test* "check user dict 5"
|
308
308
|
"/エントリA/エントリC"
|
309
|
-
(kvs.get "dummy2
|
309
|
+
(kvs.get "dummy2:てすとようえんとり"))
|
310
310
|
|
311
311
|
(test* "check user dict 6"
|
312
312
|
'("n t" "t" "t")
|
313
313
|
(list
|
314
|
-
(kvs.get "Ik
|
315
|
-
(kvs.get "Ik
|
316
|
-
(kvs.get "Ik
|
314
|
+
(kvs.get "Ik:dummy2:tesutoyouen")
|
315
|
+
(kvs.get "Ik:dummy2:tesutoyouenn")
|
316
|
+
(kvs.get "Ik:dummy2:tesutoyoueq")))
|
317
317
|
|
318
318
|
|
319
319
|
;;-------------------------------------------------------------------
|
@@ -1173,7 +1173,7 @@
|
|
1173
1173
|
|
1174
1174
|
(test* "DB check after henkan kakutei 1"
|
1175
1175
|
"/返還/変換"
|
1176
|
-
(kvs.get (+ userid "
|
1176
|
+
(kvs.get (+ userid ":へんかん")))
|
1177
1177
|
|
1178
1178
|
(test* "henkan kakutei(for Elisp) 2"
|
1179
1179
|
'(("変換" 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))
|
@@ -1183,7 +1183,7 @@
|
|
1183
1183
|
|
1184
1184
|
(test* "DB check after henkan kakutei 2"
|
1185
1185
|
"/変換/返還"
|
1186
|
-
(kvs.get (+ userid "
|
1186
|
+
(kvs.get (+ userid ":へんかん")))
|
1187
1187
|
|
1188
1188
|
(test* "henkan kakutei(for Elisp) 3"
|
1189
1189
|
'(("デベロッパ" nil "developer" j 0) ("デベロッパー" nil "developer" j 1) ("ディベロッパー" nil "developer" j 2) ("developer" nil "developer" z 3) ("developer" nil "developer" l 4))
|
data/test/memcache.nnd
CHANGED
@@ -51,25 +51,25 @@
|
|
51
51
|
(test-error MemCache::MemCacheError)
|
52
52
|
(let1 sv (Kvs.new dbtype)
|
53
53
|
(sv.open "localhost:11111")
|
54
|
-
(sv.put! "temp
|
54
|
+
(sv.put! "temp:1" "one")))
|
55
55
|
|
56
56
|
(test* "db connect OK"
|
57
57
|
"one"
|
58
58
|
(begin
|
59
59
|
(cachesv.open "localhost:11211")
|
60
|
-
(cachesv.put! "temp
|
60
|
+
(cachesv.put! "temp:1" "one")))
|
61
61
|
|
62
62
|
(test* "db store 1"
|
63
63
|
"one"
|
64
|
-
(cachesv.put! "temp
|
64
|
+
(cachesv.put! "temp:1" "one"))
|
65
65
|
|
66
66
|
(test* "db fetch 1"
|
67
67
|
"one"
|
68
|
-
(cachesv.get "temp
|
68
|
+
(cachesv.get "temp:1"))
|
69
69
|
|
70
70
|
(test* "db fetch fallback"
|
71
71
|
false
|
72
|
-
(cachesv.get "temp
|
72
|
+
(cachesv.get "temp:none" false))
|
73
73
|
|
74
74
|
|
75
75
|
;;-------------------------------------------------------------------
|
@@ -81,10 +81,10 @@
|
|
81
81
|
(for-each
|
82
82
|
(lambda (n)
|
83
83
|
(let1 str (sprintf "%06d" n)
|
84
|
-
(cachesv.put! (+ "temp
|
84
|
+
(cachesv.put! (+ "temp:" str) str)
|
85
85
|
(when (string=?
|
86
86
|
str
|
87
|
-
(cachesv.get (+ "temp
|
87
|
+
(cachesv.get (+ "temp:" str) str))
|
88
88
|
(set! count (+ count 1)))))
|
89
89
|
(range 10000))
|
90
90
|
count))
|
@@ -93,17 +93,17 @@
|
|
93
93
|
(test-section "memcached expire data")
|
94
94
|
(test* "db expire time 1"
|
95
95
|
"now"
|
96
|
-
(cachesv.put! "temp
|
96
|
+
(cachesv.put! "temp:1" "now" 2))
|
97
97
|
|
98
98
|
(test* "db expire time 2"
|
99
99
|
"now"
|
100
|
-
(cachesv.get "temp
|
100
|
+
(cachesv.get "temp:1" "now"))
|
101
101
|
|
102
102
|
(test* "db expire time 3"
|
103
103
|
"miss"
|
104
104
|
(begin
|
105
105
|
(.sleep 3)
|
106
|
-
(cachesv.get "temp
|
106
|
+
(cachesv.get "temp:1" "miss")))
|
107
107
|
|
108
108
|
|
109
109
|
;;===================================================================
|
data/test/redis.nnd
CHANGED
@@ -51,19 +51,19 @@
|
|
51
51
|
(test-error SocketError)
|
52
52
|
(let1 sv (Kvs.new dbtype)
|
53
53
|
(sv.open "nohost.example.com")
|
54
|
-
(sv.put! "temp
|
54
|
+
(sv.put! "temp:1" "one")))
|
55
55
|
|
56
56
|
(test* "db connect NG and Exception"
|
57
57
|
(test-error Timeout::Error)
|
58
58
|
(let1 sv (Kvs.new dbtype)
|
59
59
|
(sv.open "126.0.0.1")
|
60
|
-
(sv.put! "temp
|
60
|
+
(sv.put! "temp:1" "one")))
|
61
61
|
|
62
62
|
(test* "db connect OK"
|
63
63
|
"one"
|
64
64
|
(begin
|
65
65
|
(cachesv.open "localhost")
|
66
|
-
(cachesv.put! "temp
|
66
|
+
(cachesv.put! "temp:1" "one")))
|
67
67
|
|
68
68
|
(print "sleep 100")
|
69
69
|
(.sleep 100)
|
@@ -71,15 +71,15 @@
|
|
71
71
|
|
72
72
|
(test* "db store 1"
|
73
73
|
"one"
|
74
|
-
(cachesv.put! "temp
|
74
|
+
(cachesv.put! "temp:1" "one"))
|
75
75
|
|
76
76
|
(test* "db fetch 1"
|
77
77
|
"one"
|
78
|
-
(cachesv.get "temp
|
78
|
+
(cachesv.get "temp:1"))
|
79
79
|
|
80
80
|
(test* "db fetch fallback"
|
81
81
|
false
|
82
|
-
(cachesv.get "temp
|
82
|
+
(cachesv.get "temp:none" false))
|
83
83
|
|
84
84
|
|
85
85
|
;;===================================================================
|
data/test/roman-lib.nnd
CHANGED
@@ -66,35 +66,35 @@
|
|
66
66
|
|
67
67
|
(test* "kana->roman 1"
|
68
68
|
'("fu" "hu" "hf")
|
69
|
-
(hash-table-get sekka-kana->roman-hash-short "ふ" #f))
|
69
|
+
(hash-table-get sekka-kana->roman-hash-short-azik "ふ" #f))
|
70
70
|
(test* "kana->roman 2"
|
71
71
|
'("la" "xa" "xxa")
|
72
|
-
(hash-table-get sekka-kana->roman-hash-short "ぁ" #f))
|
72
|
+
(hash-table-get sekka-kana->roman-hash-short-azik "ぁ" #f))
|
73
73
|
(test* "kana->roman 3"
|
74
74
|
'("chi" "tyi" "ti" "ci")
|
75
|
-
(hash-table-get sekka-kana->roman-hash-short "ち" #f))
|
75
|
+
(hash-table-get sekka-kana->roman-hash-short-azik "ち" #f))
|
76
76
|
(test* "kana->roman 4"
|
77
77
|
'("tt" "@" ";" "ltu" "xtu")
|
78
|
-
(hash-table-get sekka-kana->roman-hash-short "っ" #f))
|
78
|
+
(hash-table-get sekka-kana->roman-hash-short-azik "っ" #f))
|
79
79
|
(test* "kana->roman 5"
|
80
80
|
'("-" "^" ":" "'")
|
81
|
-
(hash-table-get sekka-kana->roman-hash-short "ー" #f))
|
81
|
+
(hash-table-get sekka-kana->roman-hash-short-azik "ー" #f))
|
82
82
|
(test* "kana->roman 6"
|
83
83
|
'("#")
|
84
|
-
(hash-table-get sekka-kana->roman-hash-short "#" #f))
|
84
|
+
(hash-table-get sekka-kana->roman-hash-short-azik "#" #f))
|
85
85
|
|
86
86
|
;;-------------------------------------------------------------------
|
87
87
|
(test-section "kana->roman conversion hash (long)")
|
88
88
|
|
89
89
|
(test* "kana->roman 1"
|
90
90
|
'("kz" "kn")
|
91
|
-
(hash-table-get sekka-kana->roman-hash-long "かん" #f))
|
91
|
+
(hash-table-get sekka-kana->roman-hash-long-azik "かん" #f))
|
92
92
|
(test* "kana->roman 2"
|
93
93
|
'("kt")
|
94
|
-
(hash-table-get sekka-kana->roman-hash-long "こと" #f))
|
94
|
+
(hash-table-get sekka-kana->roman-hash-long-azik "こと" #f))
|
95
95
|
(test* "kana->roman 3"
|
96
96
|
'("ffu" "hhu" "@fu" "@hu" ";fu" ";hu")
|
97
|
-
(hash-table-get sekka-kana->roman-hash-long "っふ" #f))
|
97
|
+
(hash-table-get sekka-kana->roman-hash-long-azik "っふ" #f))
|
98
98
|
|
99
99
|
;;-------------------------------------------------------------------
|
100
100
|
(test-section "roman->kana conversion hash (short)")
|
@@ -273,7 +273,7 @@
|
|
273
273
|
(test-section "kana->roman conversion functions")
|
274
274
|
|
275
275
|
(let1 hira-list
|
276
|
-
(hash-table-keys sekka-kana->roman-hash-long)
|
276
|
+
(hash-table-keys sekka-kana->roman-hash-long-azik)
|
277
277
|
(test* "kana->roman table length" 524 (length hira-list))
|
278
278
|
(test* "kana->roman key duplicate check" 524 (length (uniq (sort hira-list)))))
|
279
279
|
|