addok/autocomplete.py
def do_AUTOCOMPLETE(cmd, s):
    """Shows autocomplete results for a given token."""
    s = list(preprocess_query(s))[0]
    keys = [k.decode() for k in DB.smembers(edge_ngram_key(s))]
    print(white(keys))
    print(magenta('({} elements)'.format(len(keys))))
def do_AUTOCOMPLETE(cmd, s):
    """Shows autocomplete results for a given token."""
    s = list(preprocess_query(s))[0]
    keys = [k.decode() for k in DB.smembers(edge_ngram_key(s))]
    print(white(keys))
    print(magenta('({} elements)'.format(len(keys))))
def do_AUTOCOMPLETE ( cmd , s ) : s = list ( preprocess_query ( s ) ) [ 0 ] keys = [ k . decode ( ) for k in DB . smembers ( edge_ngram_key ( s ) ) ] print ( white ( keys ) ) print ( magenta ( '({} elements)' . format ( len ( keys ) ) ) )
Shows autocomplete results for a given token.
Shows autocomplete results for a given token .