def check( code_map_entry ) : code_map = CodeMap() code_map.entry = code_map_entry while( 1 ) : code = sys.stdin.readline()[:-1] flag = -1 time_stamp = time.time() cache = QueryCache( code_map, code ) print "query cast", time.time() - time_stamp, "s" if cache.vaild() : cand = cache.get_cand( 0, 6 ) for index in range( len( cand ) ) : code, pinyin, hanzi, freq = cache.get_prop( index ) print code, pinyin, hanzi, freq