C# 中的连字符
我正在寻找一个示例项目,它将在 C# 中执行文本连字符。理想情况下,这应源自 TeX 连字算法或类似算法。我目前对英语感兴趣,尽管将来可能需要其他语言。有人见过类似的东西吗? 背景 我计划将其包含在使用 CoreText 的 MonoTouch 项目中。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在 https://github.com/alkozko/NHyphenator 找到了 Knuth-Liang 连字算法的 C# 实现它似乎工作得很好。
但目前有两个缺点:
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:
显然,Donald Knuth 的算法非常出色。尽管没有可用的 C# 实现,但您是否考虑过将另一个实现转换为 C#? (例如,您可以转换与 C# 相当接近的 Java 实现。)
另一种选择是使用更简单的实现,可以在 StackOverflow 上的这个答案。
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.