Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Fast and Accurate SpellChecker

Project description

symspell_rust

Rust python bindings for symspell

Usage

pip install symspell_rust

Quick examples using Python:

>>> from symspell_rust import SymspellPy

>>> sym_spell = SymspellPy(max_distance=2, prefix_length=7, count_threshold=1)

>>> if not sym_spell.load_dictionary("./data/frequency_dictionary_en_82_765.txt",0,1," "):
      print("File Not Found")

>>> suggestions = sym_spell.lookup_compound("whereis th elove hehad dated forImuch of thepast who couqdn'tread in sixtgrade and ins pired him",2)

>>> for cand in suggestions:
      print(f"Term->{cand.term} \n Distance->{cand.distance} \n Count->{cand.count}")

>>> segment_obj = sym_spell.word_segmentation("whereisthelove",2)

>>> print(f"String->{segment_obj.segmented_string} \n Distance->{segment_obj.distance_sum} \n Prob_Log_Sum->{segment_obj.prob_log_sum}")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for symspell-rust, version 0.3.0
Filename, size File type Python version Upload date Hashes
Filename, size symspell_rust-0.3.0-cp39-cp39-win_amd64.whl (150.3 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size symspell_rust-0.3.0.tar.gz (3.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page