From 8bdf29bceb8d4e389037f9698ecb759edf964879 Mon Sep 17 00:00:00 2001 From: schneefux Date: Mon, 2 Feb 2015 09:56:21 +0100 Subject: be more generous with the phonetisaurus regex --- client/g2p.py | 4 ++-- 1 file 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.+)\t(?P\d+\.\d+)\t ' + - r'(?P.*) ', re.MULTILINE) + PATTERN = re.compile(r'^(?P.+)\t(?P\d+\.\d+)\t(?: )?' + + r'(?P.*?)(?: )?$', re.MULTILINE) @classmethod def execute(cls, fst_model, input, is_file=False, nbest=None): -- cgit v1.3.1