예제 #1
0
def getText(location):
    if location==None:
        return ''
    res=location['description']
    if location['tags']!=None:
        res+=' ' + ' '.join(location['tags'])
    if location['categories']!=None:
        res+=' ' + ' '.join(location['categories'])
    return res

readInfo=ReadInfo('../info.txt')
#print readInfo.getLocation("TRECCS-00000102-423")


requestParser=RequestParser()
requests= requestParser.getRequests('../importantlocations.txt')



def calc_greedy_similarity(host, port, dbindex):
    logger.debug('calculating similarity...');

    begin_time = datetime.now()
    logger.debug('Similarity calculation started at : '+str(begin_time))
    dur = begin_time-begin_time

    redisconn=redis.StrictRedis(host=host, port=port, db=dbindex)
    #term_weight_fetcher=TermWeightFetcher(lucene_dir_path)
    term_vector_fetcher=TermVectorFetcher(redisconn, None)
    greedy=Greedy()