def check_if_atomic(sentence, parsed_sentence, tags):
counter = 0
atomic_check = re.compile("|".join(not_atomic_list))
tree = Tree('s', parsed_sentence)
for child in tree:
string = str(child)
if string.startswith("(S"):
counter += 1
if atomic_check.search(sentence_lower):
return False
elif counter > 1:
return False
else:
return True
AIDA_Check_and_Rewrite.py 文件源码
python
阅读 16
收藏 0
点赞 0
评论 0
评论列表
文章目录