All Projects → greenlikeorange → Knayi Myscript

greenlikeorange / Knayi Myscript

Licence: mit
Myanmar Language Script Library

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Knayi Myscript

Unidump
hexdump(1) for Unicode data
Stars: ✭ 31 (-50.79%)
Mutual labels:  unicode
Open Relay
Free and open source fonts from Kreative Software
Stars: ✭ 48 (-23.81%)
Mutual labels:  unicode
Python Myanmar
Python library for Myanmar text processing
Stars: ✭ 53 (-15.87%)
Mutual labels:  unicode
Unicode 8.0.0
JavaScript-compatible Unicode data. Arrays of code points, arrays of symbols, and regular expressions for Unicode v8.0.0’s categories, scripts, blocks, bidi, and other properties.
Stars: ✭ 38 (-39.68%)
Mutual labels:  unicode
Unicode Confusable
Unicode::Confusable.confusable? "ℜսᖯʏ", "Ruby"
Stars: ✭ 47 (-25.4%)
Mutual labels:  unicode
Weird Json
A collection of strange encoded JSONs. For connoisseurs.
Stars: ✭ 53 (-15.87%)
Mutual labels:  unicode
Awesome Typography
✏︎ Curated list about digital typography 🔥
Stars: ✭ 947 (+1403.17%)
Mutual labels:  unicode
Sinais
🔣 Desenvolvimento passo a passo do exemplo `sinais` em Go.
Stars: ✭ 59 (-6.35%)
Mutual labels:  unicode
Font Awesome Php
A PHP library for Font Awesome 4.7.
Stars: ✭ 47 (-25.4%)
Mutual labels:  unicode
Mdetect
Stars: ✭ 54 (-14.29%)
Mutual labels:  unicode
Unicode Tr51
Emoji data extracted from Unicode Technical Report #51.
Stars: ✭ 38 (-39.68%)
Mutual labels:  unicode
Phobos
The standard library of the D programming language
Stars: ✭ 1,038 (+1547.62%)
Mutual labels:  unicode
Keytokey
Rust keyboard firmware library
Stars: ✭ 54 (-14.29%)
Mutual labels:  unicode
Unicode Bidirectional
A Javascript implementation of the Unicode 9.0.0 Bidirectional Algorithm
Stars: ✭ 35 (-44.44%)
Mutual labels:  unicode
Quran Data
Unicode-encoded Quran data
Stars: ✭ 54 (-14.29%)
Mutual labels:  unicode
Unicode 10.0.0
JavaScript-compatible Unicode data. Arrays of code points, arrays of symbols, and regular expressions for Unicode v10.0.0’s categories, scripts, blocks, bidi, and other properties.
Stars: ✭ 30 (-52.38%)
Mutual labels:  unicode
Sheenbidi
A sophisticated implementation of Unicode Bidirectional Algorithm
Stars: ✭ 52 (-17.46%)
Mutual labels:  unicode
Yawysiwygee
Yet another what-you-see-is-what-you-get equation editor
Stars: ✭ 60 (-4.76%)
Mutual labels:  unicode
Glyphhanger
Your web font utility belt. It can subset web fonts. It can find unicode-ranges for you automatically. It makes julienne fries.
Stars: ✭ 1,099 (+1644.44%)
Mutual labels:  unicode
Awesome Emoji Picker
Add-on/WebExtension that provides a modern emoji picker that you can use to find and copy/insert emoji into the active web page.
Stars: ✭ 54 (-14.29%)
Mutual labels:  unicode

Knayi Myanmar Script

NPM version

Standalone Myanmar languages js library, to build Myanmar Unicode standard web.

Announce on breaking API changes 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})

Node Version

  • Required node version >= 4
    Note: From version >=2.3.0 build step will only support for node >=6

