Skip to content

Commit

Permalink
Fixed: Remove SHORT_YEAR_RE
Browse files Browse the repository at this point in the history
This wasn't actually used anywhere!

Also removed a redundant regex group
  • Loading branch information
ahankinson committed Sep 12, 2024
1 parent 656f8ad commit add79bd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions edtf/natlang/en.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
DEFAULT_DATE_1 = datetime(1234, 1, 1, 0, 0)
DEFAULT_DATE_2 = datetime(5678, 10, 10, 0, 0)

SHORT_YEAR_RE = re.compile(r"(-?)([\du])([\dxu])([\dxu])([\dxu])")
LONG_YEAR_RE = re.compile(r"y(-?)([1-9]\d\d\d\d+)")
CENTURY_RE = re.compile(r"(\d{1,2})(c\.?|(st|nd|rd|th) century)\s?(ad|ce|bc|bce)?")
CENTURY_RANGE = re.compile(r"\b(\d\d)(th|st|nd|rd|)-(\d\d)(th|st|nd|rd) [cC]")
Expand All @@ -27,7 +26,7 @@
BEFORE_CHECK = re.compile(r"\b(?:before|earlier|avant)\b")
AFTER_CHECK = re.compile(r"\b(after|since|later|aprés|apres)\b")
APPROX_CHECK = re.compile(
r"\b(?:ca?\.? ?\d{4}|circa|approx|approximately|around|about|~\d{3,4})|(?:^~)"
r"\b(?:ca?\.? ?\d{4}|circa|approx|approximately|around|about|~\d{3,4})|^~"
)
UNCERTAIN_CHECK = re.compile(r"\b(?:uncertain|possibly|maybe|guess|\d{3,4}\?)")
UNCERTAIN_REPL = re.compile(r"(\d{4})\?")
Expand Down

0 comments on commit add79bd

Please sign in to comment.