diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2014-11-05 14:40:53 +0100 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2014-11-05 14:40:53 +0100 |
| commit | bc14ded285e2291600457bd9f4ac559270ba53a7 (patch) | |
| tree | b415fd6e88038e1a3d518e83f5493d0c068d5e29 /client/test.py | |
| parent | 533864c8814e9b02eceadd10e1bf20f46dbd1efe (diff) | |
| parent | c89514f6cd11afa0ebbd20842ab881fe42a20dba (diff) | |
| download | jasper-client-bc14ded285e2291600457bd9f4ac559270ba53a7.tar.gz jasper-client-bc14ded285e2291600457bd9f4ac559270ba53a7.zip | |
Merge pull request #219 from Holzhaus/remove-transcription-mode
Remove transcription mode
Diffstat (limited to 'client/test.py')
| -rw-r--r-- | client/test.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/client/test.py b/client/test.py index 0a414f4..5a5dc6b 100644 --- a/client/test.py +++ b/client/test.py @@ -17,7 +17,6 @@ import brain import jasperpath import tts import diagnose -from stt import TranscriptionMode DEFAULT_PROFILE = { 'prefers_email': False, @@ -154,22 +153,22 @@ class TestPatchedPocketsphinxVocabulary(TestPocketsphinxVocabulary): self).testVocabulary() -class TestMic(unittest.TestCase): +class TestSTT(unittest.TestCase): def setUp(self): self.jasper_clip = jasperpath.data('audio', 'jasper.wav') self.time_clip = jasperpath.data('audio', 'time.wav') from stt import PocketSphinxSTT - self.stt = PocketSphinxSTT(**PocketSphinxSTT.get_config()) + self.passive_stt_engine = PocketSphinxSTT.get_passive_instance() + self.active_stt_engine = PocketSphinxSTT.get_active_instance() def testTranscribeJasper(self): """ Does Jasper recognize his name (i.e., passive listen)? """ with open(self.jasper_clip, mode="rb") as f: - transcription = self.stt.transcribe(f, - mode=TranscriptionMode.KEYWORD) + transcription = self.passive_stt_engine.transcribe(f) self.assertIn("JASPER", transcription) def testTranscribe(self): @@ -177,7 +176,7 @@ class TestMic(unittest.TestCase): Does Jasper recognize 'time' (i.e., active listen)? """ with open(self.time_clip, mode="rb") as f: - transcription = self.stt.transcribe(f) + transcription = self.active_stt_engine.transcribe(f) self.assertIn("TIME", transcription) @@ -411,7 +410,7 @@ if __name__ == '__main__': else: test_cases.append(TestG2P) test_cases.append(TestPocketsphinxVocabulary) - test_cases.append(TestMic) + test_cases.append(TestSTT) suite = unittest.TestSuite() |
