Fix parsing for the span date in Ukrainian language, was conflict with b.c.e. string

This commit is contained in:
Fedir Zinchuk 2014-12-21 15:45:57 +02:00
parent 8497e8c4b2
commit c248767c1d

View File

@ -102,10 +102,10 @@ class DateParserUK(DateParser):
_span_1 = ['з', 'від']
# b.c.e. pattern also have "до" so skip "до н."
_span_2 = ['по', 'до?!\sн']
_span_2 = ['по', 'до(?!\s+н)']
_range_1 = ['між']
_range_2 = ['і', 'та']
self._span = re.compile("(%s)\s+(?P<start>.+)\s+(%s)\s+(?P<stop>.+)" %
self._span = re.compile("(%s)\s+(?P<start>.+)\s+(%s)\s+(?P<stop>.+)" %
('|'.join(_span_1), '|'.join(_span_2)),
re.IGNORECASE)
self._range = re.compile("(%s)\s+(?P<start>.+)\s+(%s)\s+(?P<stop>.+)" %