예제 #1
0
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)
예제 #2
0
파일: lab2.py 프로젝트: tjacek/WSJN
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))
예제 #3
0
파일: lab2.py 프로젝트: tjacek/WSJN
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)
예제 #4
0
파일: clusters.py 프로젝트: tjacek/WSJN
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)
예제 #5
0
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)
예제 #6
0
파일: lab2.py 프로젝트: tjacek/WSJN
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))
예제 #7
0
파일: lab2.py 프로젝트: tjacek/WSJN
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)