I'm looking for a sample project that will perform hyphenation of text in C#. Ideally, this would be derived from the TeX hyphenation algorithm, or similar. I'm interested in English currently, although other languages may be required in the future. Anyone seen something like that? background I'm planning on including this in a MonoTouch project using CoreText.
The hyphen ‐ is a punctuation mark used to join words and to separate syllables of a single word. The use of hyphens is called hyphenation. Son-in-law is an example of a hyphenated word.
/ˌhaɪ.fənˈeɪʃ.ən/ the use of the symbol -, joining two words or two parts of a word: the rules of hyphenation.
Generally, you need the hyphen only if the two or more words are functioning together as an adjective before the noun they're describing. If the noun comes first, leave the hyphen out. This wall is load bearing. It's impossible to eat this cake because it is rock hard.
Hyphenation is the automated process of breaking words between lines to create more consistency across a text block. In justified text, hyphenation is mandatory. In left-aligned text, hyphenation evens the irregular right edge of the text, called the rag .
I found a C# implementation of Knuth-Liang hyphenation algorithm at https://github.com/alkozko/NHyphenator and it seems to work fine.
But there are currently two drawbacks:
Obviously, Donald Knuth's algorithms are excellent. Although there is not a C# implementation available, have you considered converting another implementation to C#? (For example, you could convert the Java implementation which is fairly close to C#.)
Another option is to use a simpler implementation which can be found over at this answer here on StackOverflow.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With