My favorites | Sign in
Logo
                
Search
for
Updated Nov 02, 2009 by math...@mnn.ch
en_AddNewLanguage  
How to add support for further languages

Adding further languages - about the pattern files

What we have now

Currently, there's support for

But Hyphenator is written in a manner that makes it easy to add support for other languages.

What you can do

To add a further language, a language pattern file is needed. If you have a (complete) list of hyphenated words you may be able to compute patterns by your own (if you can, you know how). If not, go to http://www.ctan.org and search the LaTeX hyphenation patterns for your language (be aware of the license!)

Next steps you will have to do:

  1. to convert the patterns
  2. to build a pattern file
  3. to change code in Hyphenator.js
  4. send-in changings and patterns if you feel like (I'll take you as a supporter for this language, you'll get full attribution)

Converting the patterns

Version >1.2.0

Version <1.0.2

Name Description
Hyphenator.leftmin On the old line, there shall remain this number of letters at minimum (preventing e.g. ' a-')
Hyphenator.rightmin This number of letters at minimum are on the newline (preventing e.g. '-a ')
Hyphenator.shortestPattern The sortest pattern in the list (for better performance). Do not count the numbers! E.g. the pattern _ab3s2 has a length of four (4).
Hyphenator.longestPattern The longest pattern in the list (for better performance). Do not count the numbers! E.g. the pattern _ab3s2 has a length of four (4).
Hyphenator.specialChars Non-ASCII-letters used in this language.

adapt code in Hyphenator

There is one thing you HAVE to change and one thing you SHOULD change in Hyphenator.js:

Make some tests to see, if it works!

send in changings and patterns

If you like to support Hyphenator, you may send in the work you've done. You'll get full attribution. I will ask you to put your Mail in the header of the pattern file (see nl.js for example).


Comment by mjning, Aug 16, 2009

ađfầ

Comment by petrosyan, Aug 24, 2009

Hungarian - comming soon (thanks to Péter Nagy)

comming -> coming

Comment by math...@mnn.ch, Aug 25, 2009

Thanks


Sign in to add a comment
Hosted by Google Code