thesaurus-rs
The offline thesaurus library for Rust that can use both wordnet and moby backends.
Add to Cargo.toml for wordnet:
= "0.5"
Add to Cargo.toml for moby (wordnet is on by default):
= { = "0.5", = ["moby"], = false }
Backend Comparison
| Name | Simple Example Binary Size | Simple Example Binary Size (Stripped) | Available Words | Average Number of Synonyms | Compressed Dictionary Size | License |
|---|---|---|---|---|---|---|
| Moby | 15M | 11M | 30159 | 83.287 | 11M | US Public Domain |
| Wordnet | 6.9M | 3.4M | 125701 | 3.394 | 2.9M | Wordnet License |
Basic Example
use ;
Wordnet Output
$ cargo r -rq --example simple -- good
wordnet has 125701 words indexed, and 107 synonyms for "good"...
synonyms...
skilled
skilful
practiced
skillful
expert
adept
proficient
sainted
...
Moby Output
$ cargo r -rq --example simple --no-default-features --features=moby -- good
moby has 30195 words indexed, and 666 synonyms for "good"...
synonyms...
christian
christlike
christly
daedalian
god-fearing
ok
roger
sunday
able to pay
absolutely
acceptable
...
Both
$ cargo r -rq --example simple --features=moby,wordnet -- good
both wordnet and moby have 132592 words indexed, and 773 synonyms for "good"...
synonyms...
christian
christlike
christly
daedalian
god-fearing
ok
roger
sunday
able to pay
absolutely
...