Monday, 15 June 2015

speech recognition - python dragonfly to recognize similar words -



speech recognition - python dragonfly to recognize similar words -

i doing programme dragon fly using wsr,where has analyse word,any voice matching word should output 'yes matches'

if 'czechoslovakia' must print true similar matches of world ,like words 'circle slovakia, cat on slavia,seko vakia...'

what specific methods,should utilize this?

my program

from dragonfly.all import * import pythoncom import time # voice command rule combining spoken form , recognition processing. class examplerule(compoundrule): spec = "czechoslovakia|circle slovalia|sceko bakia|cat on ania" # spoken form of command. def _process_recognition(self, node, extras): # callback when command spoken. print "voice command spoken." # create grammar contains , loads command rule. grammar = grammar("example grammar") # create grammar contain command rule. grammar.add_rule(examplerule()) # add together command rule grammar. grammar.load() # load grammar. while true: pythoncom.pumpwaitingmessages() time.sleep(.1)

there nil built dragonfly allow this, have other options.

if you're looking dynamically generate spec, might want @ fuzzy. give word , utilize generate other similar sounding words word. create spec them. here wsr engine class in dragonfly. don't know much sapi5, you might able inquire alternatives. if can, might able extend dragonfly grammarwrapper expose alternatives, , utilize catchall grammar save utterances , filter out want (possibly using fuzzy). if using natlink, recommend looking @ results object. can see here, results object has access of dragon's different hypotheses said in given utterance. sec suggestion, grab , filter wanted:

.

from natlinkutils import grammarbase class catchall(grammarbase): # spec grab gramspec = """ <start> exported = {emptylist}; """ def initialize(self): self.load(self.gramspec, allresults=1) self.activateall() def gotresultsobject(self, recogtype, resobj): x in range(0, 100): try: possible_interpretation = resobj.getwords(x) # whatever sort of filtering want here except exception: break c = catchall() c.initialize() def unload(): global c if c: c.unload() c = none

python speech-recognition speech python-dragonfly

No comments:

Post a Comment