Navigation Menu

Skip to content
This repository has been archived by the owner on Feb 5, 2021. It is now read-only.

Commit

Permalink
cleaned up detector constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Muller committed Jun 25, 2012
1 parent 97d8d5b commit ea82b2f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions genderator/detector.py
Expand Up @@ -6,13 +6,13 @@

class Detector:
def __init__(self, fname=None):
self.fname = fname or os.path.join(os.path.dirname(__file__), 'data', "nam_dict.txt")
self.reparse()
fname = fname or os.path.join(os.path.dirname(__file__), 'data', "nam_dict.txt")
self.parse(fname)


def reparse(self):
def parse(self, fname):
self.names = {}
f = codecs.open(self.fname, encoding='iso8859-1')
f = codecs.open(fname, encoding='iso8859-1')
line = f.readline()
while line:
self.eatNameLine(line)
Expand Down

0 comments on commit ea82b2f

Please sign in to comment.