From 9633fdeb0118f5e05c7e9eebd154a49f5ef85209 Mon Sep 17 00:00:00 2001 From: schneefux Date: Wed, 24 Sep 2014 19:10:43 +0200 Subject: Added DummyVocabulary class --- client/vocabcompiler.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'client') diff --git a/client/vocabcompiler.py b/client/vocabcompiler.py index 0e498a2..a7d2c4b 100644 --- a/client/vocabcompiler.py +++ b/client/vocabcompiler.py @@ -168,6 +168,28 @@ class AbstractVocabulary(object): pass +class DummyVocabulary(AbstractVocabulary): + + PATH_PREFIX = 'dummy-vocabulary' + + @property + def is_compiled(self): + """ + Checks if the vocabulary is compiled by checking if the revision + file is readable. + + Returns: + True if this vocabulary has been compiled, else False + """ + return super(self.__class__, self).is_compiled + + def _compile_vocabulary(self, phrases): + """ + Does nothing (because this is a dummy class for testing purposes). + """ + pass + + class PocketsphinxVocabulary(AbstractVocabulary): PATH_PREFIX = 'pocketsphinx-vocabulary' -- cgit v1.3.1