summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2014-09-24 19:10:43 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2014-10-08 20:52:13 +0200
commit9633fdeb0118f5e05c7e9eebd154a49f5ef85209 (patch)
treea215081adbe5995222efb8ac4ddff03e605d9b57
parentc30292e5f2b38430f5c5f17a52ae20cc16131233 (diff)
downloadjasper-client-9633fdeb0118f5e05c7e9eebd154a49f5ef85209.tar.gz
jasper-client-9633fdeb0118f5e05c7e9eebd154a49f5ef85209.zip
Added DummyVocabulary class
-rw-r--r--client/vocabcompiler.py22
1 files changed, 22 insertions, 0 deletions
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'