def readDownloadResponseDocumentDescription(input): title = serializer.read_vstring(input) publication_time = serializer.read_integer(input) mime_type = serializer.read_vstring(input) size = serializer.read_integer(input) url = serializer.read_vstring(input) provider_count = serializer.read_short(input) return (title, publication_time, mime_type, size, url, provider_count)
def readSearchResponseHitScore(input): return ( # word serializer.read_vstring(input), # relevance serializer.read_float(input), # popularity serializer.read_float(input), # excerpt serializer.read_vstring(input), # excerpt position serializer.read_integer(input), # position serializer.read_integer(input))
def readSearchResponseHitScore(input): return ( # word serializer.read_vstring(input), # relevance serializer.read_float(input), # popularity serializer.read_float(input), # excerpt serializer.read_vstring(input), # excerpt position serializer.read_integer(input), # position serializer.read_integer(input) )
def readDownloadRequest(input): document_id = binascii.b2a_hex(serializer.read_string(input, 20)) word_count = serializer.read_char(input) search_query = []; for i in range(0, word_count): search_query.append(serializer.read_vstring(input)) return (document_id, search_query)
def readDownloadRequest(input): document_id = binascii.b2a_hex(serializer.read_string(input, 20)) word_count = serializer.read_char(input) search_query = [] for i in range(0, word_count): search_query.append(serializer.read_vstring(input)) return (document_id, search_query)
def readSearchResponseHitInfo(input): return ( # document id binascii.b2a_hex(serializer.read_string(input, 20)), # mime_type serializer.read_vstring(input), # url serializer.read_vstring(input), # publication time serializer.read_integer(input), # file size serializer.read_integer(input), # title serializer.read_vstring(input), # score count serializer.read_char(input), # provider count serializer.read_char(input))
def readSearchResponseHitInfo(input): return ( # document id binascii.b2a_hex(serializer.read_string(input, 20)), # mime_type serializer.read_vstring(input), # url serializer.read_vstring(input), # publication time serializer.read_integer(input), # file size serializer.read_integer(input), # title serializer.read_vstring(input), # score count serializer.read_char(input), # provider count serializer.read_char(input) )
def readSearchRequest(input): # min_score min_score = serializer.read_float(input) # forwarding node count forwarding_node_count = serializer.read_char(input) # result count result_count = serializer.read_char(input) # search query word count word_count = serializer.read_char(input) search_query = [] for i in range(0, word_count): search_query.append(serializer.read_vstring(input)) return (min_score, forwarding_node_count, result_count, search_query)