GalM is pattern matching library.
Inspired by Galmoji.
We may not be able to clearly recall proper names.
Look at the character below.
text
毎 垂 無
All the letters have a similar shape.
However, the character on the left means "Every", the center means "Hang Down" and the character on the right means "Unknown" in Japanese.
In this way, the meanings of letters that look alike can be very different. It's very complicated, don't you think?
GalM helps correct these discrepancies.
Put the following in your project's Cargo.toml file:
toml
[dependencies]
galm = "0.0.14"
And overwrite in your project's main.rs file:
```rust // Get the matching rate. fn main() {
// Initialize GalM Database instance.
let galm: galm::Database = galm::new();
// Get the matching rate of character.
let distance: u8 = galm.get_distance("王", "玉");
assert_eq!(distance, 30);
} ```
Corresponds to the following characters.
text
一å³é›¨å††çŽ‹éŸ³ä¸‹ç«èŠ±è²å¦æ°—ä¹ä¼‘玉金空月犬見五å£æ ¡å·¦ä¸‰å±±å四糸å—耳七車手å出女å°ä¸Šæ£®äººæ°´æ£ç”Ÿé’夕石赤åƒå·
先早è‰è¶³æ‘大男竹ä¸è™«ç”ºå¤©ç”°åœŸäºŒæ—¥å…¥å¹´ç™½å…«ç™¾æ–‡æœ¨æœ¬å目立力林å…引羽雲園é 何科å¤å®¶æŒç”»å›žä¼šæµ·çµµå¤–角楽活間
丸岩顔汽記帰弓牛éšäº¬å¼·æ•™è¿‘兄形計元言原戸å¤åˆå¾Œèªžå·¥å…¬åºƒäº¤å…‰è€ƒè¡Œé«˜é»„åˆè°·å›½é»’今æ‰ç´°ä½œç®—æ¢å¸‚矢姉æ€ç´™å¯ºè‡ª
æ™‚å®¤ç¤¾å¼±é¦–ç§‹é€±æ˜¥æ›¸å°‘å ´è‰²é£Ÿå¿ƒæ–°è¦ªå›³æ•°è¥¿å£°æ˜Ÿæ™´åˆ‡é›ªèˆ¹ç·šå‰çµ„走多太体å°åœ°æ± 知茶昼長鳥æœç›´é€šå¼Ÿåº—点電刀冬当
æ±ç”é åŒé“èªå†…å—肉馬売買麦åŠç•ªçˆ¶é¢¨åˆ†èžç±³æ©æ¯æ–¹åŒ—毎妹万明鳴毛門夜野å‹ç”¨æ›œæ¥é‡Œç†è©±æ‚ªå®‰æš—医委æ„育員院飲
é‹æ³³é§…央横屋温化è·ç•Œé–‹éšŽå¯’感漢館岸起期客究急級宮çƒåŽ»æ©‹æ¥æ›²å±€éŠ€åŒºè‹¦å…·å›ä¿‚è»½è¡€æ±ºç ”çœŒåº«æ¹–å‘幸港å·æ ¹ç¥çš¿
仕æ»ä½¿å§‹æŒ‡æ¯è©©æ¬¡äº‹æŒå¼å®Ÿå†™è€…主守å–é…’å—州拾終習集ä½é‡å®¿æ‰€æš‘助æ˜æ¶ˆå•†ç« å‹ä¹—æ¤ç”³èº«ç¥žçœŸæ·±é€²ä¸–整昔全相é€æƒ³
æ¯é€Ÿæ—他打対待代第題ç‚çŸè«‡ç€æ³¨æŸ±ä¸å¸³èª¿è¿½å®šåºç¬›é‰„転都度投豆島湯登ç‰å‹•ç«¥è¾²æ³¢é…å€ç®±ç•‘発åå‚æ¿çš®æ‚²ç¾Žé¼»ç†
氷表秒病å“è² éƒ¨æœç¦ç‰©å¹³è¿”勉放味命é¢å•å½¹è–¬ç”±æ²¹æœ‰éŠäºˆç¾Šæ´‹è‘‰é™½æ§˜è½æµæ—…両緑礼列練路和愛案以衣ä½å›²èƒƒå°è‹±æ „
å¡©å„„åŠ æžœè²¨èª²èŠ½æ”¹æ¢°å®³è¡—å„覚完官管関観願希å£ç´€å–œæ——器機è°æ±‚泣救給挙æ¼å…±å”é¡ç«¶æ¥µè¨“è»éƒ¡å¾„åž‹æ™¯èŠ¸æ¬ çµå»ºå¥é¨“
固功好候航康告差èœæœ€æ昨æœåˆ·æ®ºå¯Ÿå‚産散残士æ°å²å¸è©¦å…治辞失借種周ç¥é †åˆæ¾ç¬‘唱焼象照賞臣信æˆçœæ¸…é™å¸ç©
折節説浅戦é¸ç„¶äº‰å€‰å·£æŸå´ç¶šå’å«å¸¯éšŠé”å˜ç½®ä»²è²¯å…†è…¸ä½Žåº•åœçš„å…¸ä¼å¾’努ç¯å ‚åƒç‰¹å¾—毒熱念敗梅åšé£¯é£›è²»å¿…票標ä¸
夫付府副粉兵別辺変便包法望牧末満未脈民無約勇è¦é¤Šæµ´åˆ©é™¸è‰¯æ–™é‡è¼ªé¡žä»¤å†·ä¾‹æ´é€£è€åŠ´éŒ²åœ§ç§»å› 永営衛易益液演
応往桜æ©å¯ä»®ä¾¡æ²³éŽè³€å¿«è§£æ ¼ç¢ºé¡åˆŠå¹¹æ…£çœ¼åŸºå¯„è¦æŠ€ç¾©é€†ä¹…旧居許境å‡ç¦å¥ç¾¤çµŒæ½”件券険検é™ç¾æ¸›æ•…個è·åŠ¹åŽšè€•é‰±
構興講混査å†ç½å¦»æŽ¡éš›åœ¨è²¡ç½ªé›‘酸賛支志æžå¸«è³‡é£¼ç¤ºä¼¼è˜è³ªèˆŽè¬æŽˆä¿®è¿°è¡“準åºæ‹›æ‰¿è¨¼æ¡çŠ¶å¸¸æƒ…ç¹”è·åˆ¶æ€§æ”¿å‹¢ç²¾è£½ç¨Ž
責績接è¨èˆŒçµ¶éŠç¥–ç´ ç·é€ åƒå¢—則測属率æ退貸態団æ–築張æ程é©æ•µçµ±éŠ…å°Žå¾³ç‹¬ä»»ç‡ƒèƒ½ç ´çŠ¯åˆ¤ç‰ˆæ¯”è‚¥éžå‚™ä¿µè©•è²§å¸ƒå©¦
富æ¦å¾©è¤‡ä»ç·¨å¼ä¿å¢“å ±è±Šé˜²è²¿æš´å‹™å¤¢è¿·ç¶¿è¼¸ä½™é å®¹ç•¥ç•™é ˜ç•°éºåŸŸå®‡æ˜ 延沿我ç°æ‹¡é©é–£å‰²æ ªå¹²å·»çœ‹ç°¡å±æœºæ®è²´ç–‘å¸ä¾›
胸郷勤ç‹ç³»æ•¬è¦åŠ‡æ¿€ç©´çµ¹æ¨©æ†²æºåŽ³å·±å‘¼èª¤åŽå皇紅é™é‹¼åˆ»ç©€éª¨å›°ç ‚座済è£ç–冊蚕至ç§å§¿è¦–詞誌ç£å°„æ¨å°ºè‹¥æ¨¹åŽå®—å°±
衆従縦縮熟純処署諸除将傷障城蒸é‡ä»åž‚推寸盛è–èª å®£å°‚æ³‰æ´—æŸ“å–„å¥çª“創装層æ“蔵臓å˜å°Šå®…æ‹…æŽ¢èª•æ®µæš–å€¤å®™å¿ è‘—åº
é ‚æ½®è³ƒç—›å±•è¨Žå…šç³–å±Šé›£ä¹³èªç´è„³æ´¾æ‹èƒŒè‚ºä¿³ç晩å¦æ‰¹ç§˜è…¹å¥®ä¸¦é™›é–‰ç‰‡è£œæš®å®è¨ªäº¡å¿˜æ£’枚幕密盟模訳郵優幼欲翌乱åµ
覧è£å¾‹è‡¨æœ—è«–
Print the most similar string from the strings separated by newline.
```bash
cargo build --example galm --release
echo -e "皇様\n玉様\n大様" | ./target/release/examples/galm "王様"
```
```bash
cargo install galm --example galm
echo -e "皇様\n玉様\n大様" | galm "王様"
```
```bash
cargo uninstall galm ```