Skip to content

edsnlp.pipelines.misc.dates.patterns.atomic.delimiters

raw_delimiters = ['\\/', '[-−]'] module-attribute

delimiters = raw_delimiters + ['\\.', '[^\\S]+'] module-attribute

raw_delimiter_pattern = make_pattern(raw_delimiters) module-attribute

raw_delimiter_with_spaces_pattern = make_pattern(raw_delimiters + ['[^\\S]+']) module-attribute

delimiter_pattern = make_pattern(delimiters) module-attribute

ante_num_pattern = '(?<!.(?:{raw_delimiter_pattern})|[.:%a-zA-Z]|[0-9][.:%][ ]?|[0-9][,]?)' module-attribute

post_num_pattern = '(?!{raw_delimiter_pattern}|[%a-zA-Z]|[ ]?[.:%][0-9]|[.,:]?[0-9])' module-attribute

ante_num_with_letter_pattern = '(?<!/|[.:%]|[0-9][-−.:%][ ]?|[0-9][,]?)' module-attribute

post_num_with_letter_pattern = '(?!/|[%]|[ ]?[-−.:%][0-9]|[.,:]?[0-9])' module-attribute