Skip to content

inc0/python-rustvocab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-rustvocab

Vocabulary preprocessing functions written in Rust for Python.

Building

On MacOS:

cargo rustc --release -- -C link-arg=-undefined -C link-arg=dynamic_lookup
mv target/release/libvocab.dynlib target/release/libvocab.d
cp target/release/libvocab.d <python code dir>
cd <python code dir>
python -c "import vocab"

Usage

  • vocab.count_words - count words from list of lists and return n most common words
import vocab
a = [["foo", "bar"], ["bar", "bas"], ["bar", "foo"]]
vocab.count_words(a)  # [('bar', 3), ('foo', 2)]

About

Vocabulary preprocessing functions written in Rust for Python.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages