开发者

Hyphenation in c#

开发者 https://www.devze.com 2023-03-02 20:47 出处:网络
I\'m开发者_Go百科 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 curr

I'm开发者_Go百科 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.


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:

  1. It can't load TeX hyphenation pattern files out-of-the-box (however, adding support for them seems trivial).
  2. It's unclear which kind of license applies to the source code.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号