Skip to content

This is an Android project that adds Thai word breaking functionality to Android's TextView.

Notifications You must be signed in to change notification settings

heartnetkung/Thai-Line-Breaker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

Thai-Line-Breaker

This is an Android project that adds Thai word breaking functionality to Android's TextView. Some of its features includes:

  • processing speed with cached dictionary
  • aesthetical modification to dictionary and algorithm customized only for line breaking
  • auto disabling when ellipsis is applied

Here is the .apk demo

Installation

//TODO let Boom write this

Usage

The only class that you'd use is ThaiLineBreakingTextView which extends from TextView. It adds 2 additional methods:

  • public void setText2(int/CharSequence) which should be used in replace of setText to process line break and then setText
  • public CharSequence getText2() which would return the text you've set using setText2

Note: that the use of setText and getText by user should be avoided.

Tips: You can also layout this class is xml as follow <hnk.lib.tlb.ThaiLineBreakingTextView android:id="@+id/result"/>

Preprocessing

The preprocessing of the dictionary and the dictionary caching is done in another project here. In this project, we only use the cached dict in file res/raw/trie_cache.txt and res/raw/whole_word_cache.txt

About

This is an Android project that adds Thai word breaking functionality to Android's TextView.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages