第一种做法是延迟所有语意动作,直到建立完整的剖析树。
The first approach is to delay all semantic actions until the whole parse tree is constructed.
引入scnf语法,据此进行概率CYK剖析,得到句子的最佳剖析树以消除歧义。
Stochastic Chomsky normal form (SCNF) is introduced to parse sentences with probabilistic CYK algorithm. The optimal parsing trees of sentences are gained to eliminate ambiguous meanings.
如果文档中有一大块不是你需要,你也可以使用extract来将它弄出剖析树,再把它丢给垃圾收集器同时对(较小的那个)剖析树的控制。
If there's a big chunk of the document you don't need, you can call extract to rip it out of the tree, then abandon it to be garbage collected while retaining control of the (smaller) tree.
应用推荐