diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2014-10-06 16:52:53 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2014-10-06 16:52:53 +0200 |
| commit | 2b1e8411ab5eaa7e1349b78d03270ab02ae2950d (patch) | |
| tree | ed914cbf8964bbe26ba28e80589f4c289b3fac3a /client/g2p.py | |
| parent | 890a5798fcf7f9b9dc06529aa4bc7fe903d7ca1a (diff) | |
| download | jasper-client-2b1e8411ab5eaa7e1349b78d03270ab02ae2950d.tar.gz jasper-client-2b1e8411ab5eaa7e1349b78d03270ab02ae2950d.zip | |
Fix flake8 style nits
Diffstat (limited to 'client/g2p.py')
| -rw-r--r-- | client/g2p.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/client/g2p.py b/client/g2p.py index 6e308ef..4e64a4a 100644 --- a/client/g2p.py +++ b/client/g2p.py @@ -16,11 +16,13 @@ profile_path = os.path.join(os.path.dirname(__file__), 'profile.yml') if os.path.exists(profile_path): with open(profile_path, 'r') as f: profile = yaml.safe_load(f) - if 'pocketsphinx' in profile and 'fst_model' in profile['pocketsphinx']: + if ('pocketsphinx' in profile and + 'fst_model' in profile['pocketsphinx']): FST_MODEL = profile['pocketsphinx']['fst_model'] if not FST_MODEL: - FST_MODEL = os.path.join(jasperpath.APP_PATH, os.pardir, 'phonetisaurus', 'g014b2b.fst') + FST_MODEL = os.path.join(jasperpath.APP_PATH, os.pardir, 'phonetisaurus', + 'g014b2b.fst') def parseLine(line): @@ -52,7 +54,8 @@ def translateWords(words): def translateFile(input_filename, output_filename=None): out = subprocess.check_output( - ['phonetisaurus-g2p', '--model=%s' % FST_MODEL, '--input=%s' % input_filename, '--words', '--isfile']) + ['phonetisaurus-g2p', '--model=%s' % FST_MODEL, + '--input=%s' % input_filename, '--words', '--isfile']) out = parseOutput(out) if output_filename: |
