def post( st ): util.killMecab( st ) allM = st['db'].keys() # morphemes to learn allF = uniqueFlatten( st['mfmap'].values() ) # facts to learn from ps = getMatches( st, allM, allF ) infoMsg( 'Successfully matched %d pairs.' % len(ps), p=st['ed'] ) for m,f in ps: f['matchedMorpheme'] = u'%s' % m.base infoMsg( 'Saved' )
def post(st): util.killMecab(st) st['db'].save(st['filePath']) wantMerge = QMessageBox.question(st['ed'], 'Query', 'Would you like to merge with known db?', QMessageBox.Yes | QMessageBox.No, QMessageBox.No) if wantMerge == QMessageBox.Yes: M.MorphDb.mergeFiles(st['filePath'], util.knownDbPath, util.knownDbPath)
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): util.killMecab(st) allM = st['db'].keys() # morphemes to learn allF = uniqueFlatten(st['mfmap'].values()) # facts to learn from ps = getMatches(st, allM, allF) infoMsg('Successfully matched %d pairs.' % len(ps), p=st['ed']) for m, f in ps: f['matchedMorpheme'] = u'%s' % m.base infoMsg('Saved')
def post(st): util.killMecab(st) st['ed'].deck.reset()
def post( st ): util.killMecab( st ) st['ed'].deck.reset()
def post( st ): util.killMecab( st ) st['db'].save( st['filePath'] ) wantMerge = QMessageBox.question( st['ed'], 'Query', 'Would you like to merge with known db?', QMessageBox.Yes | QMessageBox.No, QMessageBox.No ) if wantMerge == QMessageBox.Yes: M.MorphDb.mergeFiles( st['filePath'], util.knownDbPath, util.knownDbPath )