ãã¡ãžã£æååæ€çŽ¢ã¯ãç¹ã«çµæã®é«ã粟床ãå¿ èŠãªå Žåãèšç®ãªãœãŒã¹ã®é¢ã§éåžžã«é«äŸ¡ãªã¿ã¹ã¯ã§ãã ãã®èšäºã§ã¯ãèŸæžã®ãã¡ãžãŒæ€çŽ¢ã¢ã«ãŽãªãºã ã«ã€ããŠèª¬æããŸãããã®ã¢ã«ãŽãªãºã ã¯ã100ïŒ ã®ç²ŸåºŠãšæ¯èŒçäœãã¡ã¢ãªæ¶è²»ãç¶æããªãããé«ãæ€çŽ¢é床ãæäŸããŸãã Luceneéçºè ããã¡ãžãŒæ€çŽ¢ã®é床ã2æ¡äžããããšãã§ããã®ã¯ãLevenshteinãªãŒãããã³ã§ãã
ã¯ããã«
èŸæžå ã®æååã®ãã¡ãžãŒæ€çŽ¢ã¯ãããã¹ããšãã£ã¿ãŒãå åŠåŒæåèªèã·ã¹ãã ãããã³æ€çŽ¢ãšã³ãžã³ã§äœ¿çšãããææ°ã®ã¹ãã«ãã§ãã¯ã·ã¹ãã ãæ§ç¯ããããã®åºç€ã§ãã ããã«ããã¡ãžãŒæ€çŽ¢ã¯ããã€ãªã€ã³ãã©ããã£ã¯ã¹ã®å€ãã®èšç®äžã®åé¡ã解決ããããã®ã¢ããªã±ãŒã·ã§ã³ãèŠã€ããŸãã
èŸæžã®ãã¡ãžãŒæ€çŽ¢åé¡ã®æ£åŒãªå®çŸ©ã¯ã次ã®ããã«å®åŒåã§ããŸãã äžããããæ€çŽ¢ã¯ãšãªWã«å¯ŸããŠãæ€çŽ¢ã¯ãšãªãšã®å·®pãç¹å®ã®ãããå€Nãè¶ ããªããã¹ãŠã®åèªã®ãµãã»ããPãèŸæžDããéžæããå¿ èŠããããŸãã
2ã€ã®åèªã®éãã®çšåºŠã¯ãããšãã°ã ã¬ãŒãã³ã·ã¥ã¿ã€ã³è·é¢ãŸãã¯ãã¡ã©ãŠ-ã¬ãŒãã³ã·ã¥ã¿ã€ã³è·é¢ã䜿çšããŠæž¬å®ã§ããŸãã
ã¬ãŒãã³ã·ã¥ã¿ã€ã³è·é¢ã¯ã2è¡éã®å·®ã®å°ºåºŠã§ããã1è¡ãå¥ã®è¡ã«å€æããããã«å¿ èŠãªæåã®æ¿å ¥ãåé€ãããã³çœ®æã®æå°æ°ãšããŠå®çŸ©ãããŸãã
Damerau-Levenshteinè·é¢ãèšç®ãããšãã転眮ïŒ2ã€ã®é£æ¥ããæåã®é åïŒãèš±å¯ãããŸãã
æ°å¹ŽåãHabréã«ã¯ãèŸæžãšããã¹ãã®ãã¡ãžãŒæ€çŽ¢å°çšã®ntzããã®æçš¿ããããŸãã-ã¬ãŒãã³ã·ã¥ã¿ã€ã³ãšãã¡ã©ãŠ-ã¬ãŒãã³ã·ã¥ã¿ã€ã³ã®è·é¢ã«é¢ãã詳现ã¯ããã§èªãããšãã§ããŸãã ç¶æ ããã§ãã¯ããæéã®è€éããæãåºãã ãã§ã
åçèšç»æ³ã䜿çšããpïŒP i ãWïŒ<= Nã¯ã
ã
ããã§| P i |ã| W | -æååãšãªã¯ãšã¹ãã®é·ãã ãããã£ãŠãå®éã®åé¡ã解決ããå Žåãååèªã®æ€èšŒã䌎ãèŸæžå€ã®å®å šãªåæã¯ãååãšããŠåãå ¥ããããŸããã
ãã¹ãŠã®ãã¡ãžãŒæ€çŽ¢ã¢ã«ãŽãªãºã ããã¯ãšãªWã«ãã£ãŠãæ¡ä»¶pïŒP i ãWïŒ<= NãæºããèŸæžDã®ãã¹ãŠã®çµ¶å¯ŸåèªãèŠã€ããããšãä¿èšŒããããã§ã¯ãªãããšã«æ³šæããŠãã ããã ãããã£ãŠãæ€çŽ¢ã®ç²ŸåºŠã«ã€ããŠã¯ãèŠã€ãã£ãçµæã®æ°ãšãç¹å®ã®æ¡ä»¶ãæºããèŸæžå ã®å®éã®åèªæ°ãšã®æ¯ãšããŠèª¬æããã®ãçã«ããªã£ãŠããŸãã ããšãã°ããã§ã«èšåããæçš¿ã®èè ã¯ãn-gramæ³ã䜿çšããæ€çŽ¢ã®ç²ŸåºŠã65ïŒ ãšæšå®ããŸããã
é決å®æ§ã¬ãŒãã³ã·ã¥ã¿ã€ã³ãªãŒãããã³
èè ã¯ãèªè ããªãŒãããã³ããã³åœ¢åŒèšèªã®çè«ã®åºç€ã«ç²ŸéããŠããããã®äž»é¡åéã®çšèªã®èª¬æãæ§ããããšãåæãšããŠããŸãã 代ããã«ãããã«ä»äºã«åãæãããŸãã
å®çšçãªåé¡ã解決ããããã«ãã¬ãŒãã³ã·ã¥ã¿ã€ã³ã®æ±ºå®è«çãªæéç¶æ ãã·ã³ã䜿çšãããŸãïŒå®å šã«æ£ç¢ºã«èšãã°ããã®æš¡å£ïŒã ãã ããã¬ãŒãã³ã·ã¥ã¿ã€ã³ã®ç¢ºå®çæéç¶æ ãã·ã³ã®åäœåçãç解ããã«ã¯ããŸãé確å®çããŒãžã§ã³ã®åäœãæ€èšããããšããå§ãããŸãã
åèªWã®ã¬ãŒãã³ã·ã¥ã¿ã€ã³ãªãŒãããã³ãšã¯ ãåèªWãšSã®éã®ã¬ãŒãã³ã·ã¥ã¿ã€ã³ïŒDamerau-LevenshteinïŒè·é¢ãæå®ãããå€Nãè¶ ããªãå Žåã«ã®ã¿ãåèªSãåãæéãªãŒãããã³A N ïŒWïŒãæå³ããŸãã
åèªWããã³èš±å®¹ãããå€æŽæ°Nã®ã¬ãŒãã³ã·ã¥ã¿ã€ã³ã¹ããŒããã·ã³ã¯ãé åºä»ãããã5ã€ã®èŠçŽ A N ïŒWïŒ= <EãQãq 0 ãFãV>ãšããŠå®çŸ©ã§ããŸããããã§ã
Eã¯ãªãŒãããã³ã®ã¢ã«ãã¡ãããã§ãã
Qã¯å éšç¶æ ã®ã»ããã§ãã
q 0-åæç¶æ ãéåQã«å±ããŸãã
Fã¯æçµç¶æ ãŸãã¯æçµç¶æ ã®ã»ããã§ã
Vã¯é·ç§»é¢æ°ã§ããªãŒãããã³ã®å ¥åã«å¥ã®ã·ã³ãã«ãå°çãããšãã«çŸåšã®ç¶æ ããã©ã®ç¶æ ãé·ç§»ã§ãããã決å®ããŸãã
é決å®æ§ã®ã¬ãŒãã³ã·ã¥ã¿ã€ã³ãªãŒãããã³A N ïŒWïŒã®ç¶æ 㯠ãéåžži #eãšããŠç€ºãããŸããããã§ã i = 0 .. | W | ã e = 0..N ã ãã·ã³ã®ç¶æ ãi #eã®å Žåã i㯠ãæ£ãããæåããã·ã³ã«å ¥åããã eåã®å€æŽãæ€åºãããããšãæå³ããŸãã 転眮ããµããŒããããªãŒãããã³ïŒã€ãŸãã Damerau-Levenshteinè·é¢ãpïŒSãWïŒãšããŠäœ¿çšãããïŒãèæ ®ãããããç¶æ ã®ã»ããã¯ç¶æ {i T #e }ã§è£å®ããå¿ èŠããããŸãïŒ i = 0 .. | W | -1 ã e = 1..N
ãªãŒãããã³ã®åæç¶æ ã¯ç¶æ 0 ïŒ0ã§ãã
æçµç¶æ ã®ã»ããã«ã¯ãæ¡ä»¶| W | -i <= N-e ã
ãªãŒãããã³ã®ç¶æ ã®ç©ççãªæå³ã«åºã¥ããŠã蚱容å¯èœãªé·ç§»ã®æ§æã決å®ããããšã¯é£ãããããŸããã ã¬ãŒãã³ã·ã¥ã¿ã€ã³ãªãŒãããã³ã®é·ç§»é¢æ°ã¯ãããŒãã«ã®åœ¢åŒã§æå®ãããŸãã
ãªãŒãããã³ã®ç¶æ ã®æ§æã®å³å¯ãªæ°åŠçæ£åœåãšäžèšã®ãã®ä»ã®è«æã«èå³ãããå Žåã¯ãSchultz and MikhovïŒ2002ïŒã®èšäºã§ãããèŠã€ããããšãã§ããŸãã
æåxã®ç¹æ§ãã¯ãã«ZïŒxãW i ïŒã¯ãé·ãminïŒN + 1ã| W |-iïŒã®ããããã¯ãã«ã§ããæååWã®ïŒi + kïŒçªç®ã®æåãxã®å Žåã kçªç®ã®èŠçŽ ã¯1ã§ãããã以å€ã®å Žåã¯0 ã ããšãã°ã W =â LISTâã®å Žå
ZïŒ ''ãW 0 ïŒ = <1ã0>ãããã³ZïŒ ''ãW 1 ïŒ = <0ã0>ã
W =â LISTâããã³N = 1ã®ã¬ãŒãã³ã·ã¥ã¿ã€ã³ãªãŒãããã³ã®ã°ã©ãã£ã«ã«ãªè¡šçŸãå³ã«ç€ºããŸãã ãªãŒãããã³ã®é·ç§»ã¯ã察å¿ããç¹æ§ãã¯ãã«ã«ãã£ãŠçœ²åãããŸãã
ãªãŒãããã³ã®æçµç¶æ ã¯ç·è²ã§åŒ·èª¿è¡šç€ºãããŸãã æ°Žè²-ãã·ã³ã®çŸåšã®ïŒã¢ã¯ãã£ããªïŒç¶æ ã
æ°Žå¹³ç¢å°ã«æ²¿ã£ã移è¡ã¯ããæ£ãããèšå·ãæ©æ¢°ã«å ¥åããããšå®è¡ãããŸãã
åçŽç¢å°ã«æ²¿ã£ãé·ç§»ã¯ããã·ã³ã«å ¥åããã次ã®æåãïŒi + 1ïŒçªç®ã®æåã®åã«å ã®åèªWã«æ¿å ¥ããããšããä»®å®ã«å¯Ÿå¿ããŠããŸãã åçŽç¢å°ã«æ²¿ã£ãŠç§»åãããšããªãŒãããã³ã¯åèªWã®å€æŽããæ€åºãããŸããeã®å€ã¯1å¢å ããŸãã
ç¶æ i #eããç¶æ ïŒi + 1ïŒ ïŒe + 1ãžã®é·ç§»ã¯ã次ã®æåãåèªWã® ïŒi +1ïŒçªç®ã®æåã眮ãæãããšããä»®å®ã«å¯Ÿå¿ããŸãã
ç¶æ i #eããç¶æ ïŒi + 2ïŒ ïŒe + 1ãžã®é·ç§»ã¯ã次ã®æåãåèªWã®ïŒi + 2ïŒçªç®ã®æåã«å¯Ÿå¿ããåèªWã®ïŒi + 1ïŒçªç®ã®æåãæ¬ èœããŠãããšããä»®å®ã«å¯Ÿå¿ããŸãåèªSã§
ãããããç¶æ i T #eãžã®é·ç§»ã¯ãåèªWã®ïŒi + 1ïŒçªç®ãšïŒi + 2ïŒçªç®ã®æåã®è»¢çœ®ãæ€åºãããããšã瀺åããŠããããšããã§ã«æšæž¬ããŠããã§ãããã
ããã§ã¯ããã®ä»çµã¿ãèŠãŠã¿ãŸãããã æ²ç·ã®èµ€ãç¢å°ã§ãã·ã³ãžã®æ°ããã·ã³ãã«ã®å ¥åã瀺ããç¢å°ã®å³åŽã«ç¹æ§ãã¯ãã«ã®å€ã瀺ããŸãã ããã¯ããSEARCHããšããåèªãå ¥åãããšããã·ã³A 1 ïŒãLISTãïŒãã©ã®ããã«æ©èœãããã瀺ããŠããŸãã
å®éããªãŒãããã³ã®ç¶æ ã®å€åã®ã·ãŒã±ã³ã¹ã¯ããªãŒãããã³ã®å ¥åã«äŸçµŠãããç¹å®ã®åèªã§ã¯ãªããç¹æ§ãã¯ãã«ã®ã·ãŒã±ã³ã¹ã«ãã£ãŠã®ã¿æ±ºå®ãããããšã«æ³šæããŠãã ããã ãã®ã·ãŒã±ã³ã¹ã¯ã2ã€ã®ç°ãªãåèªã§åãå ŽåããããŸãã ããšãã°ããªãŒãããã³ããmotherããšããåèªã«èšå®ãããŠããå Žåãç¹æ§ãã¯ãã«ã®ã·ãŒã±ã³ã¹ã¯ãlamaãããframeãããladyããªã©ã®åèªã§åãã«ãªããŸãã
å¥ã®èå³æ·±ãäºå®ã¯ããªãŒãããã³ã®èš±å®¹å¯èœãªé·ç§»ã®æ§é ãi = 0ã®å Žåã«å€åããªãããšã§ãã..| W | -ïŒN + 1ïŒ ã
ãããã®2ã€ã®ç¶æ³ã«ããããã¡ãžãŒæ€çŽ¢ã¢ã«ãŽãªãºã ã®ãœãããŠã§ã¢å®è£ ã¯ãç¹å®ã®åèªããšã«èšç®ãããã®ã§ã¯ãªãããã®æ®éçãªæš¡å£ã®ãã·ã³ã䜿çšã§ããŸãã ããããæçš¿ã®ã¿ã€ãã«ããæ®éçãªãã¬ãŒãã³ã·ã¥ã¿ã€ã³ãªãŒãããã³ãæãçç±ã§ãã
ãã®å Žåãç¹å®ã®åèªSã®ãªãŒãããã³ã®èšç®ã¯ãåèªSã®åã·ã³ãã«xã®ç¹æ§ãã¯ãã«ã®åçŽãªèšç®ã«åæžãããŸãã ç¶æ ã®å€æŽã¯ã2ã€ã®å€æ°eã®åçŽãªå¢å ãšããŠãœãããŠã§ã¢ã«å®è£ ãããŸãã Schulz and MihovïŒ2002ïŒã¯ãåèªSã®ãã¹ãŠã®ç¹æ§ãã¯ãã«ãæéOïŒ| S |ïŒã§èšç®ã§ããããšã瀺ããŸããã ããã¯ããã·ã³ã®äžæçãªè€éãã§ãã
åèªSã®æåã¯ãæ©æ¢°ã®å ¥åã«é 次éãããŸãã ç¹å®ã®ãã£ã©ã¯ã¿ãŒã絊é€ããåŸãã©ã€ã³SãšWã®éã®è·é¢ããããå€Nãè¶ ããããšãæããã«ãªã£ãå Žåããã·ã³ã¯ã空ã®ãç¶æ ã«ããããã·ã³ã«ã¯ã¢ã¯ãã£ããªç¶æ ã¯ãããŸããã ãã®å ŽåãåèªSã®æ®ãã®æåã®ç¹æ§ãã¯ãã«ãèšç®ããå¿ èŠããªããªããŸãã
ããã¯ããã·ã³ãW = "LIST"ã§åèªS = "ICS"ããå®çŸãããæ¹æ³ã§ãã
ãIãèšå·ãå ¥åããåŸã4ã€ã®ã¢ã¯ãã£ãç¶æ ããã·ã³ã«ããã«çŸããŸãããããKãèšå·ãå ¥åããåŸãã¢ã¯ãã£ãç¶æ ã¯ãããŸããã§ããããã·ã³ã¯ãšã©ãŒç¶æ ã§ããIKSããšããåèªãåãå ¥ããŸããã§ããã ãã®å Žåãã·ã³ãã«ãCãã®ç¹æ§ãã¯ãã«ã®èšç®ã¯å®è¡ãããŸããã§ããã
決å®è«çã¬ãŒãã³ã·ã¥ã¿ã€ã³ãªãŒãããã³
決å®è«ã®å®çã«åŸã£ãŠãé決å®è«çæéç¶æ æ©æ¢°ã«ã€ããŠãåçã®æ±ºå®è«çæéç¶æ æ©æ¢°ãæ§ç¯ã§ããŸãã 決å®è«çãªãŒãããã³ãå¿ èŠãªã®ã¯ãªãã§ããïŒ ãœãããŠã§ã¢ãå®è£ ããã ãã§ãããéãåäœããŸãã äž»ã«ãçŸåšã®ç¶æ ã1ã€ããæãŠãªãããã次ã®æåãå ¥åãããšãã«ãç¹æ§ãã¯ãã«ã1ã€ã ãèšç®ããé·ç§»ããŒãã«ããé·ç§»ã1ã€ã ã決å®ããå¿ èŠããããŸãã
äžèšã§æ€èšããé決å®è«çã¬ãŒãã³ã·ã¥ã¿ã€ã³ãªãŒãããã³A 1 ïŒWïŒã«ã€ããŠãç¹åŸŽãã¯ãã«ã®ãã¹ãŠã®å¯èœãªå€ãé çªã«ç¹°ãè¿ãå Žåã次ã®ã»ããã®ãããããæ§æããç¶æ ãåæã«ã¢ã¯ãã£ãã«ãªãããšã確èªã§ããŸãã
äžèšã®6ã€ã®ã»ããã¯ã N = 1ã®ç¢ºå®çã¬ãŒãã³ã·ã¥ã¿ã€ã³ãªãŒãããã³ã®ç¶æ ã«ãªããŸãã ããæ£ç¢ºã«ã¯ããªãŒãããã³ã«ã¯ã i = 0 .. | W | -2ã® 6ã€ã®ç¶æ ã i = | W | -1ã® 3ã€ã®ç¶æ ãããã³i = | W | -1ã® 2ã€ã®ç¶æ ããããŸãã ã
決å®æ§ãªãŒãããã³ã®ç¹æ§ãã¯ãã«ã®æ¬¡å ã¯ã 2N + 1ãšããŠèšç®ã§ããŸãã 次ã«ã | W |ããã®åèªã®ãªãŒãããã³ã®é·ç§»è¡š N = 1ã®æåã«ã¯ã 2x1 + 1è¡2è¡ãš6xïŒ| W | -1ïŒ+ 3 + 2åãå¿ èŠã§ãïŒããšãã°ã6æåã®åèªã®å Žåã¯8x35ïŒã ããã«ããã®ãããªããŒãã«ã¯ã | W |ã®åå€ã«å¯ŸããŠèšç®ããå¿ èŠããããŸãã åå¥ã«ã ããã¯ããŸã䟿å©ã§ã¯ãªããèšç®ã®ããã®è¿œå ã®æéãŸãã¯ã¹ãã¬ãŒãžã®ããã®è¿œå ã®ã¡ã¢ãªãå¿ èŠã§ãã
ãã ããäžã§æžããããã«ããªãŒãããã³ã®èš±å®¹å¯èœãªé·ç§»ã®æ§æã¯ã i = 0ã®å Žåã¯å€åããŸããã -ïŒ2N + 1ïŒ ã ãããã£ãŠããœãããŠã§ã¢å®è£ ã§ã¯ãå®éã®ãªãŒãããã³ãèšç®ãã代ããã«ã決å®è«çãªãŒãããã³ãã·ãã¥ã¬ãŒãããæ¹ãã¯ããã«äŸ¿å©ã§ãã ãããè¡ãã«ã¯ããªãã»ããå€iãä¿åãã8è¡6åã®ãŠââãããŒãµã«é·ç§»ããŒãã«ã䜿çšããã ãã§ååã§ãã ãã®ãããªããŒãã«ã¯äºåã«èšç®ã§ããŸãã
iãå¢å ãããšããªãŒãããã³ã®äžéšã®ç¶æ ãå°éäžèœã«ãªãããã i = | W | -2 .. | W | å¥ã®å°ããªããŒãã«ãçšæããå¿ èŠããããŸãã
ããã«ã決å®è«çãªã¬ãŒãã³ã·ã¥ã¿ã€ã³ãªãŒãããã³ãšããã°ããŸãã«äžèšã®æ®éçãªæš¡å£ãæå³ããŸãã
Nãå¢å ãããšãç¶æ ã®æ°ã¯ææ°é¢æ°çã«å¢å ããŸãã ãããã£ãŠã N = 2ã®å Žåã確å®ãªãŒãããã³ã¯42åã®ç¶æ ãæã€ããšãã§ããŸããN = 3ã®å Žåããã§ã«æ°çŸåãããŸãã ããã¯ãã¡ã¢ãªæ¶è²»ãOïŒN 2 ïŒã«æ¯äŸããããšãæå³ããŸãã
決å®è«çã¬ãŒãã³ã·ã¥ã¿ã€ã³ãªãŒãããã³ã®åæç¶æ ã¯ãç¶æ A 0ã«ãªããŸãã
æçµçãªæ¡ä»¶ã¯äœã§ããïŒ é決å®çãªãŒãããã³ã®æçµç¶æ ã«å¯Ÿå¿ãããã®ã N = 1ã®å Žåããããã¯ç¶æ A | W | ã B | W | ã A | W | -1 ã C | W | -1 ã D | W | -2 ã E | W | -2 ã F | W | -2 ã
6ã€ã®ç¶æ éã®é·ç§»ã®æ°ã¯éåžžã«å€ãã決å®è«çãªã¬ãŒãã³ã·ã¥ã¿ã€ã³ãªãŒãããã³ã®ç¶æ ã®ç©ççãªæå³ã¯æããã§ã¯ãªããããããã§ã¯ãã®ã°ã©ãã£ã«ã«ãªè¡šçŸã瀺ããŸããã å šäœåã¯ã¯ã£ããããŠããªããšæããŸãã ããã§ã圌女ãèŠããå Žåã¯ã Mikhov and SchulzïŒ2004ïŒã®èšäºãåç §ããŠãã ããã é決å®çãªãŒãããã³ã®æäœã®ãã1ã€ã®äŸã瀺ããŸãããä»åã¯ãã©ã®ç¶æ ã§ãã®æ±ºå®çåçç©ããã¹ãŠã®ç¬éã«ååšãããã瀺ããŸãã
決å®ãããã¬ãŒãã³ã·ã¥ã¿ã€ã³ãªãŒãããã³ã®ãœãããŠã§ã¢å®è£
ã¬ãŒãã³ã·ã¥ã¿ã€ã³ãªãŒãããã³ã®ãœãããŠã§ã¢å®è£ ãCïŒã§äœæããŸãã-ãã®èšèªã«æã粟éããŠããŸãã ããã§ãœãŒã¹ãèŠã€ããããšãã§ããŸãã ãŠãããŒãµã«å€æããŒãã«ã¯ãéçã¯ã©ã¹ParametricDescriptionã®ãã£ãŒã«ããšããŠå®è£ ãããŸãã ãã®ã¯ã©ã¹ã«ã¯ã N = 1,2ã®ãŠãããŒãµã«å€æããŒãã«ãå«ãŸããŠããŸãã
å€æããŒãã«ã«å ããŠãParametricDescriptionã¯ã©ã¹ã«ã¯ãªãã»ããå¢åããŒãã«ãå«ãŸããŠããŸãã ãªãã»ããå¢åã¯ã次ã®ç¶æ ã«ç§»è¡ãããšãã«iã®å€ãå¢ããå¿ èŠãããå€ã§ãã
ã¬ãŒãã³ã·ã¥ã¿ã€ã³ãªãŒãããã³èªäœã¯ãLevTAutomataImitationã¯ã©ã¹ã«å®è£ ãããŠããŸãã ãã¹ãŠã®ã¯ã©ã¹ã¡ãœããã¯éåžžã«åçŽã§ããã詳现ã«èª¬æããŸããã èŸæžã§ãã¡ãžãŒæ€çŽ¢ãå®è¡ããå Žåããªã¯ãšã¹ãããšã«ã¯ã©ã¹ã®ã€ã³ã¹ã¿ã³ã¹ã1ã€äœæããã ãã§ååã§ãã
LevTAutomataImitationã¯ã©ã¹ã®ã€ã³ã¹ã¿ã³ã¹ã®äœæã¯ã W ã S ã Nã®ä»»æã®å€ã«å¯ŸããŠçãäžå®æéã§å®è¡ãããããšã«æ³šæããŠãã ããã ã¯ã©ã¹ã€ã³ã¹ã¿ã³ã¹ã«ã¯ã Wã®å€ãšå°ããªãµã€ãºã®è£å©å€æ°ã®ã¿ãæ ŒçŽãããŸãã
æååã®é åãããæå®ãããDamerau-Levenshteinè·é¢ãã2以å ã®è·é¢ã«ããæååã®ã¿ãéžæããã«ã¯ã次ã®ã³ãŒãã䜿çšã§ããŸãã
//Misspelled word string wordToSearch = "fulzy"; //Your dictionary string[] dictionaryAsArray = new string[] { "fuzzy", "fully", "funny", "fast"}; //Maximum Damerau-Levenstein distance const int editDistance = 2; //Constructing automaton LevTAutomataImitation automaton = new LevTAutomataImitation (wordToSearch, editDistance); //List of possible corrections IEnumerable<string> corrections = dictionaryAsArray.Where(str => automaton.AcceptWord(str));
äžããããã³ãŒãã¯ãã¬ãŒãã³ã·ã¥ã¿ã€ã³ãªãŒãããã³-ç¶²çŸ çæ€çŽ¢ã®ã¢ã«ãŽãªãºã ã䜿çšããŠãèŸæžã§æãåçŽãªãã¡ãžãŒæ€çŽ¢ã¢ã«ãŽãªãºã ãå®è£ ããŸãã ãã¡ãããããã¯æãå¹ççãªã¢ã«ãŽãªãºã ã§ã¯ãããŸããã ã¬ãŒãã³ã·ã¥ã¿ã€ã³ãªãŒãããã³ã䜿çšããããå¹ççãªæ€çŽ¢ã¢ã«ãŽãªãºã ã«ã€ããŠã¯ãèšäºã®åŸåã§èª¬æããŸã ã
åç §è³æ
- CïŒã®èšäºã®ãœãŒã¹
- ã¬ãŒãã³ã·ã¥ã¿ã€ã³è·é¢
- è·é¢Damerau-Levenshtein
- ã¹ããŒããã·ã³
- èŸæžãšããã¹ãã®ãããŸãæ€çŽ¢ã«é¢ããè¯ãæçš¿
- ã¬ãŒãã³ã·ã¥ã¿ã€ã³ãªãŒãããã³ã®ç°¡åãªèª¬æ
- Schultz and MihovïŒ2002ïŒã®èšäºã§ã®ã¬ãŒãã³ã·ã¥ã¿ã€ã³ãªãŒãããã³ã®è©³çŽ°ãªæ°åŠç説æ
- åããããã¯ã«é¢ããMikhovãšSchulzïŒ2004ïŒã®å¥ã®èšäº
- ãã¡ãžãŒæ€çŽ¢Luceneã§ã®ã¬ãŒãã³ã·ã¥ã¿ã€ã³ãªãŒãããã³ã®å®è£ ã®æŽå²
- Javaã§ã®å®è£ ïŒ 1ãš2
- ç§ã®åºçç©ã®ç¬¬äºéš