Giter VIP home page Giter VIP logo

knayi-myscript's Introduction

Knayi Myanmar Script

NPM version

Standalone Myanmar languages JavaScript library, use to build Myanmar Unicode standard easily.

Node Version

  • Required node version >= 4

Features

  • Detector (Unicode and Zawgyi)
  • Converter (Unicode and Zawgyi)
  • SyallBreak (Unicode and Zawgyi)
  • Spelling Check (Unicode and Zawgyi)

Installation

Using npm

npm install knayi-myscript --save

Using yran

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) 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 defaultFont params.
fontConvert content: String(require),
convertTo: fontName(require),
convertFrom: 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.

Usage

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

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

Example

  • fontDetect(content, [defaultFont])
knayi.fontDetect('မဂၤလာပါ') // zawgyi
knayi.fontDetect('မင်္ဂလာပါ') // unicode
  • fontConvert(content, convertTo, [convertFrom])
knayi.fontConvert('မဂၤလာပါ', 'unicode', 'zawgyi') // မင်္ဂလာပါ
knayi.fontConvert('မဂၤလာပါ', 'unicode') // မင်္ဂလာပါ
  • syllBreak(content, [fontType] [,breakPoint])
knayi.syllBreak('မင်္ဂလာပါ', null, '$$') // 'မင်္ဂလာ$$ပါ'
  • spellingFix(content, [fontType])
knayi.spellingFix('မင်္ဂလာာပါါ') // 'မင်္ဂလာပါ'

Todo

  • Contributing guide
  • Version release note

License

MIT

knayi-myscript's People

Contributors

aungmyokyaw avatar gitter-badger avatar greenlikeorange avatar lwinkyawmyat avatar mapmeld avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.