Ejemplo n.º 1
0
def showData():
    print("总app数量:" + str(MongoUtil.count("app_table")))
    locationCount = 0
    catas = json.load(open(const.WANDOUJIA_CATA_JSON_FILE))
    for cataname in catas:
        cataname = cataname.strip()
        print(cataname +" 数量:" + str(MongoUtil.count(cataname)))
        locationCount += len(MongoUtil.distinct_count(cataname, "appid"))
    print("获取评论的app数量:"+str(locationCount),end="\n\n")
    print("word数量:" + str(MongoUtil.count("word_table")))
Ejemplo n.º 2
0
def showData(cataname):
    print("总app数量:" + str(MongoUtil.count("app_table")))
    print("word数量:" + str(MongoUtil.count("word_table")))
    appCount = MongoUtil.find("app_table", {"catagory":cataname}).count()
    print(cataname+"的 app数量: "+str(appCount))
    locationCount = 0
    cataname = cataname.strip()
    print(cataname +"的 location 数量:" + str(MongoUtil.count(cataname)))
    locationCount += len(MongoUtil.distinct_count(cataname, "appid"))
    print("已获取评论的 app数量:"+str(locationCount))
    print("未获取评论的 app数量:"+str(appCount-locationCount))