Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit 337b257

Browse files
committed
Fix tests output redirect in windows
1 parent f8dbb35 commit 337b257

File tree

5 files changed

+5
-6
lines changed

5 files changed

+5
-6
lines changed

build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env bash
22

33
rm -rf venv2 venv3 build dist pocketsphinx.egg-info
4+
rm -rf goforward.fsg goforward.htk goforward.lat
45
rm -rf sphinxbase/sphinxbase.py sphinxbase/*.so
56
rm -rf pocketsphinx/pocketsphinx.py pocketsphinx/*.so
67

example.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
config.set_string('-hmm', os.path.join(MODELDIR, 'en-us/en-us'))
1313
config.set_string('-lm', os.path.join(MODELDIR, 'en-us/en-us.lm.bin'))
1414
config.set_string('-dict', os.path.join(MODELDIR, 'en-us/cmudict-en-us.dict'))
15-
config.set_string('-logfn', '/dev/null')
1615
decoder = ps.Decoder(config)
1716

1817
# Decode streaming data.

tests/test_decoder.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class Decoder(object):
99

1010
def __init__(self, hmm_path=None, lm_path=None, dict_path=None, lm_load=True,
11-
logfn='/dev/null', keyphrase=None, kws_threshold=None, mmap=None):
11+
keyphrase=None, kws_threshold=None, mmap=None):
1212
self.hmm_path = hmm_path
1313
self.lm_path = lm_path
1414
self.dict_path = dict_path
@@ -21,7 +21,6 @@ def __init__(self, hmm_path=None, lm_path=None, dict_path=None, lm_load=True,
2121
self.config.set_string('-hmm', self.hmm_path or os.path.join(self.model_path, 'en-us/en-us'))
2222
self.config.set_string('-lm', self.lm_path or os.path.join(self.model_path, 'en-us/en-us.lm.bin')) if lm_load else None
2323
self.config.set_string('-dict', self.dict_path or os.path.join(self.model_path, 'en-us/cmudict-en-us.dict'))
24-
self.config.set_string('-logfn', logfn)
2524
self.config.set_string('-keyphrase', keyphrase) if keyphrase else None
2625
self.config.set_float('-kws_threshold', kws_threshold) if kws_threshold else None
2726
self.config.set_boolean('-mmap', mmap) if mmap else None

tests/test_jsgf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def switch_to_jsgf_grammar(self):
1515
jsgf = sb.Jsgf(os.path.join(self.data_path, 'goforward.gram'))
1616
rule = jsgf.get_rule('goforward.move2')
1717
fsg = jsgf.build_fsg(rule, self.decoder.get_logmath(), 7.5)
18-
fsg.writefile('/dev/null')
18+
fsg.writefile('goforward.fsg')
1919

2020
self.decoder.set_fsg('goforward', fsg)
2121
self.decoder.set_search('goforward')

tests/test_lattice.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ def test_lattice(self):
1818
lattice = Lattice()
1919
lattice.run()
2020
l = lattice.get_lattice()
21-
result = l.write('/dev/null')
21+
result = l.write('goforward.lat')
2222
self.assertEqual(result, None)
2323
l = lattice.get_lattice()
24-
result = l.write_htk('/dev/null')
24+
result = l.write_htk('goforward.htk')
2525
self.assertEqual(result, None)

0 commit comments

Comments
 (0)