Skip to content

Releases: greenlikeorange/knayi-myscript

Added Normalization (Unicode only)

22 Nov 17:26
Compare
Choose a tag to compare

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

24 Aug 11:24
Compare
Choose a tag to compare

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 30
  • omission:String default is '...'
  • fontType: String it automatically detect if it not specified

Fixing converting rules

04 Apr 23:16
Compare
Choose a tag to compare

Changes Note

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

05 Apr 01:11
Compare
Choose a tag to compare
2.4.2

Using googlei18n/myanmartools in detector.js

26 Mar 19:59
Compare
Choose a tag to compare

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

26 Mar 09:29
Compare
Choose a tag to compare

Build step will not support node version 4 anymore.

Add commonjs target build for react apps

26 Mar 09:28
Compare
Choose a tag to compare

Add commonjs target build script dist/knayi-myscript.es.js for using library on react apps, and also build scripts for production level