Features

  • Detector (Unicode and Zawgyi) Detection now
  • Converter (Unicode and Zawgyi)
  • SyallBreak (Unicode and Zawgyi)
  • Spelling Check (Unicode and Zawgyi)
  • Truncate (Unicode and Zawgyi)
  • Normalization (Unicode only)

Installation

Using npm

npm install knayi-myscript --save

Using yarn

yarn add knayi-myscript

Using CDN

<script src="https://unpkg.com/[email protected]/dist/knayi-myscript.min.js"></script>

API

Method Name Arguments Return Note
fontDetect content: String(require),
fallbackFontType:, options fontName(options),
options: Object(options)
String Font Detector, it will detect unicode/zawgyi of the content Text. If nothing is matched or possibility are equal, it will return as 'zawgyi' or specified font type in fallbackFontType, options params.
fontConvert content: String(require),
targetFontType: fontName(require),
orignalFontType: fontName(optional)
String Converting font to target font type. This method need spelling fix, so it gonna use spellingFix in default. convertFrom will be detect by fontDetect when you don't described.
fontName must be one of unicode or zawgyi.
syllBreak content: String(require),
fontType: fontName(optional),
breakPoint: String(optional)
String To make systematic word break of Myanmar text. convertFrom will be detect by fontDetect when you don't described.
fontName must be one of unicode or zawgyi.
spellingFix content: String(require),
fontType: fontName(optional)
String convertFrom will be detect by fontDetect when you don't described. It fix spelling on Myanmar Text.
fontName must be one of unicode or zawgyi.
truncate content: String(require),
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
normalize content: String(require) String Normalization solve some typing errors. Unlike spellingFix, this offer more appropriate way of doing so. But this function can only solve some level of normalization.

Usage

// ES5 Way
var knayi = require('knayi-myscript')

// ES6 Way
import knayi from 'knayi-myscript'

Example

  • fontDetect(content [, fallbackFontType [, options]])
knayi.fontDetect('မဂၤလာပါ') // zawgyi
knayi.fontDetect('မင်္ဂလာပါ') // unicode
  • fontConvert(content, targetFontType [, orignalFontType])
knayi.fontConvert('မဂၤလာပါ', 'unicode', 'zawgyi') // မင်္ဂလာပါ
knayi.fontConvert('မဂၤလာပါ', 'unicode') // မင်္ဂလာပါ
  • syllBreak(content [, fontType [, breakWord]])
knayi.syllBreak('မင်္ဂလာပါ', null, '$$')
// output: 'မင်္ဂလာ$$ပါ'
knayi.syllBreak('မင်္ဂလာပါ')
// output: 'မင်္ဂလာ\u200bပါ'
  • spellingFix(content [, fontType])
knayi.spellingFix('မင်္ဂလာာပါါ') 
// output: 'မင်္ဂလာပါ'
  • truncate(content [, options])
knayi.truncate('အာယုဝဍ်ဎနဆေးညွှန်းစာကို ဇလွန်ဈေးဘေးဗာဒံပင်ထက် အဓိဋ္ဌာန်လျက် ဂဃနဏဖတ်ခဲ့သည်။', { length: 30, omission: '...' });
// output: "အာယုဝဍ်ဎနဆေးညွှန်းစာကို ဈေး..."

options of truncate

  • length: Number default is 30

  • omission:String default is '...'

  • fontType: String it automatically detect if it not specified

  • normalize(content)

knayi.normalize('မိြုင်မိြုင်\nဆိုင်ဆုိင်')
// output: မြိုင်မြိုင်\nဆိုင်ဆိုင်

Using googlei18n/myanmartools in detector.js

In default, knayi use own logic font dector rules, but you can choose knayi to use googlei18n/myanmartoolsTo do that, setuse_myanmartoolsoption to true. By defaultuse_myanmartoolsoption is set tofalse`.

Example::

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

Debugging of font converting

Visit http://tools.kny.co/knayi-myscript#debug-mode and select text to track how converting happened in background.

Build

  • Required node >=6
  • npm run build
    To build production run webpack -p

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].