Example #1
0
def fetchDefinition(mysql, word):
    sql_statement = "select dict_form from links where word_form like '" + word + "'"
    data = fetch_raw_data(mysql, sql_statement)
    queryEnd = '('
    if (data):
        for item in data:
            queryEnd += "'" + item['dict_form'] + "',"
    queryEnd += "'" + word + "')"

    #print(queryEnd)
    sql_statement = "select * from google_defs where word in " + queryEnd
    resp = fetch_data(mysql, sql_statement)
    return resp
Example #2
0
def fetchAllBooks(mysql):
    sql_statement = "select * from books order by book_id desc;"
    resp = fetch_data(mysql, sql_statement)
    return resp
Example #3
0
def fetchTopWords(mysql):
    sql_statement = "select * from words order by word_form limit 100;"
    resp = fetch_data(mysql, sql_statement)
    return resp
Example #4
0
def fetchAllWordsLike(mysql, word):
    sql_statement = "select * from pure_words where word_form like '" + word + "%' order by word_form;"
    resp = fetch_data(mysql, sql_statement)
    return resp
Example #5
0
def fetchDefaultQuotes(mysql, bookid):
    sql_statement = "select * from sentences where book_id = " + str(
        bookid) + " LIMIT 2;"
    resp = fetch_data(mysql, sql_statement)
    return resp