summaryrefslogtreecommitdiff
path: root/client/vocabcompiler.py
diff options
context:
space:
mode:
Diffstat (limited to 'client/vocabcompiler.py')
-rw-r--r--client/vocabcompiler.py20
1 files changed, 20 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.