This link展示了从树到结果的可能性,现在我只需要知道如何从结果到语法。在
def trees2productions(trees):
""" Transform list of Trees to a list of productions """
productions = []
for t in trees:
productions += t.productions()
return productions
This page演示了如何从预定义的语法中获取语法的结果,但它没有说明如何从结果到语法。有人知道我怎么做吗?在
^{pr2}$
我发现了如何解决我的问题,遵循代码here并对其进行了一点更新。这里是:
相关问题 更多 >
编程相关推荐