AmyOlex / Chrono

Parsing time normalizations from text.
GNU General Public License v3.0
15 stars 4 forks source link

AMPM is including periods in the span when it shouldn't be #39

Closed AmyOlex closed 6 years ago

AmyOlex commented 6 years ago

I found that AMPM is including periods when it shouldn't be. For example "9:00 AM." We keep periods to capture instances of "A.M." or "a.m.", but we don't want "AM." instances. I think I can fix this with a regular expression.

AmyOlex commented 6 years ago

We had "AM." and "am." in the list of valid AMPM values with their PM counterparts, so I removed these. Ok, our current implementation is based on intersection lists, but these lists do not capture all possible context that a valid AMPM could be found in. Thus I changed it to use regular expressions to identify the correct spans and now we are getting most of them correct!