[−][src]Crate galm
GalM
GalM is pattern matching library.
Inspired by Galmoji.
Quick start
Put the following in your project's Cargo.toml file:
[dependencies]
galm = "0.0.6"
And overwrite in your project's main.rs file:
// Get the matching rate. fn main() { // Initialize GalM Database instance. let galm: galm::Database = galm::new(); // Get characters similar to the passed in the argument. let distance: u8 = galm.get_distance("王", "玉"); assert_eq!(distance, 30); }
Corresponds to the following characters.
一右雨円王音下火花貝
学気九休玉金空月犬見
五口校左三山子四糸字
耳七車手十出女小上森
Example
Print the most similar string from the strings separated by commas.
# build
cargo build --example galm --release
# use galm
echo -e "皇様\n玉様\n大様" | ./target/release/examples/galm "王様"
# => 玉様
Install GalM Command
# install galm
cargo install galm --example galm
# using galm
echo -e "皇様\n玉様\n大様" | galm "王様"
# => 玉様
# => 皇様
# => 大様
Modules
search | search module for GalM. |
Structs
Character | Character |
Database | Database |
Functions
new | Initialize GalM Database instance. |
Type Definitions
Characters | Characters |