19 lines
707 B
Markdown
19 lines
707 B
Markdown
# Word Correction
|
|
## YinMo19
|
|
|
|
A simple word correction program written in rust, while it is from a c course extra homework problem.
|
|
It uses an algorithm to find the most similar word to the input word, which called Levenshtein distance.
|
|
The parse of the input file is the most thing in the program do.
|
|
The two big acceptance of the program is the levenshtein distance algorithm realization and the sort/binary_search of the word in dict.
|
|
|
|
You can just run
|
|
```bash
|
|
cargo build --release
|
|
time ./target/release/word_correction
|
|
```
|
|
to test. In MacBook Air M2, My test result is
|
|
```bash
|
|
> time ./target/release/word_correction
|
|
./target/release/word_correction 0.13s user 0.07s system 97% cpu 0.213 total
|
|
```
|