def transit_route_match_score(segment,step1=100000,step2=100000,method='lcs',radius1=2500,threshold=0.5):
    Transits=get_transit_db()
    transitMatch={}
    route_seg=getRoute(segment['_id'])
    for type in Transits.distinct('type'):
        for entry in Transits.find({'type':type}):
            transitMatch[type]=matchTransitRoutes(route_seg,entry['stops'],step1,step2,method,radius1,threshold)
            if transitMatch[entry['type']]==1:
                break
    return transitMatch
def transit_route_match_score(segment, step1=100000, step2=100000, method="lcs", radius1=2500, threshold=0.5):
    Transits = get_transit_db()
    transitMatch = {}
    route_seg = getRoute(segment["_id"])
    for type in Transits.distinct("type"):
        for entry in Transits.find({"type": type}):
            transitMatch[type] = matchTransitRoutes(route_seg, entry["stops"], step1, step2, method, radius1, threshold)
            if transitMatch[entry["type"]] == 1:
                break
    return transitMatch