summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/vocabcompiler.py20
-rw-r--r--static/keyword_phrases18
2 files changed, 38 insertions, 0 deletions
diff --git a/client/vocabcompiler.py b/client/vocabcompiler.py
index c59bd6e..8edee6f 100644
--- a/client/vocabcompiler.py
+++ b/client/vocabcompiler.py
@@ -12,6 +12,8 @@ from abc import ABCMeta, abstractmethod, abstractproperty
import g2p
import brain
+import jasperpath
+
try:
import cmuclmtk
except ImportError:
@@ -333,6 +335,24 @@ def get_phrases_from_module(module):
return module.WORDS if hasattr(module, 'WORDS') else []
+def get_keyword_phrases():
+ """
+ Gets the keyword phrases from the keywords file in the jasper data dir.
+
+ Returns:
+ A list of keyword phrases.
+ """
+ phrases = []
+
+ with open(jasperpath.data('keyword_phrases'), mode="r") as f:
+ for line in f:
+ phrase = line.strip()
+ if phrase:
+ phrases.append(phrase)
+
+ return phrases
+
+
def get_all_phrases():
"""
Gets phrases from all modules.
diff --git a/static/keyword_phrases b/static/keyword_phrases
new file mode 100644
index 0000000..d118b13
--- /dev/null
+++ b/static/keyword_phrases
@@ -0,0 +1,18 @@
+BE
+BEING
+BUT
+DID
+FIRST
+IN
+IS
+IT
+JASPER
+NOW
+OF
+ON
+RIGHT
+SAY
+WHAT
+WHICH
+WITH
+WORK \ No newline at end of file