/akara-android

The AKARA (អក្ខារា) project aims to give developers the power to easily add multi-language word suggestions support to their applications. AKARA Android brings this goal to life for Android developers.

Primary LanguageKotlinMIT LicenseMIT

AKARA Android - Multi-Language Word Suggestions Toolkit for Android

The AKARA (អក្ខារា) project aims to give developers the power to easily add multi-language word suggestions support to their applications. AKARA Android brings this goal to life for Android developers.

Language Support

  • Khmer
  • English

Word Suggestions Approach

Installing

Step 1. Add the JitPack repository to your build file

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Step 2. Add the dependency

dependencies {
    implementation 'com.github.Socret360:akara-android:Tag'
}

Step 3. Use the package

class MainActivity : AppCompatActivity() {
    lateinit var akara: Akara

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        akara = Akara(this)

        val sentence = "ឯងនេះមួយយប់ៗដេកខ្វល់រឿងអនាគតមិនដឹងធ្វើអីចិញ្ចឹមខ្លួនមួយនេះរស់"

        akara.suggest(input, object: OnSuggestionListener {
            override fun onCompleted(
                suggestionType: SuggestionType?,
                suggestions: List<String>,
                sequences: List<Sequence>,
                words: List<String>
            ) {
                Log.d(TAG, "input: $input")
                Log.d(TAG, "sequences: $sequences")
                Log.d(TAG, "words: $words")
                Log.d(TAG, "suggestions: ${suggestions.take(3)}")
                Log.d(TAG, "suggestion_type: $suggestionType")
                Log.d(TAG, "======")
            }

            override fun onError() {
                Log.d(TAG, "$input: Cannot provide suggestions")
            }
        })
    }
}

Credits

Sequence Breaker:

WordBreaker:

Auto Completion

Spell Checker / Corrections

Next Word Suggestions

  • Khmer: Deep Learning (LSTM) trained by @ssokhavirith.
  • English: N/A

Want to Help?

Code contributions are welcome for this project and other AKARA related projects.

Project Status URL
akara-android Active https://github.com/Socret360/akara-android
akara-ios Active https://github.com/Socret360/akara-ios
akara-python Active https://github.com/Socret360/akara-python
akara-web TBC
akara-flutter TBC

Road Maps

  • Next Word Suggestion for English
  • Personalize Suggestions based on NGram
  • Support for Other Languages. (Planing for Thai and Chinese)

License

The MIT License (MIT)

Copyright (c) 2015 SIL NRSI

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.