edsnlp.pipelines.misc.dates.patterns.relative
ago_pattern = 'il\\s+y\\s+a\\s+.{,10}?\\s+(heures?|jours?|semaines?|mois|ann[ée]es?|ans?)'
module-attribute
in_pattern = 'dans\\s+.{,10}?\\s+(heures?|jours?|semaines?|mois|ann[ée]es?|ans?)'
module-attribute
last_pattern = "l['ae]\\s*(semaine|année|an|mois)\\s+derni[èe]re?"
module-attribute
next_pattern = "l['ae]\\s*(semaine|année|an|mois)\\s+prochaine?"
module-attribute
since_pattern = '(?<=depuis\\s)\\s*.{,10}\\s+(heures?|jours?|semaines?|mois|ann[ée]es?|ans?)(\\s+derni[èe]re?)?'
module-attribute
during_pattern = '(pendant|pdt|pour)\\s+.{,10}?\\s+(heures?|jours?|mois|ann[ée]es?|ans?)'
module-attribute
week_patterns = ['(avant\\-?\\s*)?hier', '(apr[èe]s\\-?\\s*)?demain']
module-attribute
week_pattern = make_pattern(week_patterns, with_breaks=True)
module-attribute
relative_pattern = make_pattern(patterns=[ago_pattern, in_pattern, last_pattern, next_pattern, since_pattern, week_pattern], with_breaks=True)
module-attribute
Back to top