예제 #1
0
def getWord():
    r = RandomWords()
    
    rw = r.get_random_word()
    wd = r.word_of_the_day()
    wordtxt = ''
    deftxt = ''
    #for items in wd:
        #wordtxt = items
        #for definations in wd:
            #if(items == 'text'):
                #deftxt += definations['text']
                

    return rw
예제 #2
0
from random_word import RandomWords
r = RandomWords()

# Return a single random word
r.get_random_word()
# Return list of Random words
r.get_random_words()
# Return Word of the day
r.word_of_the_day()

# print(r.get_random_word(hasDictionaryDef="True", includePartOfSpeech="noun,verb", minCorpusCount=1, maxCorpusCount=10, minDictionaryCount=1, maxDictionaryCount=10, minLength=5, maxLength=10))

print(r.get_random_word(hasDictionaryDef='True', includePartOfSpeech="verb"))
예제 #3
0
#LIBRERIAS
from clases import *
from random_word import RandomWords
from ui_messages import *
import ast
import warnings
import sys
import os
import platform
import texttable as tt
from peewee import *
#VARIABLES GLOBALES
r = RandomWords()
word_of_the_day = ast.literal_eval(r.word_of_the_day())['word']
meaning = ast.literal_eval(r.word_of_the_day())['definations'][0]['text']
warnings.filterwarnings("ignore")


#METODOS DISPLAY
def displayWelcome():
    print(welcome[0])
    print(welcome[1].format(word_of_the_day, meaning))


def displayMenu(flag):
    if (flag):
        print(menu[0])
        print(menu[1].format("t - Translator", "n - New Word",
                             "s - Show Words", "d - Dictionary", "q - Exit"))
    else:
        print(menu[1].format("t - Translator", "n - New Word",