diff --git a/gramps/gen/datehandler/_date_cs.py b/gramps/gen/datehandler/_date_cs.py index 6b345f969..d89ff1c08 100644 --- a/gramps/gen/datehandler/_date_cs.py +++ b/gramps/gen/datehandler/_date_cs.py @@ -50,6 +50,15 @@ class DateParserCZ(DateParser): Converts a text string into a Date object """ + quality_to_int = { + 'přibližně' : Date.QUAL_ESTIMATED, + 'odhadem' : Date.QUAL_ESTIMATED, + 'odh.' : Date.QUAL_ESTIMATED, + 'vypočteno' : Date.QUAL_CALCULATED, + 'vypočtené' : Date.QUAL_CALCULATED, + 'vyp.' : Date.QUAL_CALCULATED, + } + bce = ["před naším letopočtem", "před Kristem", "př. n. l.", "př. Kr."] + DateParser.bce @@ -58,6 +67,17 @@ class DateParserCZ(DateParser): # bug 9739 grampslocale.py gets '%-d.%-m.%Y' -- makes it be '%/d.%/m.%Y' self.dhformat = self.dhformat.replace('/', '') # so counteract that + def init_strings(self): + DateParser.init_strings(self) + self._text2 = re.compile(r'(\d+)?\.?\s+?%s\.?\s*((\d+)(/\d+)?)?\s*$' + % self._mon_str, re.IGNORECASE) + self._span = re.compile( + r"(od)\s+(?P.+)\s+(do)\s+(?P.+)", + re.IGNORECASE) + self._range = re.compile( + r"(mezi)\s+(?P.+)\s+(a)\s+(?P.+)", + re.IGNORECASE) + #------------------------------------------------------------------------- # # Czech display