Example #1
0
def scrub():
    words = load_words()
    chars = load_chars()
    fid = open(CHARMAP_PATH+'wordlist','w')
    specials = set(SPECIALS_LIST)
    for word in words:
        if word in specials:
            continue
        skip = False
        for t in word:
            # ignore words with bad symbols
            if t not in chars.keys():
                print word
                skip = True
                break
        if not skip:
            fid.write(word+'\n')
    fid.close()
Example #2
0
def scrub():
    words = load_words()
    chars = load_chars()
    fid = open(CHARMAP_PATH + 'wordlist', 'w')
    specials = set(SPECIALS_LIST)
    for word in words:
        if word in specials:
            continue
        skip = False
        for t in word:
            # ignore words with bad symbols
            if t not in chars.keys():
                print word
                skip = True
                break
        if not skip:
            fid.write(word + '\n')
    fid.close()
Example #3
0
def loadPrefixTree():
    lm = load_lm()
    chars = load_chars()
    words = load_words()
    return PrefixTree(chars,words,lm)
Example #4
0
def loadPrefixTree():
    lm = load_lm()
    chars = load_chars()
    words = load_words()
    return PrefixTree(chars, words, lm)