Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am looking for a way to automatically insert soft hyphens (­ or unicode character) to hyphenate words into HTML document from command line.

1) What is best way to do so from command line?

2) What are options where it comes to using different dictionaries/rules to word hyphenation? Are there rules for languages other than English?

I am aware that some software, including LibreOffice like decribed in Automatic hyphenation software, have option to apply hyphenation to document, but I am looking for way to do so in already existing HTML document without using word processing software.

share|improve this question

1 Answer 1

If what you are looking for is to simply replace - with ­, you could just use sed:

sed -i 's/-/\­/g' file.html

The command above will edit file.html and make the replacement you want.

Your other question is not on topic here so I won't go into any depth but yes, different languages often have different hyphenation rules.

share|improve this answer
    
Thanks, but question was about using command line tool that will detect hyphenation points and insert them, not simply replacing hyphens to soft hyphens. –  Rafal Apr 10 at 10:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.