Skip to content

Using googlei18n/myanmartools in detector.js

Compare
Choose a tag to compare
@greenlikeorange greenlikeorange released this 26 Mar 19:59
· 101 commits to master since this release

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]
})