def build_forms(begin_file,end_file): begin_lines=tools.read_lines(begin_file,clean_text=False) begin=parse_begin(begin_lines) end_lines=tools.read_lines(end_file,clean_text=False) end=parse_end(end_lines) unified=unify_dirs(begin,end) return FormsDict(unified)
def main(new_word): words = tools.read_lines(FORMS_SOURCE, clean_text=False) #words=distance.eff_heuristic(new_word,words) correct_word = distance.curry_correct(words) print(correct_word(new_word))
def main_loop(): full_words = tools.read_lines(FORMS_SOURCE, clean_text=False) words = [distance.code_digraphs(word_i) for word_i in full_words] correct_word = distance.curry_correct(words, full_words) tools.ui_loop(correct_word, get_word)
def clustering(filename): lines=tools.read_lines(filename,clean_text=True) text=" ".join(lines) ngram_metric=ngrams.make_ngram_metric(text,n=2) return cluster_lines(lines,metric=ngram_metric)
def clustering(filename): lines = tools.read_lines(filename, clean_text=True) text = " ".join(lines) ngram_metric = ngrams.make_ngram_metric(text, n=2) return cluster_lines(lines, metric=ngram_metric)
def main(new_word): words=tools.read_lines(FORMS_SOURCE,clean_text=False) #words=distance.eff_heuristic(new_word,words) correct_word=distance.curry_correct(words) print(correct_word(new_word))
def main_loop(): full_words=tools.read_lines(FORMS_SOURCE,clean_text=False) words=[distance.code_digraphs(word_i) for word_i in full_words] correct_word=distance.curry_correct(words,full_words) tools.ui_loop(correct_word,get_word)