支持歧义的Java CFG解析器 [英] Java CFG parser that supports ambiguities

查看:96
本文介绍了支持歧义的Java CFG解析器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找使用Java实现的CFG解析器。我正在尝试解析一种自然语言。我需要所有可能的解析树(模糊性),而不仅仅是其中之一。我已经研究了许多NLP解析器,例如斯坦福解析器。但是它们大部分都需要统计数据(我没有的树库),并且很难将其适应新的语言。
我找到了一些解析器生成器,例如ANTRL或JFlex,但我不确定它们是否可以处理歧义。那么哪个解析器生成器或Java库最适合我呢?
预先感谢

I'm looking for a CFG parser implemented with Java. The thing is I'm trying to parse a natural language. And I need all possible parse trees (ambiguity) not only one of them. I already researched many NLP parsers such as Stanford parser. But they mostly require statistical data (a treebank which I don't have) and it is rather difficult and poorly documented to adapt them in to a new language. I found some parser generators such as ANTRL or JFlex but I'm not sure that they can handle ambiguities. So which parser generator or java library is best for me? Thanks in advance

推荐答案

您想要一个使用Earley算法的解析器。我没有使用这两个库中的任何一个,但是 PEN PEP 出现在Java中实现此算法。

You want a parser that uses the Earley algorithm. I haven't used either of these two libraries, but PEN and PEP appear implement this algorithm in Java.

这篇关于支持歧义的Java CFG解析器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