def _buildDict(self):
        '''
        Builds the isle textfile into a dictionary for fast searching
        '''
        lexDict = {}
        with io.open(self.islePath, "r", encoding='utf-8') as fd:
            wordList = [line.rstrip('\n') for line in fd]
        
        for row in wordList:
            word, pronunciation = row.split(" ", 1)
            word, extraInfo = word.split("(", 1)
            
            extraInfo = extraInfo.replace(")", "")
            extraInfoList = [segment for segment in extraInfo.split(",")
                             if ("_" not in segment and "+" not in segment and
                                 ':' not in segment and segment != '')]
            
            lexDict.setdefault(word, [])
            lexDict[word].append((pronunciation, extraInfoList))
        
        return lexDict
def _buildDict ( self ) : lexDict = { } with io . open ( self . islePath , "r" , encoding = 'utf-8' ) as fd : wordList = [ line . rstrip ( '\n' ) for line in fd ] for row in wordList : word , pronunciation = row . split ( " " , 1 ) word , extraInfo = word . split ( "(" , 1 ) extraInfo = extraInfo . replace ( ")" , "" ) extraInfoList = [ segment for segment in extraInfo . split ( "," ) if ( "_" not in segment and "+" not in segment and ':' not in segment and segment != '' ) ] lexDict . setdefault ( word , [ ] ) lexDict [ word ] . append ( ( pronunciation , extraInfoList ) ) return lexDict
Builds the isle textfile into a dictionary for fast searching