Ejemplo n.º 1
0
def getHourlyOverallCount(inComing=None, outGoing=None):
    inCount = -1
    outCount = -1
    if inComing is not None:
        inCount = lineCount(inComing)
    else:
        print("Warning: input incoming file is ignored")

    if outGoing is not None:
        outCount = lineCount(outGoing)
    else:
        print("Warning: input outgoing file is ignored")
    sumCount = inCount + outCount
    return sumCount, inCount, outCount
Ejemplo n.º 2
0
def dailyCount(foldername):
    folder = folderReader(foldername)
    sumCount = 0
    for filename in folder:
        sumCount += lineCount(filename)

    return sumCount
Ejemplo n.º 3
0
 def yDataGen(self):
     yData = []
     for date in self.dateList:
         foldername = self.superfoldername + "/" + date
         # print(foldername)
         folder = folderReader(foldername)
         for filename in folder:
             # print(filename)
             yData.append(lineCount(filename))
     return yData
Ejemplo n.º 4
0
def getHourlyAnalysis(filename):
    file = fileReader(filename)
    hourlyCounter = Counter()
    for line in file:
        response = line.split("\t")[FieldToLoc["answers"]]
        query = line.split("\t")[FieldToLoc["query"]]
        hourlyCounter[responseClassify(query, response)] += 1
    return hourlyCounter

def getDailyAnalysis(date, cookie):
    foldername = "../../result/Response/To%s/%s/" % (cookie, date)
    folder = folderReader(foldername)
    dailyCounter = Counter()
    for filename in folder:
        dailyCounter += getHourlyAnalysis(filename)
    print(dailyCounter)
    print(sum(dailyCounter.values()))


if __name__ == '__main__':
    date = "2018-09-12"
    cookie = "Phys"
    getDailyAnalysis(date, cookie)

    foldername = "../../result/To%s/%s" % (cookie, date)
    lineC = 0
    folder = folderReader(foldername)
    for filename in folder:
        lineC += lineCount(filename)
    print(lineC)
Ejemplo n.º 5
0
def __exp_getHourlyCount(filename):
    # Expired because of duplication problem in some files [FROM 2018-09-18_21 TO 2018-09-24_09]
    return lineCount(filename)
Ejemplo n.º 6
0
def doHourlyCount(foldername):
    folder = folderReader(foldername)
    countList = []
    for filename in folder:
        countList.append(lineCount(filename))
    return countList