<分区> 分区>
目前,我能够打印出在句子列表中具有匹配项的字典项。我宁愿打印出句子列表的元素。请建议实现此目的的最佳方法。下面是我的代码。谢谢。
sentences = "The book was awesome and envious","splendid job done by those guys", "that was an amazing sale"
dictionary = "awesome","amazing", "fantastic","envious"
##Find Matches
for match in dictionary:
if any(match in value for value in sentences):
print match
