DateParserRU: suport 'до'

Add 'до' both as a Date.MOD_BEFORE modifier token
and as a span2 token (i.e., stop end for a Date.MOD_SPAN).

svn: r23174
This commit is contained in:
Vassilii Khachaturov 2013-09-20 12:41:33 +00:00
parent 6eebd80dfc
commit 0936aa37e8

View File

@ -52,6 +52,7 @@ class DateParserRU(DateParser):
modifier_to_int = {
'перед' : Date.MOD_BEFORE,
'по' : Date.MOD_BEFORE,
'до' : Date.MOD_BEFORE,
'после' : Date.MOD_AFTER,
'п.' : Date.MOD_AFTER,
'п' : Date.MOD_AFTER,
@ -219,7 +220,7 @@ class DateParserRU(DateParser):
def init_strings(self):
DateParser.init_strings(self)
_span_1 = ['с', 'от']
_span_2 = ['по']
_span_2 = ['по', 'до']
_range_1 = ['между', 'меж\.', 'меж']
_range_2 = ['и']
self._span = re.compile("(%s)\s+(?P<start>.+)\s+(%s)\s+(?P<stop>.+)" %