-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed the "Fall" filter bug #752
Conversation
@@ -265,7 +265,7 @@ class NumericActions(seasonNormalizer: SeasonNormalizer, unitNormalizer: UnitNor | |||
val (seasonMentions, otherMentions) = mentions.partition(m => m.foundBy.contains("season")) | |||
val (springFall, otherSeasons) = seasonMentions.partition(m => m.text.equalsIgnoreCase("spring") || m.text.equalsIgnoreCase("fall")) | |||
val trueSeasons = springFall.filter { m => | |||
m.tags.head.contains("NN") && { | |||
m.tags.get.head.startsWith("NN") && { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
This encourages me to continue denoting Options by name (like tagsOpt) and wonder whether something like the TagSet class from Eidos should be ported. We probably shouldn't be using string operations for classifying tags.
val sd = TempEvalFormatter.mkDate(seasonNorm.get.startDay, seasonNorm.get.startMonth, yearStart) | ||
val ed = TempEvalFormatter.mkDate(seasonNorm.get.endDay, seasonNorm.get.endMonth, yearEnd) | ||
val dm = DateRangeMention(m, sd, ed) | ||
|
||
dm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somebody is going to sneak in here and give these variables real names ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:)
priority: ${ rulepriority } | ||
type: token | ||
pattern: | | ||
[word=/^(1\d|2\d|3\d|4\d|5\d|6\d|7\d|8\d|9\d)$/] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why this isn't [1-9]\d
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it should be. It started as just [1-2] and [8-9] then I incrementally expanded without optimizing. Please adjust!
Regular expression and variable names in numeric routines
Clean up after my own complaints
No description provided.