コード例 #1
0
def combos(multilist):
    """ given a list of lists, return all flattened lists"""
    if len(multilist) == 0:
        return [""]
    else:
        return [
            normalize_text(head + " " + tail) for head in multilist[0]
            for tail in combos(multilist[1:])
        ]
コード例 #2
0
ファイル: claimpatterns.py プロジェクト: BenTrem/think-link
def add_prefix(prefix):
	subs = t.suffixes(normalize_text(prefix).split(" "))
	for sub in subs:
		stxt = " ".join(sub)
		prefix_counts[stxt] = prefix_counts.get(stxt,0) + 1
コード例 #3
0
def combos(multilist):
	""" given a list of lists, return all flattened lists"""
	if len(multilist) == 0:
		return [""]
	else:
		return [normalize_text(head + " " + tail) for head in multilist[0] for tail in combos(multilist[1:])]
コード例 #4
0
def add_prefix(prefix):
    subs = t.suffixes(normalize_text(prefix).split(" "))
    for sub in subs:
        stxt = " ".join(sub)
        prefix_counts[stxt] = prefix_counts.get(stxt, 0) + 1