wATLlib icon indicating copy to clipboard operation
wATLlib copied to clipboard

Hyphenation patterns for other languages

Open ggarcial opened this issue 1 year ago • 1 comments

Hi, I am using your library in order to present justified text in Android platform. The Text looks correctly hyphenated in English, Russian, Portuguese and French but I also need hyphenation in other languages like Spanish and German. How can I get the pattern files (.dat files) for those languages?

ggarcial avatar Apr 18 '23 15:04 ggarcial

hello, existing .dat was build from from dead js project, try to look at https://github.com/bramstein/hyphenation-patterns/tree/master/patterns - same format.

AFAIK, i took https://github.com/mathew-kurian/TextJustify-Android/blob/master/library/src/main/java/com/bluejamesbond/text/hyphen/DefaultHyphenator.java

and create serialize function https://github.com/suwhs/wATL/blob/master/syllabification/src/main/java/su/whs/hyphens/HyphenPattern.java

i.e. steps:

  1. manual build in java map with rules (copypaste from js)
  2. execute serialization
  3. take result *.dat files

suwhs avatar Apr 20 '23 08:04 suwhs