def load_common(self, wlist):
        """Create the dictionary of common words."""
        self.com_dict = os.path.join(self.base_dir, 'dicts', 'EN_vocab.txt')
        with open(self.com_dict) as words_file:
            data = words_file.read()
        self.common_words = set(data.splitlines())
        if wlist:
            new_words = ''
            for wl in wlist:
                with open(wl) as f:
                    new_words += f.read()
            if new_words:
                new_dict = set(data.splitlines())
                self.common_words.update(new_dict)
def load_common ( self , wlist ) : self . com_dict = os . path . join ( self . base_dir , 'dicts' , 'EN_vocab.txt' ) with open ( self . com_dict ) as words_file : data = words_file . read ( ) self . common_words = set ( data . splitlines ( ) ) if wlist : new_words = '' for wl in wlist : with open ( wl ) as f : new_words += f . read ( ) if new_words : new_dict = set ( data . splitlines ( ) ) self . common_words . update ( new_dict )
Create the dictionary of common words.