Skip to content

DataPoint-Armenia/vortan_spellcheck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vortan_spellcheck

About

MVP spellcheck implementation

Documentation

Prereqs

Installation

  1. Clone the repo
git clone [email protected]:DataPoint-Armenia/vortan_spellcheck.git
  1. Install requirements
pip3 install -r requirements.txt

Usage

As a module

from spellcheck import spellchecker

sp = spellchecker(
    max_dictionary_edit_distance = 2,
    prefix_length = 7,
    unigram_freq_file = "uni.txt"
    bigram_freq_file = "bi.txt"
)

for s in sp.suggest("տպրոց"):
    print(s)

Spellcheck demo

# unigram
➜ python3 demo/demo.py data/uni_freq.txt
Initializing spellchecker...
Բարեւ
> տպրոց
դպրոց, 1, 1

# bigram
➜ python3 demo/demo.py data/uni_freq.txt data/bi_freq.tx
Initializing spellchecker...
Բարեւ
> Քնացի տպրոց՝ ուղագրություն սուորելու:  
գնացի դպրոց ուշադրություն սովորելու, 7, 0

Symspell pickle creation

python3 src/pickle_dict.py data/uni_freq.txt data/bi_freq.txt data/symspell_dict.pickle

Dictionary creation

python3 src/create_dict.py data/words.txt > data/freq.txt

Contributors

Acknowledgements

About

Armenian spellchecker.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages