def post( st ): ms = M.getMorphemes( st['mp'], st['txt'], bs=st['bs'] ) util.killMecab( st ) txt = M.ms2str( ms ) kdb = M.MorphDb( util.knownDbPath ) newMs = [ m for m in ms if m not in kdb.db ] newTxt = M.ms2str( newMs ) txt = '-----All-----\n' + txt + '\n-----New-----\n' + newTxt QMessageBox.information( st['ed'], 'Morphemes', txt )
def post( st ): import morphemes as m mp = m.mecab( None ) ms = m.getMorphemes( mp, st['txt'], bs=st['bs'] ) mp.kill() txt = m.ms2str( ms ).decode('utf-8') kdb = m.loadDb( util.knownDbPath ) newMs = [ x for x in ms if x not in kdb ] newTxt = m.ms2str( newMs ).decode('utf-8') txt = '-----All-----\n' + txt + '\n-----New-----\n' + newTxt QMessageBox.information( st['ed'], 'Morphemes', txt )
def updateDisplay( self ): bs = self.blacklist.text().split(',') ms = [ m for m in self.morphemes if m[1] not in bs ] if self.col4Mode.isChecked(): self.morphDisplay.setText( M.ms2str( ms ).decode('utf-8') ) else: self.morphDisplay.setText( u'\n'.join( [ e for (e,p,sp,r) in ms ] ) ) self.analysisDisplay.setText( M.analyze2str( self.morphemes ) )
def post(st): ms = getMorphemes(st['morphemizer'], st['txt']) s = ms2str(ms) infoMsg('----- All -----\n' + s)
def post( st ): if len(st['morphemes']) == 0: infoMsg('----- No morphemes, check your filters -----') return s = ms2str( st['morphemes'] ) infoMsg( '----- All -----\n' + s )
def post( st ): ms = getMorphemes( st['txt'], None, cfg1('morph_blacklist') ) s = ms2str( ms ) infoMsg( '----- All -----\n' + s )