1.0.1 • Published 3 years ago
transit-char-service v1.0.1
Transit char service
Installation
npm i transit-char-service
Usage
This javascript package returns combination all words with all kinds of similar english chars.
For examle: in word "Хай" char "Х" can be "X" in english and char "а" can be similar char "a" in english.
This package has two main methods detect()
method (which returns array of objects [ { char: 'С', index: 0 } ]
) and getCorrectedText(text, dictionary)
method (which returns corrected text).
You can use RU and ENG dictionaries for finding incorrect chars.
Example
let service = new CharService()
let dictionaries = new DictionaryLanguages()
//for finding english chars at russian text
let detectEngCharsDictionary = dictionaries.ENG
service.setDictionary(detectEngCharsDictionary)
service.setText('Xай')
let detected = service.detect()
let correctedText = service.getCorrectedText()