Package DateHandler :: Module _Date_pl :: Class DateParserPL
[frames] | no frames]

Class DateParserPL

source code


Instance Methods
 
init_strings(self)
This method compiles regular expression strings for matching dates.
source code

Inherited from _DateParser.DateParser: __init__, invert_year, match_bce, match_calendar, match_modifier, match_quality, match_range, match_span, parse, re_longest_first, set_date

Class Variables
  month_to_int = {u'10ber': 12, u'10bre': 12, u'10bris': 12, u'7...
  modifier_to_int = {u'ca.': 3, u'circa': 3, u'ok.': 3, u'około'...
  calendar_to_int = {u'franc.': 3, u'francuski republikański': 3...
  quality_to_int = {u'obl.': 2, u'obliczony': 2, u'szac.': 1, u'...
  bce = ['przed nasz\xc4\x85 er\xc4\x85', 'przed Chrystusem', 'p...

Inherited from _DateParser.DateParser: french_to_int, hebrew_to_int, islamic_to_int, modifier_after_to_int, persian_to_int

Method Details

init_strings(self)

source code 

This method compiles regular expression strings for matching dates.

Most of the re's in most languages can stay as is. span and range most likely will need to change. Whatever change is done, this method may be called first as DateParser.init_strings(self) so that the invariant expresions don't need to be repeteadly coded. All differences can be coded after DateParser.init_strings(self) call, that way they override stuff from this method. See DateParserRU() as an example.

Overrides: _DateParser.DateParser.init_strings
(inherited documentation)

Class Variable Details

month_to_int

Value:
{u'10ber': 12,
 u'10bre': 12,
 u'10bris': 12,
 u'7ber': 9,
 u'7bre': 9,
 u'7bris': 9,
 u'8ber': 10,
 u'8bre': 10,
...

modifier_to_int

Value:
{u'ca.': 3,
 u'circa': 3,
 u'ok.': 3,
 u'około': 3,
 u'po': 2,
 u'przed': 1}

calendar_to_int

Value:
{u'franc.': 3,
 u'francuski republikański': 3,
 u'greg.': 0,
 u'gregoriański': 0,
 u'hebr.': 2,
 u'hebrajski': 2,
 u'isl.': 5,
 u'islamski': 5,
...

quality_to_int

Value:
{u'obl.': 2, u'obliczony': 2, u'szac.': 1, u'szacowany': 1}

bce

Value:
['przed nasz\xc4\x85 er\xc4\x85',
 'przed Chrystusem',
 'p.n.e.',
 'B.C.E.',
 'B.C.E',
 'BCE',
 'B.C.',
 'B.C',
...