py/gadict_freq.py
changeset 804 7aa283584ee6
parent 757 5417f2102dc5
child 1004 181301cc2c0c
equal deleted inserted replaced
803:13f5485d81c6 804:7aa283584ee6
    38             self.lineno += 1
    38             self.lineno += 1
    39             m = self.BASEVAR_RE.match(line)
    39             m = self.BASEVAR_RE.match(line)
    40             if not m:
    40             if not m:
    41                 raise Exception("Line {:d}: '{:s}' wrong format\n".format(self.lineno, line))
    41                 raise Exception("Line {:d}: '{:s}' wrong format\n".format(self.lineno, line))
    42             tab = m.group(1)
    42             tab = m.group(1)
    43             if not tab:
    43             if tab:
    44                 self.cnt += 1
    44                 continue
       
    45             self.cnt += 1
    45             if self.limit and self.cnt > self.limit:
    46             if self.limit and self.cnt > self.limit:
    46                 break
    47                 break
    47             headword = m.group(2).strip().lower()
    48             headword = m.group(2).strip().lower()
    48             wlist.append(headword)
    49             wlist.append(headword)
    49         return wlist
    50         return wlist