Exemple #1
0
def words_to_cache():
    print "Getting all words from UrbanDictionary..."
    count = 0
    alphabet_todo = calculate_alphabet_todo(alphabet)
    for letter in alphabet_todo:
        print "Letter: %s" % letter
        f = codecs.open('data/words-%s' % letter, 'w', 'UTF-8')
        for j in UrbanDictionary.words_for_character(letter):
            if not j.endswith("..."):
                f.write(j + '\n')
                count += 1
                if count % 100 == 0:
                    print count
Exemple #2
0
def words_to_cache():
    print "Getting all words from UrbanDictionary..."
    count = 0
    alphabet_todo = calculate_alphabet_todo(alphabet)
    for letter in alphabet_todo:
        print "Letter: %s" % letter
        f = codecs.open('data/words-%s' % letter, 'w', 'UTF-8')
        for j in UrbanDictionary.words_for_character(letter):
            if not j.endswith("..."):
                f.write(j + '\n')
                count += 1
                if count % 100 == 0:
                    print count