Earley 识别器到 Earley 解析器
我设法创建了 Earley 识别器,一切正常。我有所有适当的情况。但我只能用它来决定单词是否被语法接受。如何让它解析?我需要一些文章或解释,似乎我需要与产生新情况的情况建立关联。任何帮助将不胜感激。
我的实现完全基于: http://www.cs.uvic.ca /~nigelh/Publications/PracticalEarleyParsing.pdf
I managed to create Earley recognizer, everything works fine. I have all proper sets of situation. But I only can use it to decide if word is accepted by grammar. How to make it to parse? I need some article or explanation, it seems that I need to create associations to situations that made new situations. Any help would be appreciated.
My implementation it's based exactly on: http://www.cs.uvic.ca/~nigelh/Publications/PracticalEarleyParsing.pdf
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从 Earley 识别器生成解析森林是很棘手的。有这张纸
“识别不是解析——三次识别器的 SPPF 式解析”解释道
Earley 的解析器版本不正确,然后展示如何生成
从 Earley 识别器解析森林。
http://www.sciencedirect.com/science/article/pii/S0167642309000951
Parse forest generation from Earley recognizers is tricky. There is this paper
"Recognition is not parsing — SPPF-style parsing from cubic recognisers" that explains
that Earley's parser version is incorrect and then shows how to generate
parse forests from Earley recognizers.
http://www.sciencedirect.com/science/article/pii/S0167642309000951
每当你进行推理时,请记住你来自哪里,即。使用哪些物品来形成新物品。然后可以通过探索跨越整个输入的顶部元素来找到解析森林。如果您正在使用二义性语法进行解析,您还应该考虑二义性包装,即。不要将(局部)等效分析重新组合在一起。
我真的推荐 Klaas Sikkel 的优秀著作《Parsing Schemata》,了解理论方面的内容。
Whenever you do an inference, keep track of where you came from, ie. what items where used to form the new item. Then the parse forest can be found by exploring the top element spanning the entire input. If you are parsing with ambigous grammars, you should also consider ambiguity packing, ie. do not recombine (locally) equivalent analyses together.
I really recommend Klaas Sikkel's excellent book "Parsing Schemata" for the theoretical side of things.