suwhs / wATLlib

standalone wATL library
22 stars 2 forks source link

Hyphenation patterns for other languages #8

Open ggarcial opened 1 year ago

ggarcial commented 1 year ago

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?

suwhs commented 1 year ago

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