(self)
Read words from disk
Read words from disk
Read words from disk
def read(self):
        """Read words from disk"""
        f = open(os.path.join(File.dataDir, "words", self.fileName))

        self.words = []
        for line in f.xreadlines():
            line = line.strip()
            if not line:
                continue
            if line[0] == '#':
                continue
            for word in line.split():
                if self.minLength is not None and len(word) < self.minLength:
                    continue
                if self.maxLength is not None and len(word) > self.maxLength:
                    continue
                self.words.append(word)
def read ( self ) : f = open ( os . path . join ( File . dataDir , "words" , self . fileName ) ) self . words = [ ] for line in f . xreadlines ( ) : line = line . strip ( ) if not line : continue if line [ 0 ] == '#' : continue for word in line . split ( ) : if self . minLength is not None and len ( word ) < self . minLength : continue if self . maxLength is not None and len ( word ) > self . maxLength : continue self . words . append ( word )