def has_sense_path(G, source, target):
if source not in G.senses or target not in G.senses:
return False
for source_sense, target_sense in itertools.product(G.senses[source], G.senses[target]):
if nx.has_path(G, source_sense, target_sense):
return True
return False
评论列表
文章目录