<commit_before>
#Class que toma los datos obtenidos por las queries y retorna un string en html

class Parser:
    def __tagGenerator(self,tag):
        def func(text):
            return "<" + tag + ">" + text + "</" + tag + ">"
        return func

    def __init__(self):
        self.thead = self.__tagGenerator("thead")
        self.tbody = self.__tagGenerator("tbody")
        self.h2 = self.__tagGenerator("h2")

        self.tr = self.__tagGenerator("tr")
        self.th = self.__tagGenerator("th")
        self.td = self.__tagGenerator("td")

        self.li = self.__tagGenerator("li")
        self.ul = self.__tagGenerator("ul")
        self.b = self.__tagGenerator("b")

    def tableheader(self,header):
        h = ""
        for el in header:
            h += "\n" + self.th(el) + "\n"
        return self.thead("\n" + self.tr(h) + "\n")

    def tableBody(self,rows):
        h = ""
        for row in rows:
            d = ""
            for el in row:
                d += "\n" + self.td(str(el)) + "\n"
            h += "\n" + self.tr(d) + "\n"
        return self.tbody("\n" + h + "\n")

    def parseChampionQuery(self,title,colnames,rows):
        data = self.h2(title)
        data += "<hr>"
        table = ""
        for row in rows:
            nametime = str(row[0])
            lista = ""
            for i in range(1,len(row)):
                items=self.b(colnames[i]+": ") + str(row[i])
                lista+=self.li(items)
            lista = self.li(nametime + self.ul(lista) )
            table += lista
        table = self.ul(table)<commit_msg>modified parser<commit_after>
#Class que toma los datos obtenidos por las queries y retorna un string en html

class Parser:
    def __tagGenerator(self,tag):
        def func(text):
            return "<" + tag + ">" + text + "</" + tag + ">"
        return func

    def __init__(self):
        self.thead = self.__tagGenerator("thead")
        self.tbody = self.__tagGenerator("tbody")
        self.h2 = self.__tagGenerator("h2")

        self.tr = self.__tagGenerator("tr")
        self.th = self.__tagGenerator("th")
        self.td = self.__tagGenerator("td")

        self.li = self.__tagGenerator("li")
        self.ul = self.__tagGenerator("ul")
        self.b = self.__tagGenerator("b")

    def tableheader(self,header):
        h = ""
        for el in header:
            h += "\n" + self.th(el) + "\n"
        return self.thead("\n" + self.tr(h) + "\n")

    def tableBody(self,rows):
        h = ""
        for row in rows:
            d = ""
            for el in row:
                d += "\n" + self.td(str(el)) + "\n"
            h += "\n" + self.tr(d) + "\n"
        return self.tbody("\n" + h + "\n")

    def parseChampionQuery(self,title,colnames,rows):
        data = self.h2(title.decode("utf8"))
        data += "<hr>"
        table = ""
        for row in rows:
            nametime = str(row[0])
            lista = ""
            for i in range(1,len(row)):
                items=self.b(colnames[i]+": ") + str(row[i])
                lista+=self.li(items)
            lista = self.li(nametime + self.ul(lista) )
            table += lista
        table = self.ul(table)
{'fraction_non_alphanumeric': 0.15938384155925808, 'fraction_numerical': 0.0034580320653882428, 'mean_word_length': 1.7454702329594478, 'pattern_counts': {'":': 2, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '848885', 'n_tokens_mistral': 1015, 'n_tokens_neox': 1003, 'n_words': 230}