LipikaEngine is a multi-codepoint, user-configurable, phonetic, Transliteration Engine with built-in support for the Bengali, Devanagari, Gujarati, Gurmukhi, Hindi, Kannada, Malayalam, Oriya, Tamil and Telugu scripts, as well as the ISO-15919 romanisation scheme and IPA. It includes support for ITRANS, Baraha, Harvard Kyoto, Barahavat and Ksharanam transliteration schemes.
Copyright (C) 2017 Ranganath Atreya
This program is free software: you can redistribute it and/or modify it under the terms of the GNU
General Public License as published by the Free Software Foundation; either version 3 of the License,
or (at your option) any later version.
This program comes with ABSOLUTELY NO WARRANTY; see LICENSE file.
Refer to the full Jazzy generated documentation here.
All supported Tranliteration schemes are documented here
LipikaEngine compiles into two separate distributables - iOS and macOS frameworks. It exposes functionality to tranliterate from different schemes to many Indic languages. It also has the ability to reverse transliterate from various Indic languages to schemes. As such, the two functionalities can be used to also transliterate from any supported language to any other supported language. In order to use LipikaEngine, you need to do the following:
- Optionally, provide your own configuration by overriding the
Config
class. See LipikaConfig in LipikaIME as an example of how to override and leverageUserDefaults
to provide user configurable options.
class LipikaConfig: Config {
// Override any of the functions that you deem necessary
}
- Initialize
Transliterator
andAnteliterator
as needed.
- Option #1: use a built-in scheme and script
let factory = try! LiteratorFactory(config: MyConfig())
let transliterator = try! factory.transliterator(schemeName: "Barahavat", scriptName: "Kannada")
let anteliterator = try! factory.anteliterator(schemeName: "Barahavat", scriptName: "Kannada")
- Option #2: use a custom scheme based on SCM format. In this option, you have to override
customMappingDirectory
variable ofConfig
and specify the path at which to look for the custom scheme files.
let factory = try! LiteratorFactory(config: MyConfig())
let transliterator = try! factory.transliterator(customMapping: "MyOwnCustomSCM")
let anteliterator = try! factory.anteliterator(customMapping: "MyOwnCustomSCM")
- Option #3: get the built-in mappings, modify them and use them
let factory = try! LiteratorFactory(config: MyConfig())
let mappings = factory.mappings("Barahavat", scriptName: "Kannada")
// Modify mappings as you see fit
let transliterator = try! factory.transliterator(schemeName: "Barahavat", scriptName: "Kannada", mappings: mappings)
let anteliterator = try! factory.anteliterator(schemeName: "Barahavat", scriptName: "Kannada", mappings: mappings)
- Transliterate any string of alpha-numeric characters.
let result: Literated = transliterator.transliterate("aatreya")
// result.finalaizedOutput + result.unfinalaizedOutput will have the transliterated string
- Anteliterate any unicode string in supported language into any supported scheme.
let result: String = anteliterator.anteliterate("आत्रेय")
// result will have the alpha-numeric characters in the chosen scheme