Example #1
0
def run_input(trigram_prob_index,fivegram_count_index,quadgram_count_index,trigram_count_index,bigram_count_index):
    preprocessed = word_check.preprocessing()
    while True:
        phrase = raw_input('Enter a phrase  (# to stop) : ')
        if phrase == '#':
            sys.exit(0)
        compute_scores(phrase,preprocessed)
Example #2
0
def run_test_data(trigram_prob_index,fivegram_count_index,quadgram_count_index,trigram_count_index,bigram_count_index):
    preprocessed = word_check.preprocessing()
    with open(sys.argv[1]) as f:
        lines = f.read().splitlines()
        for line in lines:
            phrase = line.split('\t')[0]
            #start_time = time.time()
            compute_scores(phrase,preprocessed)