Пример #1
0
 def testQueryHelper(self):
     qh = QueryHelper(db_name, cll_name)
     qh.ensure_index('loc', -90000, 90000)
     self.assertEqual(qh.nearest([15, 384], 'E', 1) , [u'00015+00384E.jpeg'])
     range = [14, 200, 16, 800]
     print 'test the min cover:'
     print "min cover for the range query area %s is:" %range
     print qh.range_query(range, 'E')
     print "Original returns without min cover is:"
     print qh.range_query_without_min_cover(range, 'E')
#!/usr/bin/env python

from query_helper import QueryHelper
from adjectivenoun import AdjectiveNoun


if __name__=='__main__':

    yelp_db_path = "yelp.db"
    query_helper = QueryHelper(yelp_db_path)

    adjnoun = AdjectiveNoun(query_helper)
    adjnoun.process()

    query_helper.close()

Пример #3
0
'''
Created on Nov 29, 2011

@author: boyusun
'''
from query_helper import QueryHelper

   
if __name__ == '__main__':
    db_name = 'astro'
    coll_name = 'first_image'
    
    qhelper = QueryHelper(db_name, coll_name)
    #test nearest query 
    print "test nearest query"
    print qhelper.nearest([15, 384], 'E', 1) 
    print '--------------------------------------------------------'
    range = [14, 200, 16, 800]
    print 'test the range query:'
    print '--------------------------------------------------------'
    print "Original returns without min cover is:"
    ret = qhelper.range_query_without_min_cover(range, 'E')
    for i in ret:
        print i
    print 'number of object returned: %d' %len(ret)
    print '--------------------------------------------------------'
    print "min cover for the range query area %s is:" %range
    ret = qhelper.range_query(range, 'E')
    for i in  ret:
        print i
    print 'number of object returned: %d' %len(ret)