diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2015-02-02 09:56:21 +0100 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2015-02-02 09:56:21 +0100 |
| commit | 8bdf29bceb8d4e389037f9698ecb759edf964879 (patch) | |
| tree | 52f198eee8f0d523448f0b4d2a4026227063bc2d | |
| parent | 2521c58282b34c13d6d47cec16569b04a8ac4c64 (diff) | |
| download | jasper-client-8bdf29bceb8d4e389037f9698ecb759edf964879.tar.gz jasper-client-8bdf29bceb8d4e389037f9698ecb759edf964879.zip | |
be more generous with the phonetisaurus regex
| -rw-r--r-- | client/g2p.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/client/g2p.py b/client/g2p.py index 7b80226..9595dbf 100644 --- a/client/g2p.py +++ b/client/g2p.py @@ -12,8 +12,8 @@ import jasperpath class PhonetisaurusG2P(object): - PATTERN = re.compile(r'^(?P<word>.+)\t(?P<precision>\d+\.\d+)\t<s> ' + - r'(?P<pronounciation>.*) </s>', re.MULTILINE) + PATTERN = re.compile(r'^(?P<word>.+)\t(?P<precision>\d+\.\d+)\t(?:<s> )?' + + r'(?P<pronounciation>.*?)(?: </s>)?$', re.MULTILINE) @classmethod def execute(cls, fst_model, input, is_file=False, nbest=None): |
