在 Java 中实现 FSA/FSM 的最佳方法是什么
我有一个大型有限状态自动机,大约有 50 个状态,每个状态都有平均值。 3-4 转换到其他状态。所以我认为“状态模式”不适合这个。该 FSM 往往是某些粘着语言的拼写检查器和形态分析器。
在 Java 中实现 FSA/FSM 的最佳方法是什么,或者我应该使用开源库。由于自然语言不是常规的(有例外情况),有没有办法使这种实现灵活地适应这种情况。
谢谢
I have a big finite state automaton with like 50 states and each state has avg. 3-4 transitions to other states. So I don't think the "state pattern" is suitable for this. This FSM tends to be a spellchecker and morphological analyzer for some agglutinative language.
What is the best way to implement a FSA/FSM in Java or should I use an open source library. Since natural languages are not regular (have exception cases), is there a way to make this implementation flexible for such situations.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将其实现为有向标记图似乎很简单。也许 Java 的图形库也适合于此,但是我没有使用它们的经验,所以我将留给其他人提出具体的建议。
It seems like it would be straightforward to implement this as a directed, labelled graph. Perhaps there are graph libraries for Java that would be appropriate for this too, however I have no experience with them so I will leave it to others to make specific recommendations.