Fix 4:23am returning 5:23am

Summary:
This is the easiest way to fix it, but talking offline
with Julien, we may need to revisit.
It basically gets rid of time series where we were
producing intervals that are not a multiply of the grain.

Reviewed By: patapizza

Differential Revision: D4841759

fbshipit-source-id: 1c4742a
This commit is contained in:
Bartosz Nitka 2017-04-06 10:50:34 -07:00 committed by Facebook Github Bot
parent 70ef9b1bbe
commit 290ca48e25
9 changed files with 491 additions and 442 deletions

View File

@ -183,7 +183,7 @@ classifiers
likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),
("at <time-of-day>",
Classifier{okData =
ClassData{prior = -0.15415067982725836,
ClassData{prior = -0.20972053098206903,
unseen = -4.276666119016055,
likelihoods =
HashMap.fromList
@ -202,14 +202,13 @@ classifiers
-3.56953269648137)],
n = 30},
koData =
ClassData{prior = -1.9459101490553135,
unseen = -3.0910424533583156,
ClassData{prior = -1.6650077635889111, unseen = -3.258096538021482,
likelihoods =
HashMap.fromList
[("time-of-day (latent)", -1.4350845252893227),
("<time-of-day> am|pm", -2.3513752571634776),
("hour", -1.252762968495368)],
n = 5}}),
[("time-of-day (latent)", -1.6094379124341003),
("<time-of-day> am|pm", -1.8325814637483102),
("hour", -1.4271163556401458), ("minute", -2.120263536200091)],
n = 7}}),
("absorption of , after named day",
Classifier{okData =
ClassData{prior = 0.0, unseen = -3.1780538303479458,
@ -355,236 +354,252 @@ classifiers
n = 1}}),
("intersect",
Classifier{okData =
ClassData{prior = -0.1371338199688892, unseen = -6.799055862058796,
ClassData{prior = -0.24751603072644626, unseen = -6.8001700683022,
likelihoods =
HashMap.fromList
[("intersect by ','named-month", -4.4953553199808844),
("hourday", -4.852030263919617),
("dayhour", -2.4804522994386202),
("daymonth", -3.332204510175204),
[("intersect by ','named-month", -4.49647076906475),
("hourday", -4.8531457130034825),
("dayhour", -2.481567748522486),
("daymonth", -3.3333199592590694),
("<day-of-month>(ordinal) <named-month> year<time-of-day> o'clock",
-6.104793232414985),
("monthyear", -4.4953553199808844),
("yearhour", -6.104793232414985),
("intersect<time-of-day> o'clock", -3.9647270689187146),
("christmasyear", -6.104793232414985),
("after lunchat <time-of-day>", -6.104793232414985),
("named-daylast <cycle>", -6.104793232414985),
("intersect by 'of', 'from', 'syear", -5.699328124306821),
("<time-of-day> am|pmintersect", -5.006180943746876),
("intersect<time> <part-of-day>", -4.02535169073515),
("<time-of-day> o'clockafter lunch", -5.4116460518550396),
-6.105908681498851),
("monthyear", -4.49647076906475),
("yearhour", -6.105908681498851),
("intersect<time-of-day> o'clock", -3.9658425180025803),
("christmasyear", -6.105908681498851),
("after lunchat <time-of-day>", -6.105908681498851),
("named-daylast <cycle>", -6.105908681498851),
("intersect by 'of', 'from', 'syear", -5.700443573390687),
("<time-of-day> am|pmintersect", -5.0072963928307415),
("intersect<time> <part-of-day>", -4.026467139819015),
("<time-of-day> o'clockafter lunch", -5.412761500938905),
("<time> <part-of-day><time-of-day> o'clock",
-6.104793232414985),
("today<time-of-day> o'clock", -6.104793232414985),
("<time-of-day> o'clockon <date>", -5.699328124306821),
("<time-of-day> am|pmintersect by ','", -5.4116460518550396),
("intersect by ','year", -5.699328124306821),
("on <date><time-of-day> o'clock", -6.104793232414985),
("exactly <time-of-day>tomorrow", -5.699328124306821),
("monthhour", -5.699328124306821),
-6.105908681498851),
("today<time-of-day> o'clock", -6.105908681498851),
("<time-of-day> o'clockon <date>", -5.700443573390687),
("<time-of-day> am|pmintersect by ','", -5.412761500938905),
("intersect by ','year", -5.700443573390687),
("on <date><time-of-day> o'clock", -6.105908681498851),
("exactly <time-of-day>tomorrow", -5.700443573390687),
("monthhour", -5.700443573390687),
("on <date>between <datetime> and <datetime> (interval)",
-6.104793232414985),
("last <day-of-week> of <time>year", -6.104793232414985),
("hourmonth", -5.699328124306821),
("todayat <time-of-day>", -5.4116460518550396),
-6.105908681498851),
("last <day-of-week> of <time>year", -6.105908681498851),
("hourmonth", -5.700443573390687),
("todayat <time-of-day>", -5.412761500938905),
("on <date>between <time-of-day> and <time-of-day> (interval)",
-6.104793232414985),
("on <date>at <time-of-day>", -5.699328124306821),
("named-dayhh:mm", -6.104793232414985),
("dayday", -3.187022500330706),
("<time> <part-of-day>at <time-of-day>", -5.699328124306821),
-6.105908681498851),
("on <date>at <time-of-day>", -5.700443573390687),
("named-dayhh:mm", -6.105908681498851),
("dayday", -3.1881379494145716),
("<time> <part-of-day>at <time-of-day>", -5.700443573390687),
("<time-of-day> am|pmabsorption of , after named day",
-6.104793232414985),
("about <time-of-day>on <date>", -6.104793232414985),
-6.105908681498851),
("about <time-of-day>on <date>", -6.105908681498851),
("<hour-of-day> <integer> (as relative minutes)in|during the <part-of-day>",
-5.699328124306821),
("<day-of-month> (ordinal)intersect", -5.18850250054083),
("hourhour", -3.57906458810673),
("<part-of-day> of <time>named-month", -5.699328124306821),
("hh:mmintersect by ','", -4.852030263919617),
("intersectnamed-month", -3.332204510175204),
("dayyear", -3.907568655078766),
-5.700443573390687),
("<day-of-month> (ordinal)intersect", -5.1896179496246955),
("hourhour", -3.5801800371905954),
("<part-of-day> of <time>named-month", -5.700443573390687),
("hh:mmintersect by ','", -4.8531457130034825),
("intersectnamed-month", -3.3333199592590694),
("dayyear", -3.9086841041626315),
("<time-of-day> o'clockin|during the <part-of-day>",
-5.006180943746876),
("tomorrow<time-of-day> o'clock", -6.104793232414985),
("<time-of-day> o'clocktomorrow", -5.4116460518550396),
-5.0072963928307415),
("tomorrow<time-of-day> o'clock", -6.105908681498851),
("<time-of-day> o'clocktomorrow", -5.412761500938905),
("<day-of-month>(ordinal) <named-month>year",
-6.104793232414985),
-6.105908681498851),
("half <integer> (german style hour-of-day)after lunch",
-6.104793232414985),
-6.105908681498851),
("absorption of , after named day<day-of-month>(ordinal) <named-month>",
-5.006180943746876),
("hourminute", -5.4116460518550396),
-5.0072963928307415),
("hourminute", -5.412761500938905),
("on <date><day-of-month>(ordinal) <named-month>",
-5.699328124306821),
("minutemonth", -3.430644582988456),
("minutehour", -3.85350143380849),
("named-day<time> timezone", -6.104793232414985),
-5.700443573390687),
("minutemonth", -3.431760032072322),
("minutehour", -3.8546168828923557),
("named-day<time> timezone", -6.105908681498851),
("at <time-of-day>in|during the <part-of-day>",
-5.18850250054083),
("named-monthyear", -4.4953553199808844),
-5.1896179496246955),
("named-monthyear", -4.49647076906475),
("absorption of , after named day<day-of-month>(ordinal) <named-month> year",
-6.104793232414985),
-6.105908681498851),
("absorption of , after named day<named-month> <day-of-month> (non ordinal)",
-5.006180943746876),
-5.0072963928307415),
("named-day<time-of-day> - <time-of-day> (interval)",
-6.104793232414985),
-6.105908681498851),
("<day-of-month>(ordinal) <named-month> year<time> <part-of-day>",
-6.104793232414985),
-6.105908681498851),
("<hour-of-day> <integer> (as relative minutes)after lunch",
-6.104793232414985),
-6.105908681498851),
("named-day<datetime> - <datetime> (interval)",
-6.104793232414985),
("on <date>named-month", -5.18850250054083),
-6.105908681498851),
("on <date>named-month", -5.1896179496246955),
("intersect<day-of-month>(ordinal) <named-month>",
-4.718498871295094),
-4.71961432037896),
("this <part-of-day><time-of-day> o'clock",
-6.104793232414985),
-6.105908681498851),
("<day-of-month>(ordinal) <named-month>intersect",
-6.104793232414985),
("hh:mmintersect", -3.6624461970457807),
-6.105908681498851),
("hh:mmintersect", -3.6635616461296463),
("named-dayfrom <datetime> - <datetime> (interval)",
-5.699328124306821),
("named-daynext <cycle>", -6.104793232414985),
-5.700443573390687),
("named-daynext <cycle>", -6.105908681498851),
("named-dayfrom <time-of-day> - <time-of-day> (interval)",
-5.4116460518550396),
("<day-of-month> (ordinal)named-day", -5.699328124306821),
("intersect by ','intersect", -5.006180943746876),
-5.412761500938905),
("<day-of-month> (ordinal)named-day", -5.700443573390687),
("intersect by ','intersect", -5.0072963928307415),
("half <integer> (german style hour-of-day)in|during the <part-of-day>",
-5.699328124306821),
("at <time-of-day>intersect", -4.31303376318693),
-5.700443573390687),
("at <time-of-day>intersect", -4.314149212270796),
("on <date>from <time-of-day> - <time-of-day> (interval)",
-5.699328124306821),
-5.700443573390687),
("<time> <part-of-day>from <time-of-day> - <time-of-day> (interval)",
-6.104793232414985),
-6.105908681498851),
("absorption of , after named day<day-of-month> (ordinal)",
-5.006180943746876),
("dayminute", -3.907568655078766),
-5.0072963928307415),
("dayminute", -3.9086841041626315),
("on <date>from <datetime> - <datetime> (interval)",
-6.104793232414985),
-6.105908681498851),
("<time> <part-of-day>from <datetime> - <datetime> (interval)",
-6.104793232414985),
("intersectyear", -4.852030263919617),
("on <date>intersect", -5.699328124306821),
("on <date><day-of-month> (ordinal)", -5.699328124306821),
("<ordinal> <cycle> of <time>year", -6.104793232414985),
("minuteday", -2.125111578513024),
-6.105908681498851),
("intersectyear", -4.8531457130034825),
("on <date>intersect", -5.700443573390687),
("on <date><day-of-month> (ordinal)", -5.700443573390687),
("<ordinal> <cycle> of <time>year", -6.105908681498851),
("minuteday", -2.1262270275968898),
("absorption of , after named dayintersect",
-3.9647270689187146),
-3.9658425180025803),
("named-daybetween <time-of-day> and <time-of-day> (interval)",
-6.104793232414985),
-6.105908681498851),
("<datetime> - <datetime> (interval)named-month",
-5.699328124306821),
("year<time-of-day> o'clock", -6.104793232414985),
("at <time-of-day>intersect by ','", -5.4116460518550396),
("named-dayat <time-of-day>", -5.699328124306821),
("hh:mmabsorption of , after named day", -5.699328124306821),
("<time-of-day> am|pmnamed-day", -6.104793232414985),
("intersect by ','<time> <part-of-day>", -5.18850250054083),
("hh:mmon <date>", -3.6624461970457807),
-5.700443573390687),
("year<time-of-day> o'clock", -6.105908681498851),
("at <time-of-day>intersect by ','", -5.412761500938905),
("named-dayat <time-of-day>", -5.700443573390687),
("hh:mmabsorption of , after named day", -5.700443573390687),
("<time-of-day> am|pmnamed-day", -6.105908681498851),
("intersect by ','<time> <part-of-day>", -5.1896179496246955),
("hh:mmon <date>", -3.6635616461296463),
("named-daybetween <datetime> and <datetime> (interval)",
-6.104793232414985),
-6.105908681498851),
("at <time-of-day>absorption of , after named day",
-6.104793232414985),
("until <time-of-day>after lunch", -6.104793232414985),
("mm/ddyear", -6.104793232414985),
("intersect by ','<time-of-day> o'clock", -5.18850250054083),
("intersect<day-of-month> (ordinal)", -4.718498871295094),
("named-day<time-of-day> o'clock", -6.104793232414985),
-6.105908681498851),
("until <time-of-day>after lunch", -6.105908681498851),
("mm/ddyear", -6.105908681498851),
("intersect by ','<time-of-day> o'clock", -5.1896179496246955),
("intersect<day-of-month> (ordinal)", -4.71961432037896),
("named-day<time-of-day> o'clock", -6.105908681498851),
("<day-of-month> (ordinal)intersect by 'of', 'from', 's",
-5.4116460518550396),
("at <time-of-day>on <date>", -4.232991055513394),
("intersectintersect", -4.02535169073515),
("dayweek", -5.006180943746876),
("weekyear", -5.699328124306821),
("hh:mmin|during the <part-of-day>", -5.18850250054083),
("named-monthintersect", -6.104793232414985),
("<day-of-month> (ordinal)named-month", -4.40004514017656),
("tomorrowat <time-of-day>", -5.699328124306821),
-5.412761500938905),
("at <time-of-day>on <date>", -4.23410650459726),
("intersectintersect", -4.026467139819015),
("dayweek", -5.0072963928307415),
("weekyear", -5.700443573390687),
("hh:mmin|during the <part-of-day>", -5.1896179496246955),
("named-monthintersect", -6.105908681498851),
("<day-of-month> (ordinal)named-month", -4.401160589260425),
("tomorrowat <time-of-day>", -5.700443573390687),
("<hour-of-day> <integer> (as relative minutes)on <date>",
-6.104793232414985),
("named-daythis <cycle>", -5.4116460518550396),
("at <time-of-day>tomorrow", -6.104793232414985),
-6.105908681498851),
("named-daythis <cycle>", -5.412761500938905),
("at <time-of-day>tomorrow", -6.105908681498851),
("about <time-of-day>in|during the <part-of-day>",
-5.699328124306821),
-5.700443573390687),
("half <integer> (german style hour-of-day)on <date>",
-6.104793232414985),
("this <part-of-day>at <time-of-day>", -5.699328124306821),
-6.105908681498851),
("this <part-of-day>at <time-of-day>", -5.700443573390687),
("after lunch<hour-of-day> <integer> (as relative minutes)",
-5.699328124306821),
("last <cycle> of <time>year", -5.699328124306821),
-5.700443573390687),
("last <cycle> of <time>year", -5.700443573390687),
("<named-month> <day-of-month> (non ordinal)year",
-6.104793232414985),
-6.105908681498851),
("<day-of-month> (non ordinal) <named-month>year",
-6.104793232414985)],
-6.105908681498851)],
n = 381},
koData =
ClassData{prior = -2.0545815043604407,
unseen = -5.5093883366279774,
ClassData{prior = -1.517486571391241, unseen = -5.857933154483459,
likelihoods =
HashMap.fromList
[("named-day<part-of-day> of <time>", -4.812184355372417),
("dayhour", -4.119037174812472),
("daymonth", -2.940382178470826),
("monthday", -4.406719247264253),
("monthyear", -4.812184355372417),
("yearhour", -4.812184355372417),
("after lunchat <time-of-day>", -4.406719247264253),
("intersect by 'of', 'from', 'syear", -4.119037174812472),
("intersect<time> <part-of-day>", -4.812184355372417),
("<time-of-day> o'clockafter lunch", -4.812184355372417),
("<day-of-month> (ordinal)year", -4.812184355372417),
("after lunch<time-of-day> o'clock", -4.812184355372417),
[("intersect by ','named-month", -4.468777561082536),
("named-day<part-of-day> of <time>", -5.161924741642482),
("dayhour", -4.468777561082536),
("daymonth", -3.2901225647408903),
("monthday", -4.756459633534318),
("monthyear", -5.161924741642482),
("yearhour", -5.161924741642482),
("after lunchat <time-of-day>", -4.756459633534318),
("intersect by 'of', 'from', 'syear", -4.468777561082536),
("<time-of-day> am|pmintersect", -3.457176649404057),
("intersect<time> <part-of-day>", -5.161924741642482),
("<time-of-day> o'clockafter lunch", -5.161924741642482),
("<day-of-month> (ordinal)year", -5.161924741642482),
("after lunch<time-of-day> o'clock", -5.161924741642482),
("at <time-of-day>named-day", -5.161924741642482),
("<time-of-day> am|pmintersect by ','", -3.909161773147114),
("<time-of-day> o'clock<time> <part-of-day>",
-3.8958936234982624),
("monthhour", -4.812184355372417),
-4.2456340097683265),
("monthhour", -5.161924741642482),
("on <date>between <datetime> and <datetime> (interval)",
-4.812184355372417),
("todayat <time-of-day>", -4.812184355372417),
-5.161924741642482),
("todayat <time-of-day>", -5.161924741642482),
("on <date>between <time-of-day> and <time-of-day> (interval)",
-4.812184355372417),
("named-dayhh:mm", -4.812184355372417),
("dayday", -3.5594213868770495),
("hourhour", -3.3081069585961433),
("dayyear", -3.713572066704308),
("minutemonth", -4.812184355372417),
("named-monthyear", -4.812184355372417),
-5.161924741642482),
("named-dayhh:mm", -5.161924741642482),
("dayday", -3.909161773147114),
("<time-of-day> am|pmabsorption of , after named day",
-4.756459633534318),
("hourhour", -3.657847344866208),
("intersectnamed-month", -3.5524868292083815),
("dayyear", -4.0633124529743725),
("minutemonth", -3.2160145925871686),
("named-monthyear", -5.161924741642482),
("named-day<time-of-day> - <time-of-day> (interval)",
-4.812184355372417),
("on <date>named-month", -4.812184355372417),
-5.161924741642482),
("on <date>named-month", -5.161924741642482),
("absorption of , after named daynamed-month",
-3.713572066704308),
("named-dayafter <time-of-day>", -4.406719247264253),
-4.0633124529743725),
("intersect<day-of-month>(ordinal) <named-month>",
-4.468777561082536),
("named-dayafter <time-of-day>", -4.756459633534318),
("named-dayfrom <datetime> - <datetime> (interval)",
-4.406719247264253),
-4.756459633534318),
("<hour-of-day> <integer> (as relative minutes)named-month",
-4.812184355372417),
-5.161924741642482),
("named-dayfrom <time-of-day> - <time-of-day> (interval)",
-4.119037174812472),
("<day-of-month> (ordinal)named-day", -4.119037174812472),
-4.468777561082536),
("<day-of-month> (ordinal)named-day", -4.468777561082536),
("at <time-of-day>intersect", -4.0633124529743725),
("on <date>from <time-of-day> - <time-of-day> (interval)",
-4.406719247264253),
("dayminute", -2.6721181918761467),
-4.756459633534318),
("dayminute", -3.0218585781462113),
("on <date>from <datetime> - <datetime> (interval)",
-4.812184355372417),
-5.161924741642482),
("minuteday", -2.1661924680884908),
("named-daybetween <time-of-day> and <time-of-day> (interval)",
-4.812184355372417),
-5.161924741642482),
("at <time-of-day>intersect by ','", -4.468777561082536),
("<time-of-day> am|pmnamed-day", -4.756459633534318),
("named-daybetween <datetime> and <datetime> (interval)",
-4.812184355372417),
-5.161924741642482),
("at <time-of-day>absorption of , after named day",
-5.161924741642482),
("named-month<day-of-month> (non ordinal) <named-month>",
-4.406719247264253),
("year<time> <part-of-day>", -4.812184355372417),
-4.756459633534318),
("year<time> <part-of-day>", -5.161924741642482),
("intersect<day-of-month> (ordinal)", -4.468777561082536),
("<day-of-month> (ordinal)intersect by 'of', 'from', 's",
-4.406719247264253),
-4.756459633534318),
("<named-month> <day-of-month> (non ordinal)named-month",
-4.406719247264253),
("<day-of-month> (ordinal)named-month", -4.119037174812472),
("until <time-of-day>named-month", -4.812184355372417),
("after <time-of-day>year", -4.812184355372417),
("on <date>after <time-of-day>", -4.812184355372417),
("tomorrownoon", -4.812184355372417)],
n = 56}}),
-4.756459633534318),
("intersectintersect", -4.468777561082536),
("<day-of-month> (ordinal)named-month", -4.468777561082536),
("until <time-of-day>named-month", -5.161924741642482),
("after <time-of-day>year", -5.161924741642482),
("on <date>after <time-of-day>", -5.161924741642482),
("tomorrownoon", -5.161924741642482)],
n = 107}}),
("<ordinal> <cycle> of <time>",
Classifier{okData =
ClassData{prior = 0.0, unseen = -2.4849066497880004,
@ -993,7 +1008,7 @@ classifiers
n = 2}}),
("time-of-day (latent)",
Classifier{okData =
ClassData{prior = -0.7972874398125422,
ClassData{prior = -0.8082165103447325,
unseen = -3.8066624897703196,
likelihoods =
HashMap.fromList
@ -1001,14 +1016,13 @@ classifiers
("integer (0..19)", -2.174751721484161)],
n = 41},
koData =
ClassData{prior = -0.5988365010887039,
unseen = -3.9889840465642745,
ClassData{prior = -0.5899629443247145, unseen = -4.007333185232471,
likelihoods =
HashMap.fromList
[("integer (numeric)", -0.6029960835656478),
("integer (0..19)", -0.9257694758286987),
("couple", -2.871679624884012)],
n = 50}}),
[("integer (numeric)", -0.587786664902119),
("integer (0..19)", -0.9444616088408514),
("couple", -2.890371757896165)],
n = 51}}),
("year",
Classifier{okData =
ClassData{prior = 0.0, unseen = -2.833213344056216,
@ -1086,7 +1100,7 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("<time-of-day> am|pm",
Classifier{okData =
ClassData{prior = -1.3862943611198906, unseen = -2.833213344056216,
ClassData{prior = -1.845826690498331, unseen = -2.833213344056216,
likelihoods =
HashMap.fromList
[("time-of-day (latent)", -2.0794415416798357),
@ -1095,19 +1109,21 @@ classifiers
("hour", -1.6739764335716716), ("minute", -2.0794415416798357)],
n = 3},
koData =
ClassData{prior = -0.2876820724517809, unseen = -3.367295829986474,
ClassData{prior = -0.17185025692665928,
unseen = -3.7612001156935624,
likelihoods =
HashMap.fromList
[("at <time-of-day>", -2.639057329615259),
("<time-of-day> o'clock", -1.9459101490553135),
[("at <time-of-day>", -2.3513752571634776),
("<time-of-day> o'clock", -2.3513752571634776),
("half <integer> (german style hour-of-day)",
-2.639057329615259),
("about <time-of-day>", -2.639057329615259),
("time-of-day (latent)", -2.2335922215070942),
("hour", -1.252762968495368), ("minute", -2.2335922215070942),
-3.044522437723423),
("about <time-of-day>", -3.044522437723423),
("time-of-day (latent)", -2.128231705849268),
("hh:mm", -2.3513752571634776), ("hour", -1.4350845252893227),
("minute", -1.6582280766035324),
("<hour-of-day> <integer> (as relative minutes)",
-2.639057329615259)],
n = 9}}),
-3.044522437723423)],
n = 16}}),
("<duration> after <time>",
Classifier{okData =
ClassData{prior = 0.0, unseen = -2.0794415416798357,
@ -1192,7 +1208,7 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("intersect by ','",
Classifier{okData =
ClassData{prior = -0.10536051565782628,
ClassData{prior = -0.27087495413539975,
unseen = -4.6913478822291435,
likelihoods =
HashMap.fromList
@ -1220,12 +1236,18 @@ classifiers
-3.9889840465642745)],
n = 45},
koData =
ClassData{prior = -2.3025850929940455, unseen = -3.367295829986474,
ClassData{prior = -1.4384801142904609,
unseen = -3.8501476017100584,
likelihoods =
HashMap.fromList
[("named-daynamed-month", -1.540445040947149),
("daymonth", -1.540445040947149)],
n = 5}}),
[("named-daynamed-month", -2.03688192726104),
("daymonth", -2.03688192726104),
("intersect<day-of-month>(ordinal) <named-month>",
-2.4423470353692043),
("minuteday", -1.5260563034950494),
("intersect<day-of-month> (ordinal)", -2.4423470353692043),
("intersectintersect", -2.4423470353692043)],
n = 14}}),
("second (grain)",
Classifier{okData =
ClassData{prior = 0.0, unseen = -1.9459101490553135,

View File

@ -59,12 +59,11 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("integer (numeric)",
Classifier{okData =
ClassData{prior = -0.8291589382428, unseen = -5.030437921392435,
ClassData{prior = -0.840653317668535, unseen = -5.030437921392435,
likelihoods = HashMap.fromList [("", 0.0)], n = 151},
koData =
ClassData{prior = -0.5734392164939774,
unseen = -5.2832037287379885,
likelihoods = HashMap.fromList [("", 0.0)], n = 195}}),
ClassData{prior = -0.5646283297589669, unseen = -5.303304908059076,
likelihoods = HashMap.fromList [("", 0.0)], n = 199}}),
("<duration> hence|ago",
Classifier{okData =
ClassData{prior = 0.0, unseen = -3.784189633918261,
@ -234,30 +233,29 @@ classifiers
likelihoods = HashMap.fromList [("", 0.0)], n = 13}}),
("at <time-of-day>",
Classifier{okData =
ClassData{prior = -9.352605801082348e-2,
unseen = -4.736198448394496,
ClassData{prior = -0.10919929196499197,
unseen = -4.7535901911063645,
likelihoods =
HashMap.fromList
[("noon|midnight|EOD|end of day", -3.628775530044231),
("integer after|past <hour-of-day>", -3.628775530044231),
("half after|past <hour-of-day>", -4.034240638152395),
("time-of-day (latent)", -1.7829488395459),
("hhmm (latent)", -3.34109345759245),
("<time-of-day> am|pm", -1.7316555451583495),
("hh:mm", -3.34109345759245),
("about|exactly <time-of-day>", -3.628775530044231),
("hour", -1.1438688802562307),
("<time-of-day> sharp|exactly", -4.034240638152395),
("minute", -1.8941744746561244)],
n = 51},
[("noon|midnight|EOD|end of day", -3.6463198396951406),
("integer after|past <hour-of-day>", -3.6463198396951406),
("half after|past <hour-of-day>", -4.051784947803305),
("time-of-day (latent)", -1.8004931491968097),
("hhmm (latent)", -3.3586377672433594),
("<time-of-day> am|pm", -1.749199854809259),
("hh:mm", -3.1354942159291497),
("about|exactly <time-of-day>", -3.6463198396951406),
("hour", -1.16141318990714),
("<time-of-day> sharp|exactly", -4.051784947803305),
("minute", -1.8545603704670852)],
n = 52},
koData =
ClassData{prior = -2.4159137783010487,
unseen = -3.0910424533583156,
ClassData{prior = -2.268683541318364, unseen = -3.1780538303479458,
likelihoods =
HashMap.fromList
[("time-of-day (latent)", -1.252762968495368),
("hour", -1.252762968495368)],
n = 5}}),
[("time-of-day (latent)", -1.1895840668738362),
("hour", -1.1895840668738362)],
n = 6}}),
("absorption of , after named day",
Classifier{okData =
ClassData{prior = 0.0, unseen = -3.332204510175204,
@ -1256,20 +1254,19 @@ classifiers
n = 1}}),
("time-of-day (latent)",
Classifier{okData =
ClassData{prior = -0.587786664902119, unseen = -4.143134726391533,
ClassData{prior = -0.6330432564902398, unseen = -4.143134726391533,
likelihoods =
HashMap.fromList
[("integer (numeric)", -0.10178269430994236),
("integer (0..19)", -2.3353749158170367)],
n = 60},
koData =
ClassData{prior = -0.8109302162163288,
unseen = -3.9318256327243257,
ClassData{prior = -0.7570959051602187, unseen = -4.02535169073515,
likelihoods =
HashMap.fromList
[("integer (numeric)", -0.1743533871447778),
("integer (0..19)", -1.8325814637483102)],
n = 48}}),
[("integer (numeric)", -0.15718558352241238),
("integer (0..19)", -1.927891643552635)],
n = 53}}),
("year",
Classifier{okData =
ClassData{prior = -0.2231435513142097,
@ -1351,34 +1348,35 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("<time-of-day> am|pm",
Classifier{okData =
ClassData{prior = -0.2696635669491026, unseen = -5.220355825078324,
ClassData{prior = -0.29354719190417905,
unseen = -5.231108616854587,
likelihoods =
HashMap.fromList
[("integer after|past <hour-of-day>", -3.828641396489095),
("at <time-of-day>", -2.2192034840549946),
("<time-of-day> o'clock", -4.116323468940876),
("half after|past <hour-of-day>", -4.116323468940876),
("time-of-day (latent)", -1.749199854809259),
("hhmm (latent)", -4.5217885770490405),
("hh:mm", -2.2192034840549946),
("quarter after|past <hour-of-day>", -4.5217885770490405),
("about|exactly <time-of-day>", -4.5217885770490405),
("until <time-of-day>", -3.828641396489095),
("hour", -1.28311012488466),
("<time-of-day> sharp|exactly", -4.5217885770490405),
("minute", -1.659587696119572),
("after <time-of-day>", -4.5217885770490405)],
n = 84},
[("integer after|past <hour-of-day>", -3.8394523125933104),
("at <time-of-day>", -2.2300144001592104),
("<time-of-day> o'clock", -4.127134385045092),
("half after|past <hour-of-day>", -4.127134385045092),
("time-of-day (latent)", -1.7600107709134747),
("hhmm (latent)", -4.532599493153256),
("hh:mm", -2.181224235989778),
("quarter after|past <hour-of-day>", -4.532599493153256),
("about|exactly <time-of-day>", -4.532599493153256),
("until <time-of-day>", -3.8394523125933104),
("hour", -1.2939210409888755),
("<time-of-day> sharp|exactly", -4.532599493153256),
("minute", -1.6422277352570913),
("after <time-of-day>", -4.532599493153256)],
n = 85},
koData =
ClassData{prior = -1.4423838277709342, unseen = -4.23410650459726,
ClassData{prior = -1.3689026184080213, unseen = -4.31748811353631,
likelihoods =
HashMap.fromList
[("<integer> to|till|before <hour-of-day>", -3.120895416507997),
("<hour-of-day> <integer>", -3.5263605246161616),
("time-of-day (latent)", -1.0840134892469568),
("hour", -1.041453874828161), ("minute", -2.833213344056216),
("after <time-of-day>", -3.5263605246161616)],
n = 26}}),
[("<integer> to|till|before <hour-of-day>", -3.20545280453606),
("<hour-of-day> <integer>", -3.6109179126442243),
("time-of-day (latent)", -1.0459685551826876),
("hour", -1.0082282271998406), ("minute", -2.917770732084279),
("after <time-of-day>", -3.6109179126442243)],
n = 29}}),
("Thanksgiving Day",
Classifier{okData =
ClassData{prior = 0.0, unseen = -2.1972245773362196,
@ -1413,11 +1411,12 @@ classifiers
n = 7}}),
("hh:mm",
Classifier{okData =
ClassData{prior = -5.6089466651043585e-2,
unseen = -3.9889840465642745,
likelihoods = HashMap.fromList [("", 0.0)], n = 52},
ClassData{prior = -5.406722127027582e-2,
unseen = -4.02535169073515,
likelihoods = HashMap.fromList [("", 0.0)], n = 54},
koData =
ClassData{prior = -2.908720896564361, unseen = -1.6094379124341003,
ClassData{prior = -2.9444389791664407,
unseen = -1.6094379124341003,
likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),
("quarter of an hour",
Classifier{okData =
@ -1887,7 +1886,7 @@ classifiers
n = 1}}),
("<time-of-day> - <time-of-day> (interval)",
Classifier{okData =
ClassData{prior = -0.8574502318512216,
ClassData{prior = -0.8873031950009028,
unseen = -3.7376696182833684,
likelihoods =
HashMap.fromList
@ -1898,24 +1897,25 @@ classifiers
("<time-of-day> am|pm<time-of-day> am|pm", -2.327277705584417)],
n = 14},
koData =
ClassData{prior = -0.5520685823000397, unseen = -3.951243718581427,
ClassData{prior = -0.5306282510621704,
unseen = -3.9889840465642745,
likelihoods =
HashMap.fromList
[("about|exactly <time-of-day>time-of-day (latent)",
-3.2386784521643803),
("hh:mmtime-of-day (latent)", -1.5339303599259553),
("hh:mm<time-of-day> am|pm", -2.833213344056216),
-3.2771447329921766),
("hh:mmtime-of-day (latent)", -1.5723966407537513),
("hh:mm<time-of-day> am|pm", -2.871679624884012),
("<time-of-day> am|pmtime-of-day (latent)",
-3.2386784521643803),
("at <time-of-day><time-of-day> am|pm", -3.2386784521643803),
("hourhour", -2.1400661634962708),
("minutehour", -1.2237754316221157),
-3.2771447329921766),
("at <time-of-day><time-of-day> am|pm", -3.2771447329921766),
("hourhour", -2.0243817644968085),
("minutehour", -1.262241712449912),
("about|exactly <time-of-day><time-of-day> am|pm",
-3.2386784521643803),
("at <time-of-day>time-of-day (latent)", -3.2386784521643803),
-3.2771447329921766),
("at <time-of-day>time-of-day (latent)", -2.871679624884012),
("<integer> to|till|before <hour-of-day>time-of-day (latent)",
-2.833213344056216)],
n = 19}}),
-2.871679624884012)],
n = 20}}),
("nth <time> after <time>",
Classifier{okData =
ClassData{prior = -0.6931471805599453, unseen = -1.791759469228055,

View File

@ -326,63 +326,66 @@ classifiers
n = 4}}),
("intersect",
Classifier{okData =
ClassData{prior = -0.23483959107740107,
unseen = -4.624972813284271,
ClassData{prior = -0.2578291093020998,
unseen = -4.6443908991413725,
likelihoods =
HashMap.fromList
[("<day-of-month> de <named-month>in the <part-of-day>",
-3.9219733362813143),
("dayhour", -1.9760631872260008),
("tomorrowin the <part-of-day>", -3.9219733362813143),
-3.9415818076696905),
("dayhour", -1.9956716586143772),
("tomorrowin the <part-of-day>", -3.9415818076696905),
("el <day-of-month> de <named-month>in the <part-of-day>",
-3.9219733362813143),
("hourhour", -3.005682604407159),
-3.9415818076696905),
("hourhour", -3.0252910757955354),
("now<hour-of-day> minus quarter (as relative minutes)",
-3.9219733362813143),
("dayyear", -3.005682604407159),
-3.9415818076696905),
("dayyear", -3.0252910757955354),
("a las <time-of-day>in the <part-of-day>",
-2.6692103677859462),
("intersectin the <part-of-day>", -3.9219733362813143),
("<named-month> <day-of-month>del <year>", -3.9219733362813143),
("minutehour", -2.312535423847214),
("intersect by `de`in the <part-of-day>", -3.9219733362813143),
-2.6888188391743224),
("intersectin the <part-of-day>", -3.9415818076696905),
("<named-month> <day-of-month>del <year>", -3.9415818076696905),
("minutehour", -2.33214389523559),
("intersect by `de`in the <part-of-day>", -3.9415818076696905),
("now<hour-of-day> and <relative minutes>",
-3.9219733362813143),
-3.9415818076696905),
("<hour-of-day> and halfin the <part-of-day>",
-3.5165082281731497),
("named-dayin the <part-of-day>", -3.9219733362813143),
("tomorrowa las <time-of-day>", -3.5165082281731497),
("named-daya las <time-of-day>", -3.9219733362813143),
("named-dayintersect", -3.9219733362813143),
("dayminute", -3.005682604407159),
("<named-month> <day-of-month>el <time>", -3.9219733362813143),
("named-day<dim time> de la manana", -3.9219733362813143),
("el <time>in the <part-of-day>", -3.9219733362813143),
("named-day<time-of-day> <part-of-day>", -3.9219733362813143),
("dd[/-]mmyear", -3.5165082281731497),
("nowa las <time-of-day>", -3.5165082281731497),
-3.536116699561526),
("named-dayin the <part-of-day>", -3.9415818076696905),
("tomorrowa las <time-of-day>", -3.536116699561526),
("named-daya las <time-of-day>", -3.9415818076696905),
("named-dayintersect", -3.9415818076696905),
("dayminute", -3.0252910757955354),
("<named-month> <day-of-month>el <time>", -3.9415818076696905),
("named-day<dim time> de la manana", -3.9415818076696905),
("el <time>in the <part-of-day>", -3.9415818076696905),
("named-day<time-of-day> <part-of-day>", -3.9415818076696905),
("dd[/-]mmyear", -3.536116699561526),
("nowa las <time-of-day>", -3.536116699561526),
("<hour-of-day> and quarterin the <part-of-day>",
-3.005682604407159),
("yesterdayin the <part-of-day>", -3.9219733362813143)],
-3.0252910757955354),
("yesterdayin the <part-of-day>", -3.9415818076696905)],
n = 34},
koData =
ClassData{prior = -1.563975538357343, unseen = -3.951243718581427,
ClassData{prior = -1.4816045409242156, unseen = -4.02535169073515,
likelihoods =
HashMap.fromList
[("dayhour", -2.5455312716044354),
[("hourday", -3.3141860046725258),
("dayhour", -2.6210388241125804),
("<day-of-month> de <named-month>a las <time-of-day>",
-3.2386784521643803),
("monthhour", -2.833213344056216),
-3.3141860046725258),
("<time-of-day> am|pm<day-of-month> de <named-month>",
-3.3141860046725258),
("monthhour", -2.908720896564361),
("now<hour-of-day> and <relative minutes>",
-3.2386784521643803),
("dayminute", -2.833213344056216),
("named-monthin the <part-of-day>", -3.2386784521643803),
("named-montha las <time-of-day>", -3.2386784521643803),
("nowa las <time-of-day>", -2.5455312716044354),
-3.3141860046725258),
("dayminute", -2.908720896564361),
("named-monthin the <part-of-day>", -3.3141860046725258),
("named-montha las <time-of-day>", -3.3141860046725258),
("nowa las <time-of-day>", -2.6210388241125804),
("<hour-of-day> <integer> (as relative minutes)year",
-2.833213344056216),
("minuteyear", -2.833213344056216)],
n = 9}}),
-2.908720896564361),
("minuteyear", -2.908720896564361)],
n = 10}}),
("a las <time-of-day>",
Classifier{okData =
ClassData{prior = -8.338160893905101e-2,
@ -660,7 +663,7 @@ classifiers
likelihoods = HashMap.fromList [("", 0.0)], n = 2}}),
("time-of-day (latent)",
Classifier{okData =
ClassData{prior = -0.30368241379822203,
ClassData{prior = -0.3272129112084162,
unseen = -3.5263605246161616,
likelihoods =
HashMap.fromList
@ -668,12 +671,12 @@ classifiers
("number (0..15)", -0.3610133455373305)],
n = 31},
koData =
ClassData{prior = -1.3397743454849977, unseen = -2.639057329615259,
ClassData{prior = -1.276293465905562, unseen = -2.70805020110221,
likelihoods =
HashMap.fromList
[("integer (numeric)", -0.3677247801253174),
("number (0..15)", -1.1786549963416462)],
n = 11}}),
[("integer (numeric)", -0.3364722366212129),
("number (0..15)", -1.252762968495368)],
n = 12}}),
("<hour-of-day> and <relative minutes>",
Classifier{okData =
ClassData{prior = -0.3364722366212129, unseen = -3.332204510175204,
@ -803,7 +806,8 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("<time-of-day> am|pm",
Classifier{okData =
ClassData{prior = 0.0, unseen = -2.0794415416798357,
ClassData{prior = -0.40546510810816444,
unseen = -2.0794415416798357,
likelihoods =
HashMap.fromList
[("a las <time-of-day>", -1.252762968495368),
@ -811,8 +815,12 @@ classifiers
("hour", -0.8472978603872037)],
n = 2},
koData =
ClassData{prior = -infinity, unseen = -1.3862943611198906,
likelihoods = HashMap.fromList [], n = 0}}),
ClassData{prior = -1.0986122886681098, unseen = -1.791759469228055,
likelihoods =
HashMap.fromList
[("time-of-day (latent)", -0.916290731874155),
("hour", -0.916290731874155)],
n = 1}}),
("n proximas <cycle>",
Classifier{okData =
ClassData{prior = 0.0, unseen = -2.5649493574615367,

View File

@ -691,7 +691,7 @@ classifiers
n = 2}}),
("time-of-day (latent)",
Classifier{okData =
ClassData{prior = -1.3322271398496148, unseen = -3.332204510175204,
ClassData{prior = -1.3596261140377293, unseen = -3.332204510175204,
likelihoods =
HashMap.fromList
[("integer (numeric)", -0.6567795363890705),
@ -700,17 +700,18 @@ classifiers
("integer (1..10) - TYPE 2", -2.6026896854443837)],
n = 19},
koData =
ClassData{prior = -0.3063742054639334, unseen = -4.127134385045092,
ClassData{prior = -0.2967319079716989,
unseen = -4.1588830833596715,
likelihoods =
HashMap.fromList
[("integer (numeric)", -1.1151415906193203),
("integer - TYPE 1", -0.8919980393051105),
("integer (20..90) - TYPE 2 and ordinals", -3.417726683613366),
("integer (21..99) - TYPE 2", -3.417726683613366),
("integer (1..4) - for ordinals", -2.3191143949452564),
("integer - TYPE 1: powers of ten", -3.012261575505202),
("compose by multiplication", -3.417726683613366)],
n = 53}}),
[("integer (numeric)", -1.052092273033217),
("integer - TYPE 1", -0.924258901523332),
("integer (20..90) - TYPE 2 and ordinals", -3.4499875458315876),
("integer (21..99) - TYPE 2", -3.4499875458315876),
("integer (1..4) - for ordinals", -2.3513752571634776),
("integer - TYPE 1: powers of ten", -3.044522437723423),
("compose by multiplication", -3.4499875458315876)],
n = 55}}),
("year",
Classifier{okData =
ClassData{prior = -1.006804739414987, unseen = -3.295836866004329,
@ -796,7 +797,7 @@ classifiers
n = 114}}),
("<time-of-day> am|pm",
Classifier{okData =
ClassData{prior = -0.2411620568168881, unseen = -3.295836866004329,
ClassData{prior = -0.3746934494414107, unseen = -3.295836866004329,
likelihoods =
HashMap.fromList
[("time-of-day (latent)", -1.6486586255873816),
@ -804,12 +805,12 @@ classifiers
("minute", -1.1786549963416462)],
n = 11},
koData =
ClassData{prior = -1.540445040947149, unseen = -2.3978952727983707,
ClassData{prior = -1.1631508098056809, unseen = -2.70805020110221,
likelihoods =
HashMap.fromList
[("time-of-day (latent)", -0.916290731874155),
("hour", -0.916290731874155)],
n = 3}}),
[("time-of-day (latent)", -0.8472978603872037),
("hour", -0.8472978603872037)],
n = 5}}),
("a day - \54616\47336",
Classifier{okData =
ClassData{prior = 0.0, unseen = -1.3862943611198906,

View File

@ -924,20 +924,19 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("<integer> (latent time-of-day)",
Classifier{okData =
ClassData{prior = -0.4895482253187058,
unseen = -3.7376696182833684,
ClassData{prior = -0.505548566665147, unseen = -3.7376696182833684,
likelihoods =
HashMap.fromList
[("integer (numeric)", -7.598590697792199e-2),
("fifteen", -3.0204248861443626)],
n = 38},
koData =
ClassData{prior = -0.9490805546971459, unseen = -3.332204510175204,
ClassData{prior = -0.924258901523332, unseen = -3.367295829986474,
likelihoods =
HashMap.fromList
[("integer (numeric)", -0.16034265007517937),
("one", -2.6026896854443837), ("fifteen", -2.6026896854443837)],
n = 24}}),
[("integer (numeric)", -0.15415067982725836),
("one", -2.639057329615259), ("fifteen", -2.639057329615259)],
n = 25}}),
("nth <time> of <time>",
Classifier{okData =
ClassData{prior = -0.5596157879354228, unseen = -2.772588722239781,
@ -1700,7 +1699,7 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("<time-of-day> rano",
Classifier{okData =
ClassData{prior = -5.129329438755058e-2,
ClassData{prior = -0.10008345855698253,
unseen = -3.828641396489095,
likelihoods =
HashMap.fromList
@ -1712,12 +1711,14 @@ classifiers
("hour", -0.8622235106038793), ("minute", -3.1135153092103742)],
n = 19},
koData =
ClassData{prior = -2.995732273553991, unseen = -2.3025850929940455,
ClassData{prior = -2.3513752571634776,
unseen = -2.4849066497880004,
likelihoods =
HashMap.fromList
[("until <time-of-day>", -1.5040773967762742),
("hour", -1.5040773967762742)],
n = 1}}),
[("<integer> (latent time-of-day)", -1.7047480922384253),
("until <time-of-day>", -1.7047480922384253),
("hour", -1.2992829841302609)],
n = 2}}),
("after <duration>",
Classifier{okData =
ClassData{prior = 0.0, unseen = -1.6094379124341003,

View File

@ -356,98 +356,101 @@ classifiers
n = 7}}),
("intersect",
Classifier{okData =
ClassData{prior = -0.39204208777602373,
unseen = -5.049856007249537,
ClassData{prior = -0.40546510810816444,
unseen = -5.062595033026967,
likelihoods =
HashMap.fromList
[("<day-of-month> de <named-month>in the <part-of-day>",
-3.9448128282511368),
("dayhour", -2.404367787303988),
-3.9576335166801986),
("dayhour", -2.4171884757330493),
("<day-of-month> de <named-month>two time tokens separated by \",\"2",
-4.350277936359301),
-4.363098624788362),
("nowquinze para as <hour-of-day> (as relative minutes)",
-4.350277936359301),
("intersectnamed-day", -4.350277936359301),
("now\224s <time-of-day>", -3.9448128282511368),
-4.363098624788362),
("intersectnamed-day", -4.363098624788362),
("now\224s <time-of-day>", -3.9576335166801986),
("<day-of-month> de <named-month>intersect",
-4.350277936359301),
("now<hour-of-day> and 3/4", -4.350277936359301),
("intersect by `da` or `de`named-day", -4.350277936359301),
-4.363098624788362),
("now<hour-of-day> and 3/4", -4.363098624788362),
("intersect by `da` or `de`named-day", -4.363098624788362),
("<day-of-month> de <named-month>two time tokens separated by \",\"",
-4.350277936359301),
("dayday", -2.846200539583027),
("hourhour", -4.350277936359301),
("named-day\224s <time-of-day>", -4.350277936359301),
("dayyear", -2.3353749158170367),
("minutehour", -3.0975149678639333),
-4.363098624788362),
("dayday", -2.8590212280120886),
("hourhour", -4.363098624788362),
("named-day\224s <time-of-day>", -4.363098624788362),
("dayyear", -2.348195604246098),
("minutehour", -3.1103356562929947),
("<hour-of-day> and quinzein the <part-of-day>",
-3.9448128282511368),
("de <year>named-day", -4.350277936359301),
("now<hour-of-day> and <relative minutes>", -4.350277936359301),
("named-dayin the <part-of-day>", -4.350277936359301),
("tomorrow<time-of-day> horas", -3.9448128282511368),
-3.9576335166801986),
("de <year>named-day", -4.363098624788362),
("now<hour-of-day> and <relative minutes>", -4.363098624788362),
("named-dayin the <part-of-day>", -4.363098624788362),
("tomorrow<time-of-day> horas", -3.9576335166801986),
("now<integer> para as <hour-of-day> (as relative minutes)",
-4.350277936359301),
("\224s <time-of-day>in the <part-of-day>", -3.657130755799356),
("named-dayintersect", -4.350277936359301),
("named-dayamanh\227 pela <part-of-day>", -4.350277936359301),
("dayminute", -3.0975149678639333),
("named-dayintersect by `da` or `de`", -4.350277936359301),
("yearnamed-day", -4.350277936359301),
("dd-dd <month>(interval)de <year>", -4.350277936359301),
-4.363098624788362),
("\224s <time-of-day>in the <part-of-day>",
-3.6699514442284173),
("named-dayintersect", -4.363098624788362),
("named-dayamanh\227 pela <part-of-day>", -4.363098624788362),
("dayminute", -3.1103356562929947),
("named-dayintersect by `da` or `de`", -4.363098624788362),
("yearnamed-day", -4.363098624788362),
("dd-dd <month>(interval)de <year>", -4.363098624788362),
("named-day<day-of-month> de <named-month>",
-4.350277936359301),
("named-day<time-of-day> <part-of-day>", -4.350277936359301),
-4.363098624788362),
("named-day<time-of-day> <part-of-day>", -4.363098624788362),
("dia <day-of-month> de <named-month>in the <part-of-day>",
-3.9448128282511368),
("yearday", -3.9448128282511368),
("named-day<dim time> da manha", -4.350277936359301),
-3.9576335166801986),
("yearday", -3.9576335166801986),
("named-day<dim time> da manha", -4.363098624788362),
("two time tokens separated by \",\"de <year>",
-3.9448128282511368),
("dd[/-]mmyear", -4.350277936359301),
-3.9576335166801986),
("dd[/-]mmyear", -4.363098624788362),
("<day-of-month> de <named-month>de <year>",
-2.9639835752394106),
("tomorrowdepois das <time-of-day>", -3.9448128282511368),
-2.976804263668472),
("tomorrowdepois das <time-of-day>", -3.9576335166801986),
("<hour-of-day> and <relative minutes>in the <part-of-day>",
-3.9448128282511368),
-3.9576335166801986),
("two time tokens separated by \",\"2de <year>",
-3.9448128282511368),
("intersectde <year>", -4.350277936359301)],
-3.9576335166801986),
("intersectde <year>", -4.363098624788362)],
n = 50},
koData =
ClassData{prior = -1.126011262856224, unseen = -4.6443908991413725,
ClassData{prior = -1.0986122886681098, unseen = -4.68213122712422,
likelihoods =
HashMap.fromList
[("dayhour", -3.536116699561526),
("monthday", -2.842969519001581),
("named-month\224s <time-of-day>", -3.9415818076696905),
("monthyear", -2.4375044108934163),
("intersectnamed-day", -3.9415818076696905),
("now\224s <time-of-day>", -3.536116699561526),
("intersect by `da` or `de`named-day", -3.9415818076696905),
("monthhour", -3.248434627109745),
("dayyear", -3.9415818076696905),
("now<hour-of-day> and <relative minutes>",
-3.9415818076696905),
("daysecond", -3.9415818076696905),
("named-dayright now", -3.9415818076696905),
("dayminute", -3.536116699561526),
("named-monthde <year>", -2.4375044108934163),
("named-monthin the <part-of-day>", -3.536116699561526),
[("hourday", -3.979681653901961),
("dayhour", -3.5742165457937967),
("monthday", -2.8810693652338513),
("named-month\224s <time-of-day>", -3.979681653901961),
("monthyear", -2.4756042571256867),
("intersectnamed-day", -3.979681653901961),
("now\224s <time-of-day>", -3.5742165457937967),
("<time-of-day> am|pm<day-of-month> de <named-month>",
-3.979681653901961),
("intersect by `da` or `de`named-day", -3.979681653901961),
("monthhour", -3.2865344733420154),
("dayyear", -3.979681653901961),
("now<hour-of-day> and <relative minutes>", -3.979681653901961),
("daysecond", -3.979681653901961),
("named-dayright now", -3.979681653901961),
("dayminute", -3.5742165457937967),
("named-monthde <year>", -2.4756042571256867),
("named-monthin the <part-of-day>", -3.5742165457937967),
("named-monthtwo time tokens separated by \",\"2",
-3.9415818076696905),
("intersect by `da` or `de`de <year>", -3.9415818076696905),
("named-monthintersect", -3.9415818076696905),
-3.979681653901961),
("intersect by `da` or `de`de <year>", -3.979681653901961),
("named-monthintersect", -3.979681653901961),
("<day-of-month> de <named-month>\224s <time-of-day>",
-3.9415818076696905),
-3.979681653901961),
("<hour-of-day> <integer> (as relative minutes)year",
-3.9415818076696905),
-3.979681653901961),
("<day-of-month> de <named-month>de <year>",
-3.9415818076696905),
("minuteyear", -3.536116699561526),
-3.979681653901961),
("minuteyear", -3.5742165457937967),
("named-monthtwo time tokens separated by \",\"",
-3.9415818076696905)],
n = 24}}),
-3.979681653901961)],
n = 25}}),
("season",
Classifier{okData =
ClassData{prior = 0.0, unseen = -1.6094379124341003,
@ -713,28 +716,25 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("<dim time> da manha",
Classifier{okData =
ClassData{prior = -0.5108256237659907,
unseen = -3.4011973816621555,
ClassData{prior = -0.2006706954621511, unseen = -3.332204510175204,
likelihoods =
HashMap.fromList
[("<day-of-month> de <named-month>", -2.6741486494265287),
("intersect", -2.6741486494265287),
("dia <day-of-month> de <named-month>", -2.6741486494265287),
("day", -2.268683541318364),
("time-of-day (latent)", -1.9810014688665833),
("hour", -1.2878542883066382),
("\224s <time-of-day>", -1.9810014688665833)],
[("<day-of-month> de <named-month>", -2.6026896854443837),
("intersect", -2.6026896854443837),
("dia <day-of-month> de <named-month>", -2.6026896854443837),
("day", -2.1972245773362196),
("time-of-day (latent)", -1.9095425048844386),
("hour", -1.2163953243244932),
("\224s <time-of-day>", -1.9095425048844386)],
n = 9},
koData =
ClassData{prior = -0.916290731874155, unseen = -3.1780538303479458,
ClassData{prior = -1.7047480922384253, unseen = -2.639057329615259,
likelihoods =
HashMap.fromList
[("year (latent)", -1.5260563034950494),
("named-month", -2.4423470353692043),
("time-of-day (latent)", -2.4423470353692043),
("year", -1.5260563034950494), ("hour", -2.4423470353692043),
("month", -2.4423470353692043)],
n = 6}}),
[("named-month", -1.8718021769015913),
("time-of-day (latent)", -1.8718021769015913),
("hour", -1.8718021769015913), ("month", -1.8718021769015913)],
n = 2}}),
("em <duration>",
Classifier{okData =
ClassData{prior = 0.0, unseen = -3.6635616461296463,
@ -784,7 +784,7 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("time-of-day (latent)",
Classifier{okData =
ClassData{prior = -0.40546510810816444,
ClassData{prior = -0.43286408229627876,
unseen = -3.332204510175204,
likelihoods =
HashMap.fromList
@ -792,13 +792,13 @@ classifiers
("number (0..15)", -0.46262352194811296)],
n = 24},
koData =
ClassData{prior = -1.0986122886681098, unseen = -2.772588722239781,
ClassData{prior = -1.0459685551826876, unseen = -2.833213344056216,
likelihoods =
HashMap.fromList
[("integer (numeric)", -0.916290731874155),
("number (0..15)", -0.7621400520468967),
("number (20..90)", -2.0149030205422647)],
n = 12}}),
[("integer (numeric)", -0.8266785731844679),
("number (0..15)", -0.8266785731844679),
("number (20..90)", -2.0794415416798357)],
n = 13}}),
("<hour-of-day> and <relative minutes>",
Classifier{okData =
ClassData{prior = -0.2719337154836418, unseen = -3.713572066704308,
@ -903,7 +903,8 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("<time-of-day> am|pm",
Classifier{okData =
ClassData{prior = 0.0, unseen = -2.0794415416798357,
ClassData{prior = -0.40546510810816444,
unseen = -2.0794415416798357,
likelihoods =
HashMap.fromList
[("time-of-day (latent)", -1.252762968495368),
@ -911,8 +912,12 @@ classifiers
("\224s <time-of-day>", -1.252762968495368)],
n = 2},
koData =
ClassData{prior = -infinity, unseen = -1.3862943611198906,
likelihoods = HashMap.fromList [], n = 0}}),
ClassData{prior = -1.0986122886681098, unseen = -1.791759469228055,
likelihoods =
HashMap.fromList
[("time-of-day (latent)", -0.916290731874155),
("hour", -0.916290731874155)],
n = 1}}),
("n proximas <cycle>",
Classifier{okData =
ClassData{prior = 0.0, unseen = -2.5649493574615367,

View File

@ -775,4 +775,9 @@ allExamples = concat
, examples (datetime (2013, 2, 12, 23, 0, 0) Hour)
[ "tonight at 11"
]
, examples (datetime (2013, 2, 12, 4, 23, 0) Minute)
-- yes, the result is in the past, we may need to revisit
[ "at 4:23"
, "4:23am"
]
]

View File

@ -701,7 +701,7 @@ ruleDimTimeDaManha :: Rule
ruleDimTimeDaManha = Rule
{ name = "<dim time> da manha"
, pattern =
[ dimension Time
[ Predicate $ isGrainFinerThan TG.Year
, regex "(da|na|pela) manh(\x00e3|a)"
]
, prod = \tokens -> case tokens of

View File

@ -205,7 +205,7 @@ data Predicate
{ tdSecond :: Maybe Int
, tdMinute :: Maybe Int
, tdHour :: Maybe (Bool, Int)
, tdAMPM :: Maybe AMPM
, tdAMPM :: Maybe AMPM -- only used if we have an hour
, tdDayOfTheWeek :: Maybe Int
, tdDayOfTheMonth :: Maybe Int
, tdMonth :: Maybe Int
@ -217,6 +217,10 @@ data Predicate
runPredicate :: Predicate -> SeriesPredicate
runPredicate EmptyPredicate = \_ _ -> ([], [])
runPredicate (SeriesPredicate p) = p
runPredicate TimeDatePredicate{..}
-- This should not happen by construction, but if it does then
-- empty time series should be ok
| isNothing tdHour && isJust tdAMPM = \_ _ -> ([], [])
runPredicate TimeDatePredicate{..} =
foldr1 runCompose toCompose
where
@ -225,8 +229,7 @@ runPredicate TimeDatePredicate{..} =
toCompose = catMaybes
[ runSecondPredicate <$> tdSecond
, runMinutePredicate <$> tdMinute
, uncurry runHourPredicate <$> tdHour
, runAMPMPredicate <$> tdAMPM
, uncurry (runHourPredicate tdAMPM) <$> tdHour
, runDayOfTheWeekPredicate <$> tdDayOfTheWeek
, runDayOfTheMonthPredicate <$> tdDayOfTheMonth
, runMonthPredicate <$> tdMonth
@ -316,8 +319,8 @@ runMinutePredicate n = series
rounded = timeRound t TG.Minute
anchor = timePlus rounded TG.Minute . toInteger $ mod (n - m) 60
runHourPredicate :: Bool -> Int -> SeriesPredicate
runHourPredicate is12H n = series
runHourPredicate :: Maybe AMPM -> Bool -> Int -> SeriesPredicate
runHourPredicate ampm is12H n = series
where
series t _ =
( drop 1 $
@ -328,9 +331,13 @@ runHourPredicate is12H n = series
Time.UTCTime _ diffTime = start t
Time.TimeOfDay h _ _ = Time.timeToTimeOfDay diffTime
step :: Int
step = if is12H && n <= 12 then 12 else 24
step = if is12H && n <= 12 && isNothing ampm then 12 else 24
n' = case ampm of
Just AM -> n `mod` 12
Just PM -> (n `mod` 12) + 12
Nothing -> n
rounded = timeRound t TG.Hour
anchor = timePlus rounded TG.Hour . toInteger $ mod (n - h) step
anchor = timePlus rounded TG.Hour . toInteger $ mod (n' - h) step
runAMPMPredicate :: AMPM -> SeriesPredicate
runAMPMPredicate ampm = series