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...
acceptable
adept
advantageous
ample
angelic
angelical
bang-up
beatific
beneficial
beneficial
best
...
Moby Output
$ cargo r -rq --example simple --no-default-features --features=moby -- good
moby has 30195 words indexed, and 666 synonyms for "good"...
synonyms...
able to pay
absolutely
acceptable
accomplished
according to hoyle
ace
actual
adept
adequate
admirable
admissible
adroit
advantage
advantageous
...
Both
$ cargo r -rq --example simple --features=moby,wordnet -- good
both wordnet and moby have 132592 words indexed, and 773 synonyms for "good"...
synonyms...
able to pay
absolutely
acceptable
acceptable
accomplished
according to hoyle
ace
actual
adept
adept
adequate
admirable
admissible
adroit
advantage
advantageous
advantageous
advisable
affable
affectionate
agreeable
all right
all-knowing
all-powerful
...