sekka 1.0.0 → 1.1.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +8 -0
- data/Rakefile +6 -4
- data/VERSION.yml +1 -1
- data/bin/sekka-server +6 -5
- data/emacs/sekka.el +1 -1
- data/lib/sekka/approximatesearch.rb +27 -31
- data/lib/sekka/henkan.nnd +1 -40
- data/lib/sekka/jisyo-db.nnd +87 -88
- data/lib/sekka/sekkaversion.rb +2 -2
- data/lib/sekkaserver.rb +8 -0
- data/test/henkan-main.nnd +60 -48
- data/test/sekka-dump-out-1.txt +947 -1781
- metadata +149 -23
- data/README +0 -22
data/test/henkan-main.nnd
CHANGED
@@ -216,45 +216,54 @@
|
|
216
216
|
(kvs.get "dummy::henkanenjin"))
|
217
217
|
|
218
218
|
(test* "db fetch 6"
|
219
|
-
"
|
220
|
-
(kvs.get "MASTER::
|
219
|
+
"i$ n"
|
220
|
+
(kvs.get "Ik::MASTER::kan"))
|
221
221
|
|
222
222
|
(test* "db fetch 7"
|
223
|
-
"
|
224
|
-
(kvs.get "MASTER::
|
223
|
+
"n$ q$"
|
224
|
+
(kvs.get "Ik::MASTER::henka"))
|
225
225
|
|
226
226
|
(test* "db fetch 8"
|
227
|
-
"
|
228
|
-
(kvs.get "MASTER
|
227
|
+
"c t"
|
228
|
+
(kvs.get "Ik::MASTER::#neq#gatsu#ni"))
|
229
229
|
|
230
230
|
(test* "db fetch 9"
|
231
|
-
"
|
232
|
-
(kvs.get "dummy::
|
231
|
+
"f u"
|
232
|
+
(kvs.get "Ik::dummy::y"))
|
233
233
|
|
234
234
|
(test* "db fetch 10"
|
235
|
-
"
|
236
|
-
(kvs.get "dummy
|
235
|
+
"' - : ^"
|
236
|
+
(kvs.get "Ik::dummy::yu"))
|
237
237
|
|
238
238
|
(test* "db fetch 11"
|
239
|
-
"
|
240
|
-
(kvs.get "dummy
|
239
|
+
"/ユーザー辞書"
|
240
|
+
(kvs.get "dummy::ゆーざーじしょ"))
|
241
241
|
|
242
242
|
(test* "db fetch 12"
|
243
243
|
"する"
|
244
244
|
(kvs.get "dummy::=sr"))
|
245
245
|
|
246
246
|
(test* "db fetch 13"
|
247
|
-
"
|
248
|
-
(kvs.get "dummy
|
247
|
+
'("r" "u$")
|
248
|
+
(list (kvs.get "Ih::dummy::=su")
|
249
|
+
(kvs.get "Ih::dummy::=sur")))
|
249
250
|
|
250
251
|
(test* "db fetch 14"
|
251
252
|
"したい"
|
252
253
|
(kvs.get "dummy::=shitai"))
|
253
254
|
|
254
255
|
(test* "db fetch 15"
|
255
|
-
"
|
256
|
-
(kvs.get "dummy
|
256
|
+
'("i" "t")
|
257
|
+
(list (kvs.get "Ih::dummy::=sh")
|
258
|
+
(kvs.get "Ih::dummy::=shi")))
|
259
|
+
|
260
|
+
(test* "db fetch 16"
|
261
|
+
"Cへんかん"
|
262
|
+
(kvs.get "MASTER::henkaq"))
|
257
263
|
|
264
|
+
(test* "db fetch 17"
|
265
|
+
"n$ q$"
|
266
|
+
(kvs.get "Ik::MASTER::henka"))
|
258
267
|
|
259
268
|
|
260
269
|
|
@@ -270,14 +279,14 @@
|
|
270
279
|
(kvs.get "dummy2::てすとようえんとり"))
|
271
280
|
|
272
281
|
(test* "check user dict 2"
|
273
|
-
"
|
274
|
-
(kvs.get "dummy2::
|
282
|
+
"i$"
|
283
|
+
(kvs.get "Ik::dummy2::tesutoyouentor"))
|
275
284
|
|
276
285
|
(test* "flush user dict"
|
277
|
-
|
286
|
+
11
|
278
287
|
(flushUserJisyo userid2 kvs))
|
279
288
|
|
280
|
-
;; getに失敗しないといけない。
|
289
|
+
;; 直前にflushしているのでgetに失敗しないといけない。
|
281
290
|
(test* "check user dict 3"
|
282
291
|
:no-entry
|
283
292
|
(kvs.get "dummy2::てすとようえんとり" :no-entry))
|
@@ -297,33 +306,36 @@
|
|
297
306
|
(kvs.get "dummy2::てすとようえんとり"))
|
298
307
|
|
299
308
|
(test* "check user dict 6"
|
300
|
-
"
|
301
|
-
(
|
309
|
+
'("n t" "t" "t")
|
310
|
+
(list
|
311
|
+
(kvs.get "Ik::dummy2::tesutoyouen")
|
312
|
+
(kvs.get "Ik::dummy2::tesutoyouenn")
|
313
|
+
(kvs.get "Ik::dummy2::tesutoyoueq")))
|
302
314
|
|
303
315
|
|
304
316
|
;;-------------------------------------------------------------------
|
305
317
|
(test-section "approximate-search core")
|
306
318
|
|
307
319
|
(test* "search keyword list 1"
|
308
|
-
'((1.0 "henkan") (0.981 "henkann") (0.9722 "henka") (0.
|
320
|
+
'((1.0 "henkan") (0.981 "henkann") (0.9722 "henka") (0.9444 "henkaq"))
|
309
321
|
(my-round-map
|
310
322
|
(arr->list
|
311
323
|
(a-search.search userid kvs "henkan" "k"))))
|
312
324
|
|
313
325
|
(test* "search keyword list 2"
|
314
|
-
'((1.0 "hennkan") (0.9875 "hennkann") (0.981 "hennka") (0.
|
326
|
+
'((1.0 "hennkan") (0.9875 "hennkann") (0.981 "hennka") (0.9619 "hennkaq") (0.9421 "hennkanenjin") (0.9421 "hennkanenjiq") (0.9421 "hennkanenzin") (0.9421 "hennkanenziq") (0.9421 "hennkaneqjin") (0.9421 "hennkaneqjiq") (0.9421 "hennkaneqzin") (0.9421 "hennkaneqziq"))
|
315
327
|
(my-round-map
|
316
328
|
(arr->list
|
317
329
|
(a-search.search userid kvs "hennkan" "k"))))
|
318
330
|
|
319
331
|
(test* "search keyword list 3"
|
320
|
-
'((1.0 "henkann") (0.981 "henkan") (0.
|
332
|
+
'((1.0 "henkann") (0.981 "henkan") (0.9524 "henka") (0.9449 "henkanenjin") (0.9449 "henkanenjiq") (0.9449 "henkanenzin") (0.9449 "henkanenziq") (0.9421 "henkannenjin") (0.9421 "henkannenjiq") (0.9421 "henkannenzin") (0.9421 "henkannenziq") (0.9421 "henkanneqjin") (0.9421 "henkanneqjiq") (0.9421 "henkanneqzin") (0.9421 "henkanneqziq"))
|
321
333
|
(my-round-map
|
322
334
|
(arr->list
|
323
335
|
(a-search.search userid kvs "henkann" "k"))))
|
324
336
|
|
325
337
|
(test* "search keyword list 4"
|
326
|
-
'((1.0 "hennkann") (0.9875 "hennkan") (0.9667 "hennka") (0.9537 "
|
338
|
+
'((1.0 "hennkann") (0.9875 "hennkan") (0.9667 "hennka") (0.9537 "hennkanenjin") (0.9537 "hennkanenjiq") (0.9537 "hennkanenzin") (0.9537 "hennkanenziq") (0.9537 "hennkaneqjin") (0.9537 "hennkaneqzin") (0.9507 "hennkannenjin") (0.9507 "hennkannenjiq") (0.9507 "hennkannenzin") (0.9507 "hennkannenziq") (0.9507 "hennkanneqjin") (0.9507 "hennkanneqjiq") (0.9507 "hennkanneqzin") (0.9507 "hennkanneqziq") (0.9476 "hennkaq") (0.9408 "hennkanenjinn") (0.9408 "hennkanennjin") (0.9408 "hennkanennjiq") (0.9408 "hennkanennzin") (0.9408 "hennkanennziq") (0.9408 "hennkanenzinn") (0.9408 "hennkaneqjinn") (0.9408 "hennkaneqzinn"))
|
327
339
|
(my-round-map
|
328
340
|
(arr->list
|
329
341
|
(a-search.search userid kvs "hennkann" "k"))))
|
@@ -335,7 +347,7 @@
|
|
335
347
|
(a-search.search userid kvs "heqkaq" "k"))))
|
336
348
|
|
337
349
|
(test* "search keyword list 6"
|
338
|
-
'((0.9762 "henkaS")
|
350
|
+
'((0.9762 "henkaS"))
|
339
351
|
(my-round-map
|
340
352
|
(arr->list
|
341
353
|
(a-search.search userid kvs "henkanS" "K"))))
|
@@ -347,12 +359,12 @@
|
|
347
359
|
(a-search.search userid kvs "hennkanS" "K"))))
|
348
360
|
|
349
361
|
(test* "approximate search 1"
|
350
|
-
'((1.0 "henka" "Cへんか") (0.9722 "henkan" "Cへんかん") (0.9722 "henkaq" "Cへんかん") (0.
|
362
|
+
'((1.0 "henka" "Cへんか") (0.9722 "henkan" "Cへんかん") (0.9722 "henkaq" "Cへんかん") (0.9524 "henkann" "Cへんかん"))
|
351
363
|
(my-round-map
|
352
364
|
(approximate-search userid kvs "henka" "k" 0)))
|
353
365
|
|
354
366
|
(test* "approximate search 2"
|
355
|
-
'((1.1 "hennka" "Cへんか") (1.079 "
|
367
|
+
'((1.1 "hennka" "Cへんか") (1.079 "hennkan" "Cへんかん") (1.079 "hennkaq" "Cへんかん") (1.0633 "hennkann" "Cへんかん"))
|
356
368
|
(my-round-map
|
357
369
|
(approximate-search userid kvs "hennka" "k" 0)))
|
358
370
|
|
@@ -367,7 +379,7 @@
|
|
367
379
|
(approximate-search userid kvs "hennkaS" "k" 0)))
|
368
380
|
|
369
381
|
(test* "approximate search 5"
|
370
|
-
'((1.0 "kani" "Cかに") (1.0 "kani" "Cかんい")
|
382
|
+
'((1.0 "kani" "Cかに") (1.0 "kani" "Cかんい"))
|
371
383
|
(my-round-map
|
372
384
|
(approximate-search userid kvs "kani" "k" 0)))
|
373
385
|
|
@@ -377,7 +389,7 @@
|
|
377
389
|
(approximate-search userid kvs "hennka" "k" 1)))
|
378
390
|
|
379
391
|
(test* "approximate search 7"
|
380
|
-
'((1.1 "hennka" "Cへんか") (1.079 "
|
392
|
+
'((1.1 "hennka" "Cへんか") (1.079 "hennkan" "Cへんかん"))
|
381
393
|
(my-round-map
|
382
394
|
(approximate-search userid kvs "hennka" "k" 2)))
|
383
395
|
|
@@ -387,12 +399,12 @@
|
|
387
399
|
(approximate-search userid kvs "saki" "k" 0)))
|
388
400
|
|
389
401
|
(test* "approximate search 9"
|
390
|
-
'((1.0 "inyou" "Cいんよう")
|
402
|
+
'((1.0 "inyou" "Cいんよう"))
|
391
403
|
(my-round-map
|
392
404
|
(approximate-search userid kvs "inyou" "k" 0)))
|
393
405
|
|
394
406
|
(test* "approximate search 10"
|
395
|
-
'((1.1 "innyou" "Cいんよう") (1.
|
407
|
+
'((1.1 "innyou" "Cいんよう") (1.0 "innyou" "Cいんにょう"))
|
396
408
|
(my-round-map
|
397
409
|
(approximate-search userid kvs "innyou" "k" 0)))
|
398
410
|
|
@@ -432,22 +444,22 @@
|
|
432
444
|
(approximate-search userid kvs "=sure" "h" 0)))
|
433
445
|
|
434
446
|
(test* "approximate search 18"
|
435
|
-
'((0.9926 "=narimasd" "なりません") (0.9926 "=narimast" "なりました") (0.9926 "=narimasu" "なります") (0.9867 "=
|
447
|
+
'((0.9926 "=narimasd" "なりません") (0.9926 "=narimast" "なりました") (0.9926 "=narimasu" "なります") (0.9867 "=narimasen" "なりません") (0.9867 "=narimaseq" "なりません") (0.9833 "=narims" "なります") (0.9752 "=narimasenn" "なりません") (0.9752 "=narimasita" "なりました"))
|
436
448
|
(my-round-map
|
437
449
|
(approximate-search userid kvs "=narimas" "h" 0)))
|
438
450
|
|
439
451
|
(test* "approximate search 19"
|
440
|
-
'((0.9967 "=
|
452
|
+
'((0.9967 "=narimasen" "なりません") (0.9967 "=narimaseq" "なりません") (0.989 "=narimasenn" "なりません") (0.9852 "=narimasd" "なりません") (0.9852 "=narimast" "なりました") (0.9852 "=narimasu" "なります"))
|
441
453
|
(my-round-map
|
442
454
|
(approximate-search userid kvs "=narimase" "h" 0)))
|
443
455
|
|
444
456
|
(test* "approximate search 20"
|
445
|
-
'((0.9852 "=narimasd" "なりません") (0.9852 "=narimast" "なりました") (0.9852 "=narimasu" "なります") (0.9793 "=
|
457
|
+
'((0.9852 "=narimasd" "なりません") (0.9852 "=narimast" "なりました") (0.9852 "=narimasu" "なります") (0.9793 "=narimaseq" "なりません") (0.9793 "=narimasen" "なりません") (0.9792 "=narimashita" "なりました"))
|
446
458
|
(my-round-map
|
447
459
|
(approximate-search userid kvs "=narimash" "h" 0)))
|
448
460
|
|
449
461
|
(test* "approximate search 21"
|
450
|
-
'((0.9907 "=narimashita" "なりました") (0.9793 "=
|
462
|
+
'((0.9907 "=narimashita" "なりました") (0.9793 "=narimast" "なりました") (0.9793 "=narimasd" "なりません") (0.9793 "=narimasu" "なります"))
|
451
463
|
(my-round-map
|
452
464
|
(approximate-search userid kvs "=narimashi" "h" 0)))
|
453
465
|
|
@@ -457,7 +469,7 @@
|
|
457
469
|
(approximate-search userid kvs "=natteiru" "h" 0)))
|
458
470
|
|
459
471
|
(test* "approximate search 23"
|
460
|
-
'(
|
472
|
+
'()
|
461
473
|
(my-round-map
|
462
474
|
(approximate-search userid kvs "=nateiru" "h" 0)))
|
463
475
|
|
@@ -486,7 +498,7 @@
|
|
486
498
|
(henkan-okuri-nashi userid kvs "hennkann" 0))
|
487
499
|
|
488
500
|
(test* "okuri nashi 6"
|
489
|
-
'(("自然言語" #f "しぜんげんご" j) ("
|
501
|
+
'(("自然言語" #f "しぜんげんご" j) ("自然言語理解" #f "しぜんげんごりかい" j) ("自然言語処理" #f "しぜんげんごしょり" j))
|
490
502
|
(henkan-okuri-nashi userid kvs "shizengengo" 0))
|
491
503
|
|
492
504
|
(test* "okuri nashi 7"
|
@@ -651,12 +663,12 @@
|
|
651
663
|
(test-section "henkan (okuri ari)")
|
652
664
|
|
653
665
|
(test* "approximate search 1"
|
654
|
-
'((1.0 "henkaS" "Cへんかs")
|
666
|
+
'((1.0 "henkaS" "Cへんかs"))
|
655
667
|
(my-round-map
|
656
668
|
(approximate-search userid kvs "henkaS" "K" 0)))
|
657
669
|
|
658
670
|
(test* "approximate search 2"
|
659
|
-
'((0.9762 "henkaS" "Cへんかs")
|
671
|
+
'((0.9762 "henkaS" "Cへんかs"))
|
660
672
|
(my-round-map
|
661
673
|
(approximate-search userid kvs "henkanS" "K" 0)))
|
662
674
|
|
@@ -666,7 +678,7 @@
|
|
666
678
|
(approximate-search userid kvs "okonaU" "K" 0)))
|
667
679
|
|
668
680
|
(test* "approximate search 4"
|
669
|
-
'(
|
681
|
+
'()
|
670
682
|
(my-round-map
|
671
683
|
(approximate-search userid kvs "okonU" "K" 0)))
|
672
684
|
|
@@ -681,7 +693,7 @@
|
|
681
693
|
(approximate-search userid kvs "henkaS" "K" 1)))
|
682
694
|
|
683
695
|
(test* "approximate search 7"
|
684
|
-
'((1.0 "henkaS" "Cへんかs")
|
696
|
+
'((1.0 "henkaS" "Cへんかs"))
|
685
697
|
(my-round-map
|
686
698
|
(approximate-search userid kvs "henkaS" "K" 2)))
|
687
699
|
|
@@ -715,7 +727,7 @@
|
|
715
727
|
(henkan-okuri-ari userid kvs "OkonaU" 0 :normal))
|
716
728
|
|
717
729
|
(test* "okuri ari 8"
|
718
|
-
'(
|
730
|
+
'()
|
719
731
|
(henkan-okuri-ari userid kvs "okonU" 0 :normal))
|
720
732
|
|
721
733
|
(test* "okuri ari 9"
|
@@ -777,7 +789,7 @@
|
|
777
789
|
;; 送り仮名が "R" で始っているのに、"t" や "`" もマッチしている理由は、送り仮名の開始子音1文字まで含めたJaro-WInkler distanceで候補で並べており、送り仮名が違うからといって排除しない方針をとっているため。
|
778
790
|
;; それにより送り仮名のミスタイプの許容をしている。
|
779
791
|
(test* "okuri ari 23"
|
780
|
-
'(("ブログりました" #f "ぶろぐr" j) ("ブログりました" #f "
|
792
|
+
'(("ブログりました" #f "ぶろぐr" j) ("ブログりました" #f "ぶろぐt" j) ("ブログりました" #f "ぶろぐ+" j) ("ブログりました" #f "ぶろぐ`" j))
|
781
793
|
(henkan-okuri-ari userid kvs "buroguRimashita" 0 :normal))
|
782
794
|
|
783
795
|
(test* "okuri ari 24"
|
@@ -846,7 +858,7 @@
|
|
846
858
|
(henkan-hiragana userid kvs "shitaii" :normal))
|
847
859
|
|
848
860
|
(test* "hiragana-phrase 5"
|
849
|
-
'(("なります" #f "narimasu" h) ("
|
861
|
+
'(("なります" #f "narimasu" h) ("なりません" #f "narimasu" h) ("なりました" #f "narimasu" h) ("なります" #f "narimasu" h) ("ナリマス" #f "narimasu" k))
|
850
862
|
(henkan-hiragana userid kvs "narimasu" :normal))
|
851
863
|
|
852
864
|
(test* "hiragana-phrase 6"
|
@@ -890,7 +902,7 @@
|
|
890
902
|
'("a" "ai" "aiu" "aiue" "aiueo" "aiueoka" "aiueokaki" "aiueokakiku" "aiueokakikuke" "aiueokakikukeko")))
|
891
903
|
|
892
904
|
(test* "hiragana-phrase 13"
|
893
|
-
'(("
|
905
|
+
'(("なている" #f "nateiru" h) ("ナテイル" #f "nateiru" k))
|
894
906
|
(henkan-hiragana userid kvs "nateiru" :normal))
|
895
907
|
|
896
908
|
|
@@ -1096,7 +1108,7 @@
|
|
1096
1108
|
(sekkaHenkan userid kvs #f "buroguTta" 0 "normal"))
|
1097
1109
|
|
1098
1110
|
(test* "henkan toplevel(for Elisp) 9"
|
1099
|
-
'(("ブログりました" nil "ぶろぐr" j 0) ("ブログりました" nil "
|
1111
|
+
'(("ブログりました" nil "ぶろぐr" j 0) ("ブログりました" nil "ぶろぐt" j 1) ("ブログりました" nil "ぶろぐ+" j 2) ("ブログりました" nil "ぶろぐ`" j 3) ("ぶろぐりました" nil "burogurimashita" h 4) ("ブログリマシタ" nil "burogurimashita" k 5) ("buroguRimashita" nil "buroguRimashita" z 6) ("buroguRimashita" nil "buroguRimashita" l 7))
|
1100
1112
|
(sekkaHenkan userid kvs #f "buroguRimashita" 0 "normal"))
|
1101
1113
|
|
1102
1114
|
(test* "henkan toplevel(for Elisp) 10"
|