3

I've got a (Russian) text that I need to hyphenate programmatically to be displayed in browser (i.e. use a script of some kind to put ­ where appropriate).

I know about hyphenator.js, but, since all my content is already generated off-line, I'd like to do the hyphenation off-line as well. That is, I'd like my text not to be hyphenated in browser, but generated into a static HTML file already with soft hyphens.

A (Linux) command-line tool or a C library would be OK. Even some Python code will do.

Any clues? Maybe I can use TeX to do the job for me somehow?

Alexander Gladysh
  • 39,865
  • 32
  • 103
  • 160
  • Well, I _could_ use SpiderMonkey to make a CLI utility from hyphenate.js (as is done here: http://stackoverflow.com/a/9850795/6236)... But I'd like a more straightforward solution. – Alexander Gladysh Oct 15 '13 at 15:57
  • A good question, but hyphenator.js works offline, too – if you just download the code. – Jukka K. Korpela Oct 15 '13 at 16:01
  • @JukkaK.Korpela, please elaborate. Note that I need to do hyphenation programmatically — i.e. via script. I should not have to copy-paste stuff by hand in browser. I clarified the question text. – Alexander Gladysh Oct 15 '13 at 16:02
  • If you download hyphenator.js and place it somewhere relative to your HTML files, you can just insert a simple ` – Jukka K. Korpela Oct 15 '13 at 16:07
  • Well, thanks, but I'd like to generate a static HTML file with the hyphenation in-place, without the need to run JavaScript on the client. – Alexander Gladysh Oct 15 '13 at 17:28
  • Then you should clarify that in the question. Doing something offline does not mean the production of a static file. (And in practical terms, doing it statically is clumsier. You would need to run the hyphenator tool after each change to the master document.) – Jukka K. Korpela Oct 15 '13 at 17:47
  • All content is already generated, so it is not clumsier. – Alexander Gladysh Oct 15 '13 at 18:24

0 Answers0