Releases: greenlikeorange/knayi-myscript
Releases · greenlikeorange/knayi-myscript
Added Normalization (Unicode only)
Text normalization for Burmese language no support on knayi. It guaranteed Burmese text to be a single canonical form.
API
Method Name | Arguments | Return | Note |
---|---|---|---|
normalize |
content: String(requre) |
String |
Normzliation solve some typing errors. Unlike spellingFix this offer more appropriate way of doing so. But this function can only solve some level of normalization. |
normalize(content)
knayi.normalize('မိြုင်မိြုင်\nဆိုင်ဆုိင်')
// output: မြိုင်မြိုင်\nဆိုင်ဆိုင်
Bugs fix and add new truncate function
Changes Note
- Some Unicode to Zawgyi converting rules are add/updated.
- Add truncate function
API
Method Name | Arguments | Return | Note |
---|---|---|---|
truncate |
content: String(requre) ,options: Object |
String |
Like lodash.truncate, it truncate word syllable and space. Default truncate length is 30 and you can change it in options.length |
- truncate(content [, options])
knayi.truncate('အာယုဝဍ်ဎနဆေးညွှန်းစာကို ဇလွန်ဈေးဘေးဗာဒံပင်ထက် အဓိဋ္ဌာန်လျက် ဂဃနဏဖတ်ခဲ့သည်။', { length: 30, omission: '...' });
// "အာယုဝဍ်ဎနဆေးညွှန်းစာကို ဈေး..."
options of truncate
length: Number
default is 30omission:String
default is '...'fontType: String
it automatically detect if it not specified
Fixing converting rules
Changes Note
- Some Unicode to Zawgyi converting rules are add/updated.
- Create globalOption option and silent_mode.
- Create character code debugging in webpage, go check at http://tools.kny.co/knayi-myscript#debug_mode.
Announce on breaking API changes on Error Throw from 2.4.2 -> 2.5.0
- All throw Error are now become console.warn and console.error
- If content not found happens, #fontConvert, #spellingCheck, #syllBreak all return empty string
- If content not found happens, #fontDetect return fallback_font_type or 'en'
- You can set silent by setting
knayi.setGlobalOptions({silent_mode: true})
v2.4.2
2.4.2
Using googlei18n/myanmartools in detector.js
Now you can now use googlei18n/myanmartools
library in detector.
By default use_myanmartools
options is set to false
.
// Add options for single process
knayi.fontDetect('မဂၤလာပါ', null, {use_myanmartools: true}) // this will use myanmartools
knayi.fontDetect('မင်္ဂလာပါ') // this will use default
// OR set for whole project
knayi.setGlobalOptions({
detector: {
use_myanmartools: true
}
})
You can also set Probability threshold percentages of zawgyi predicting by
myanmartools_zg_threshold
as [lower, higher]
. Which mean if predicting
result of myanmartools is < 0.05 detector.js assume as unicode or > 0.95
it assume as zawgyi.
knayi.fontDetect('မင်္ဂလာပါ', null, {
use_myanmartools: true,
myanmartools_zg_threshold: [0.05, 0.95]
})
Build step node version support update to >=6
Build step will not support node version 4 anymore.
Add commonjs target build for react apps
Add commonjs target build script dist/knayi-myscript.es.js for using library on react apps, and also build scripts for production level