vincent-paing / Rabbkt

Efficient ZG<=> Unicode converter using rules from Rabbit
Do What The F*ck You Want To Public License
6 stars 1 forks source link

Download Build Status

Rabbkt

Rabbkt is a Kotlin implemenation of Rabbit using HashMap as rules instead of parsing json for faster processing. It also allows the user to change the rule easily by providing a generic impelemenation of Rule-Based conversion.

Usage

If you use gradle, then include

repositories {
    jcenter()
}

compile 'com.aungkyawpaing.rabbkt:rabbkt:1.0.1'

Conversion

For Zawgyi to Unicode, use

RabbktConverter.zawgyiToUnicode(zawgyiString)

For Unicode to Zawgyi, use

RabbktConverter.unicodeToZawgyi(unicodeString)

Custom Rule

Create an instance of RuleBasedStringConverter by providing a map of Regex and String through its constructor

And then call the convert function with your own instance

val myRuleBaseConverter = RuleBasedStringConverter(myRules)
myRuleBaseConverter.convert(yourString)

Credit

License

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
                   Version 2, December 2004

Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

           DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
  TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

 0. You just DO WHAT THE FUCK YOU WANT TO.