一种方法是遍历树搜索匹配的节点:
for subtree in tree.subtrees(): if subtree.label() == 'CITY-NAME': print subtree.leaves()
上一篇 从SQLAlchemy Join处理Pandas DataFrame构造函数中的重复列
下一篇 作为CGI Apache服务器运行python脚本
版权所有 (c)2021-2022 MSHXW.COM
ICP备案号:晋ICP备2021003244-6号