webster

Crates.iowebster
lib.rswebster
version0.3.0
sourcesrc
created_at2021-05-27 19:30:33.65324
updated_at2021-06-01 17:04:13.941601
descriptionAn offline version of webster's dictionary
homepage
repositoryhttps://github.com/grantshandy/webster-rs
max_upload_size
id402840
size8,987,185
Grant Handy (grantshandy)

documentation

https://docs.rs/webster

README

webster-rs

A Rust library containing an offline version of webster's dictionary.

Add to Cargo.toml

webster = 0.3.0

Simple example:

fn main() {
    let word = "silence";

    let definition = webster::dictionary(word).unwrap();

    println!("{} definition: {}", word, definition);
}

The definitions are not great but they'll do for simple projects if you need an open source local dictionary API.

This library uses the dictionary.json file from adambom's dictionary adapted from Webster's Unabridged English Dictionary.

Runtime Decompression

In an effort to reduce binary size (naive storage weighs 9mb), the dictionary is stored in a compressed binary format in the executable (4mb) and then decompressed upon runtime access. The runtime container provides O(log n) access complexity and access time (anecdotally) faster than a BTreeMap.

License

The works in this repository are licensed under the MIT License, with the exception of the contents of dictionary.json, which are licensed under the terms of the Project Gutenberg License:

From Project Gutenberg:

This eBook is for the use of anyone anywhere at no cost and with almost no restrictions whatsoever. You may copy it, give it away or re-use it under the terms of the Project Gutenberg License included with this eBook or online at www.gutenberg.net

Commit count: 18

cargo fmt