Added ruleIntervalDDDDMonth to EN

Summary: Added ruleIntervalDDDDMonth to EN to handle cases such as "23rd to 26th Oct" and "1-8 september"

Reviewed By: patapizza

Differential Revision: D5637280

fbshipit-source-id: a1fdcd2
This commit is contained in:
Satya Bodduluri 2017-08-16 14:06:45 -07:00 committed by Facebook Github Bot
parent 5cad4359e2
commit da41db3766
3 changed files with 265 additions and 207 deletions

View File

@ -23,7 +23,7 @@ classifiers
= HashMap.fromList = HashMap.fromList
[("<integer> to|till|before <hour-of-day>", [("<integer> to|till|before <hour-of-day>",
Classifier{okData = Classifier{okData =
ClassData{prior = -1.9459101490553135, unseen = -1.791759469228055, ClassData{prior = -2.0794415416798357, unseen = -1.791759469228055,
likelihoods = likelihoods =
HashMap.fromList HashMap.fromList
[("integer (numeric)noon|midnight|EOD|end of day", [("integer (numeric)noon|midnight|EOD|end of day",
@ -31,13 +31,13 @@ classifiers
("hour", -0.916290731874155)], ("hour", -0.916290731874155)],
n = 1}, n = 1},
koData = koData =
ClassData{prior = -0.15415067982725836, ClassData{prior = -0.13353139262452263,
unseen = -2.772588722239781, unseen = -2.890371757896165,
likelihoods = likelihoods =
HashMap.fromList HashMap.fromList
[("hour", -0.7621400520468967), [("hour", -0.7537718023763802),
("integer (numeric)time-of-day (latent)", -0.7621400520468967)], ("integer (numeric)time-of-day (latent)", -0.7537718023763802)],
n = 6}}), n = 7}}),
("<time> timezone", ("<time> timezone",
Classifier{okData = Classifier{okData =
ClassData{prior = 0.0, unseen = -2.4849066497880004, ClassData{prior = 0.0, unseen = -2.4849066497880004,
@ -60,11 +60,12 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}), likelihoods = HashMap.fromList [], n = 0}}),
("integer (numeric)", ("integer (numeric)",
Classifier{okData = Classifier{okData =
ClassData{prior = -0.7820946665764414, unseen = -5.159055299214529, ClassData{prior = -0.7801585575495751, unseen = -5.181783550292085,
likelihoods = HashMap.fromList [("", 0.0)], n = 172}, likelihoods = HashMap.fromList [("", 0.0)], n = 176},
koData = koData =
ClassData{prior = -0.6114691495456782, unseen = -5.327876168789581, ClassData{prior = -0.6131044728864089,
likelihoods = HashMap.fromList [("", 0.0)], n = 204}}), unseen = -5.3471075307174685,
likelihoods = HashMap.fromList [("", 0.0)], n = 208}}),
("<duration> hence|ago", ("<duration> hence|ago",
Classifier{okData = Classifier{okData =
ClassData{prior = 0.0, unseen = -3.784189633918261, ClassData{prior = 0.0, unseen = -3.784189633918261,
@ -160,25 +161,28 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}), likelihoods = HashMap.fromList [], n = 0}}),
("<day-of-month> (ordinal or number) <named-month>", ("<day-of-month> (ordinal or number) <named-month>",
Classifier{okData = Classifier{okData =
ClassData{prior = -0.9808292530117262, unseen = -2.70805020110221, ClassData{prior = -1.3862943611198906, unseen = -2.890371757896165,
likelihoods = likelihoods =
HashMap.fromList HashMap.fromList
[("ordinal (digits)December", -1.9459101490553135), [("ordinal (digits)December", -2.1400661634962708),
("ordinal (digits)February", -1.9459101490553135), ("ordinal (digits)February", -2.1400661634962708),
("integer (numeric)April", -1.9459101490553135), ("integer (numeric)April", -2.1400661634962708),
("month", -1.252762968495368)], ("month", -1.4469189829363254)],
n = 3}, n = 3},
koData = koData =
ClassData{prior = -0.4700036292457356, ClassData{prior = -0.2876820724517809,
unseen = -2.9444389791664407, unseen = -3.4011973816621555,
likelihoods = likelihoods =
HashMap.fromList HashMap.fromList
[("ordinal (digits)July", -2.1972245773362196), [("ordinal (digits)October", -2.6741486494265287),
("integer (numeric)August", -2.1972245773362196), ("ordinal (digits)July", -2.6741486494265287),
("ordinal (digits)April", -2.1972245773362196), ("integer (numeric)September", -2.268683541318364),
("month", -1.0986122886681098), ("ordinal (digits)August", -2.6741486494265287),
("integer (numeric)July", -1.791759469228055)], ("integer (numeric)August", -2.6741486494265287),
n = 5}}), ("ordinal (digits)April", -2.6741486494265287),
("month", -1.0647107369924282),
("integer (numeric)July", -2.268683541318364)],
n = 9}}),
("<time> <part-of-day>", ("<time> <part-of-day>",
Classifier{okData = Classifier{okData =
ClassData{prior = -9.844007281325252e-2, ClassData{prior = -9.844007281325252e-2,
@ -236,12 +240,12 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}), likelihoods = HashMap.fromList [], n = 0}}),
("mm/dd", ("mm/dd",
Classifier{okData = Classifier{okData =
ClassData{prior = -1.3862943611198906, ClassData{prior = -1.4271163556401458,
unseen = -2.0794415416798357, unseen = -2.0794415416798357,
likelihoods = HashMap.fromList [("", 0.0)], n = 6}, likelihoods = HashMap.fromList [("", 0.0)], n = 6},
koData = koData =
ClassData{prior = -0.2876820724517809, unseen = -2.995732273553991, ClassData{prior = -0.2744368457017603, unseen = -3.044522437723423,
likelihoods = HashMap.fromList [("", 0.0)], n = 18}}), likelihoods = HashMap.fromList [("", 0.0)], n = 19}}),
("at <time-of-day>", ("at <time-of-day>",
Classifier{okData = Classifier{okData =
ClassData{prior = -0.10919929196499197, ClassData{prior = -0.10919929196499197,
@ -291,8 +295,8 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}), likelihoods = HashMap.fromList [], n = 0}}),
("September", ("September",
Classifier{okData = Classifier{okData =
ClassData{prior = 0.0, unseen = -1.791759469228055, ClassData{prior = 0.0, unseen = -2.0794415416798357,
likelihoods = HashMap.fromList [("", 0.0)], n = 4}, likelihoods = HashMap.fromList [("", 0.0)], n = 6},
koData = koData =
ClassData{prior = -infinity, unseen = -0.6931471805599453, ClassData{prior = -infinity, unseen = -0.6931471805599453,
likelihoods = HashMap.fromList [], n = 0}}), likelihoods = HashMap.fromList [], n = 0}}),
@ -386,8 +390,8 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}), likelihoods = HashMap.fromList [], n = 0}}),
("October", ("October",
Classifier{okData = Classifier{okData =
ClassData{prior = 0.0, unseen = -2.833213344056216, ClassData{prior = 0.0, unseen = -2.890371757896165,
likelihoods = HashMap.fromList [("", 0.0)], n = 15}, likelihoods = HashMap.fromList [("", 0.0)], n = 16},
koData = koData =
ClassData{prior = -infinity, unseen = -0.6931471805599453, ClassData{prior = -infinity, unseen = -0.6931471805599453,
likelihoods = HashMap.fromList [], n = 0}}), likelihoods = HashMap.fromList [], n = 0}}),
@ -537,232 +541,234 @@ classifiers
n = 3}}), n = 3}}),
("intersect", ("intersect",
Classifier{okData = Classifier{okData =
ClassData{prior = -0.4634795031687923, unseen = -6.169610732491456, ClassData{prior = -0.467109271219371, unseen = -6.171700597410915,
likelihoods = likelihoods =
HashMap.fromList HashMap.fromList
[("<datetime> - <datetime> (interval)on <date>", [("<datetime> - <datetime> (interval)on <date>",
-4.558078578454241), -4.560172820057356),
("<time-of-day> - <time-of-day> (interval)on <date>", ("<time-of-day> - <time-of-day> (interval)on <date>",
-4.558078578454241), -4.560172820057356),
("hourday", -3.769621218089971), ("hourday", -3.7717154596930853),
("dayhour", -3.223077511721901), ("dayhour", -3.2251717533250157),
("daymonth", -4.781222129768451), ("daymonth", -4.783316371371566),
("monthday", -5.0689042022202315), ("monthday", -5.070998443823346),
("monthyear", -3.8649313978942956), ("monthyear", -3.8670256394974105),
("Tuesdaythe <day-of-month> (ordinal)", -5.474369310328396), ("Tuesdaythe <day-of-month> (ordinal)", -5.476463551931511),
("Christmasyear", -5.474369310328396), ("Christmasyear", -5.476463551931511),
("from <datetime> - <datetime> (interval)July", ("from <datetime> - <datetime> (interval)July",
-5.474369310328396), -5.476463551931511),
("houryear", -5.474369310328396), ("houryear", -5.476463551931511),
("this|next <day-of-week>hh(:mm) - <time-of-day> am|pm", ("this|next <day-of-week>hh(:mm) - <time-of-day> am|pm",
-5.474369310328396), -5.476463551931511),
("<time-of-day> am|pmintersect by \",\", \"of\", \"from\", \"'s\"", ("<time-of-day> am|pmintersect by \",\", \"of\", \"from\", \"'s\"",
-4.781222129768451), -4.783316371371566),
("<time-of-day> am|pmintersect", -4.221606341833028), ("<time-of-day> am|pmintersect", -4.223700583436143),
("intersect by \",\", \"of\", \"from\", \"'s\"year", ("intersect by \",\", \"of\", \"from\", \"'s\"year",
-5.474369310328396), -5.476463551931511),
("Marchyear", -5.474369310328396), ("Marchyear", -5.476463551931511),
("<named-month>|<named-day> <day-of-month> (ordinal)year", ("<named-month>|<named-day> <day-of-month> (ordinal)year",
-5.0689042022202315), -5.070998443823346),
("intersect<time-of-day> am|pm", -5.474369310328396), ("intersect<time-of-day> am|pm", -5.476463551931511),
("Thursdayhh(:mm) - <time-of-day> am|pm", -5.474369310328396), ("Thursdayhh(:mm) - <time-of-day> am|pm", -5.476463551931511),
("monthhour", -5.0689042022202315), ("monthhour", -5.070998443823346),
("last <day-of-week> of <time>year", -5.474369310328396), ("last <day-of-week> of <time>year", -5.476463551931511),
("todayat <time-of-day>", -5.474369310328396), ("todayat <time-of-day>", -5.476463551931511),
("Thursday<time> timezone", -5.0689042022202315), ("Thursday<time> timezone", -5.070998443823346),
("this <time>hh(:mm) - <time-of-day> am|pm", ("this <time>hh(:mm) - <time-of-day> am|pm",
-5.474369310328396), -5.476463551931511),
("dayday", -3.459466289786131), ("dayday", -3.461560531389246),
("Thanksgiving Dayyear", -4.375757021660286), ("Thanksgiving Dayyear", -4.377851263263401),
("<time> <part-of-day>at <time-of-day>", -5.474369310328396), ("<time> <part-of-day>at <time-of-day>", -5.476463551931511),
("Tuesdayin <named-month>", -5.474369310328396), ("Tuesdayin <named-month>", -5.476463551931511),
("mm/ddat <time-of-day>", -5.474369310328396), ("mm/ddat <time-of-day>", -5.476463551931511),
("tonightat <time-of-day>", -5.474369310328396), ("tonightat <time-of-day>", -5.476463551931511),
("<time-of-day> am|pmabsorption of , after named day", ("<time-of-day> am|pmabsorption of , after named day",
-4.781222129768451), -4.783316371371566),
("today<time-of-day> am|pm", -5.474369310328396), ("today<time-of-day> am|pm", -5.476463551931511),
("Februarythe <day-of-month> (ordinal)", -5.0689042022202315), ("Februarythe <day-of-month> (ordinal)", -5.070998443823346),
("at <time-of-day><time> <part-of-day>", -5.474369310328396), ("at <time-of-day><time> <part-of-day>", -5.476463551931511),
("mm/dd<time-of-day> am|pm", -5.474369310328396), ("mm/dd<time-of-day> am|pm", -5.476463551931511),
("hourhour", -4.221606341833028), ("hourhour", -4.223700583436143),
("<time-of-day> am|pmon <date>", -3.459466289786131), ("<time-of-day> am|pmon <date>", -3.461560531389246),
("Wednesdaythis|last|next <cycle>", -5.474369310328396), ("Wednesdaythis|last|next <cycle>", -5.476463551931511),
("intersect<named-month> <day-of-month> (non ordinal)", ("intersect<named-month> <day-of-month> (non ordinal)",
-3.970291913552122), -3.9723861551552364),
("dayyear", -3.0320222749591914), ("dayyear", -3.0341165165623063),
("last weekend of <named-month>year", -5.474369310328396), ("last weekend of <named-month>year", -5.476463551931511),
("<time-of-day> o'clockin|during the <part-of-day>", ("<time-of-day> o'clockin|during the <part-of-day>",
-5.474369310328396), -5.476463551931511),
("<time-of-day> am|pmtomorrow", -4.781222129768451), ("<time-of-day> am|pmtomorrow", -4.783316371371566),
("minutehour", -4.558078578454241), ("minutehour", -4.560172820057356),
("Mother's Dayyear", -5.474369310328396), ("Mother's Dayyear", -5.476463551931511),
("at <time-of-day>in|during the <part-of-day>", ("at <time-of-day>in|during the <part-of-day>",
-5.0689042022202315), -5.070998443823346),
("absorption of , after named day<named-month> <day-of-month> (non ordinal)", ("absorption of , after named day<named-month> <day-of-month> (non ordinal)",
-3.769621218089971), -3.7717154596930853),
("for <duration> from <time>December", -5.474369310328396), ("for <duration> from <time>December", -5.476463551931511),
("tomorrow<time-of-day> sharp|exactly", -5.474369310328396), ("tomorrow<time-of-day> sharp|exactly", -5.476463551931511),
("Thursdayfrom <datetime> - <datetime> (interval)", ("Thursdayfrom <datetime> - <datetime> (interval)",
-4.558078578454241), -4.560172820057356),
("on <date><named-month> <day-of-month> (non ordinal)", ("on <date><named-month> <day-of-month> (non ordinal)",
-5.0689042022202315), -5.070998443823346),
("Thursdayfrom <time-of-day> - <time-of-day> (interval)", ("Thursdayfrom <time-of-day> - <time-of-day> (interval)",
-4.558078578454241), -4.560172820057356),
("Mondayin|during the <part-of-day>", -5.474369310328396), ("Mondayin|during the <part-of-day>", -5.476463551931511),
("tomorrowfrom <time-of-day> - <time-of-day> (interval)", ("tomorrowfrom <time-of-day> - <time-of-day> (interval)",
-5.0689042022202315), -5.070998443823346),
("intersectin|during the <part-of-day>", -5.474369310328396), ("intersectin|during the <part-of-day>", -5.476463551931511),
("<day-of-month> (ordinal or number) of <named-month>in|during the <part-of-day>", ("<day-of-month> (ordinal or number) of <named-month>in|during the <part-of-day>",
-5.474369310328396), -5.476463551931511),
("from <time-of-day> - <time-of-day> (interval)on <date>", ("from <time-of-day> - <time-of-day> (interval)on <date>",
-4.781222129768451), -4.783316371371566),
("intersect by \",\", \"of\", \"from\", \"'s\"<time-of-day> am|pm", ("intersect by \",\", \"of\", \"from\", \"'s\"<time-of-day> am|pm",
-4.558078578454241), -4.560172820057356),
("at <time-of-day>intersect", -5.0689042022202315), ("at <time-of-day>intersect", -5.070998443823346),
("<time-of-day> - <time-of-day> (interval)tomorrow", ("<time-of-day> - <time-of-day> (interval)tomorrow",
-5.474369310328396), -5.476463551931511),
("at <time-of-day>intersect by \",\", \"of\", \"from\", \"'s\"", ("at <time-of-day>intersect by \",\", \"of\", \"from\", \"'s\"",
-5.474369310328396), -5.476463551931511),
("dayminute", -3.1717842173343502), ("dayminute", -3.173878458937465),
("from <datetime> - <datetime> (interval)on <date>", ("from <datetime> - <datetime> (interval)on <date>",
-5.0689042022202315), -5.070998443823346),
("<datetime> - <datetime> (interval)tomorrow", ("<datetime> - <datetime> (interval)tomorrow",
-5.474369310328396), -5.476463551931511),
("absorption of , after named dayintersect by \",\", \"of\", \"from\", \"'s\"", ("absorption of , after named dayintersect by \",\", \"of\", \"from\", \"'s\"",
-5.0689042022202315), -5.070998443823346),
("<ordinal> <cycle> of <time>year", -5.474369310328396), ("<ordinal> <cycle> of <time>year", -5.476463551931511),
("minuteday", -2.0731719286662407), ("minuteday", -2.075266170269355),
("absorption of , after named dayintersect", ("absorption of , after named dayintersect",
-5.474369310328396), -5.476463551931511),
("Octoberyear", -4.221606341833028), ("Octoberyear", -4.223700583436143),
("the <day-of-month> (ordinal)in|during the <part-of-day>", ("the <day-of-month> (ordinal)in|during the <part-of-day>",
-5.474369310328396), -5.476463551931511),
("at <time-of-day>absorption of , after named day", ("at <time-of-day>absorption of , after named day",
-5.474369310328396), -5.476463551931511),
("<day-of-month> (ordinal or number) <named-month>year", ("<day-of-month> (ordinal or number) <named-month>year",
-5.474369310328396), -5.476463551931511),
("year<time-of-day> am|pm", -5.474369310328396), ("year<time-of-day> am|pm", -5.476463551931511),
("Septemberyear", -5.0689042022202315), ("Septemberyear", -5.070998443823346),
("at <time-of-day>on <date>", -4.375757021660286), ("at <time-of-day>on <date>", -4.377851263263401),
("between <time-of-day> and <time-of-day> (interval)on <date>", ("between <time-of-day> and <time-of-day> (interval)on <date>",
-4.781222129768451), -4.783316371371566),
("Halloweenyear", -5.474369310328396), ("Halloweenyear", -5.476463551931511),
("dayweek", -5.474369310328396), ("dayweek", -5.476463551931511),
("weekyear", -5.0689042022202315), ("weekyear", -5.070998443823346),
("hh:mmin|during the <part-of-day>", -4.781222129768451), ("hh:mmin|during the <part-of-day>", -4.783316371371566),
("Father's Dayyear", -5.474369310328396), ("Father's Dayyear", -5.476463551931511),
("<cycle> after|before <time><time-of-day> am|pm", ("<cycle> after|before <time><time-of-day> am|pm",
-5.0689042022202315), -5.070998443823346),
("February<time> <part-of-day>", -5.474369310328396), ("February<time> <part-of-day>", -5.476463551931511),
("Martin Luther King's Dayyear", -5.0689042022202315), ("Martin Luther King's Dayyear", -5.070998443823346),
("tomorrowat <time-of-day>", -4.781222129768451), ("tomorrowat <time-of-day>", -4.783316371371566),
("between <time> and <time>on <date>", -4.781222129768451), ("between <time> and <time>on <date>", -4.783316371371566),
("at <time-of-day>tomorrow", -5.0689042022202315), ("at <time-of-day>tomorrow", -5.070998443823346),
("tomorrow<time-of-day> am|pm", -5.474369310328396), ("tomorrow<time-of-day> am|pm", -5.476463551931511),
("in|during the <part-of-day>at <time-of-day>", ("in|during the <part-of-day>at <time-of-day>",
-5.474369310328396), -5.476463551931511),
("black fridayyear", -5.0689042022202315), ("black fridayyear", -5.070998443823346),
("Labor Dayyear", -5.474369310328396), ("Labor Dayyear", -5.476463551931511),
("Februaryintersect", -5.474369310328396), ("Februaryintersect", -5.476463551931511),
("last <cycle> of <time>year", -4.781222129768451), ("last <cycle> of <time>year", -4.783316371371566),
("<named-month> <day-of-month> (non ordinal)year", ("<named-month> <day-of-month> (non ordinal)year",
-5.474369310328396), -5.476463551931511),
("yearminute", -5.474369310328396)], ("yearminute", -5.476463551931511)],
n = 173}, n = 173},
koData = koData =
ClassData{prior = -0.9917982843823002, unseen = -5.817111159963204, ClassData{prior = -0.9856718774875143, unseen = -5.82600010738045,
likelihoods = likelihoods =
HashMap.fromList HashMap.fromList
[("in <named-month>year", -5.120983351265121), [("in <named-month>year", -5.1298987149230735),
("<time-of-day> - <time-of-day> (interval)on <date>", ("<time-of-day> - <time-of-day> (interval)on <date>",
-5.120983351265121), -5.1298987149230735),
("hourday", -5.120983351265121), ("hourday", -5.1298987149230735),
("<named-month> <day-of-month> (non ordinal)July", ("<named-month> <day-of-month> (non ordinal)July",
-5.120983351265121), -5.1298987149230735),
("dayhour", -3.329223882037066), ("dayhour", -3.3381392456950185),
("daymonth", -3.041541809585285), ("daymonth", -3.0504571732432377),
("monthday", -4.715518243156957), ("monthday", -4.724433606814909),
("monthyear", -4.427836170705175), ("monthyear", -4.436751534363128),
("intersecthh:mm", -5.120983351265121), ("intersecthh:mm", -5.1298987149230735),
("from <datetime> - <datetime> (interval)July", ("from <datetime> - <datetime> (interval)July",
-5.120983351265121), -5.1298987149230735),
("houryear", -5.120983351265121), ("houryear", -5.1298987149230735),
("from <time-of-day> - <time-of-day> (interval)July", ("from <time-of-day> - <time-of-day> (interval)July",
-5.120983351265121), -5.1298987149230735),
("until <time-of-day><time-of-day> am|pm", -5.120983351265121), ("until <time-of-day><time-of-day> am|pm", -5.1298987149230735),
("<time-of-day> am|pmintersect by \",\", \"of\", \"from\", \"'s\"", ("<time-of-day> am|pmintersect by \",\", \"of\", \"from\", \"'s\"",
-4.427836170705175), -4.436751534363128),
("<time-of-day> am|pmintersect", -3.868220382769753), ("<time-of-day> am|pmintersect", -3.8771357464277054),
("intersect by \",\", \"of\", \"from\", \"'s\"year", ("intersect by \",\", \"of\", \"from\", \"'s\"year",
-4.204692619390966), -4.213607983048918),
("Tuesdayafter <time-of-day>", -5.120983351265121), ("Tuesdayafter <time-of-day>", -5.1298987149230735),
("July<day-of-month> (ordinal or number) <named-month>", ("July<day-of-month> (ordinal or number) <named-month>",
-5.120983351265121), -5.1298987149230735),
("absorption of , after named dayJuly", -4.715518243156957), ("absorption of , after named dayJuly", -4.724433606814909),
("monthhour", -4.715518243156957), ("monthhour", -4.724433606814909),
("hourmonth", -4.427836170705175), ("hourmonth", -4.436751534363128),
("todayat <time-of-day>", -5.120983351265121), ("todayat <time-of-day>", -5.1298987149230735),
("dayday", -4.715518243156957), ("dayday", -4.724433606814909),
("mm/ddat <time-of-day>", -4.715518243156957), ("mm/ddat <time-of-day>", -4.724433606814909),
("<time-of-day> am|pmon <date>", -3.868220382769753), ("<time-of-day> am|pmon <date>", -3.8771357464277054),
("dayyear", -3.868220382769753), ("dayyear", -3.8771357464277054),
("Thursdaymm/dd", -5.120983351265121), ("Thursdaymm/dd", -5.1298987149230735),
("Thursdayat <time-of-day>", -5.120983351265121), ("Thursdayat <time-of-day>", -5.1298987149230735),
("August<time-of-day> am|pm", -5.120983351265121), ("<integer> to|till|before <hour-of-day>September",
("monthminute", -5.120983351265121), -5.1298987149230735),
("<time-of-day> am|pmtomorrow", -5.120983351265121), ("August<time-of-day> am|pm", -5.1298987149230735),
("Thursdayhh:mm", -5.120983351265121), ("monthminute", -5.1298987149230735),
("<time-of-day> am|pmtomorrow", -5.1298987149230735),
("Thursdayhh:mm", -5.1298987149230735),
("August<day-of-month> (ordinal or number) <named-month>", ("August<day-of-month> (ordinal or number) <named-month>",
-5.120983351265121), -5.1298987149230735),
("Fridayyear", -4.715518243156957), ("Fridayyear", -4.724433606814909),
("minutemonth", -3.5115454388310208), ("minutemonth", -3.425150622684648),
("Thursdayfrom <datetime> - <datetime> (interval)", ("Thursdayfrom <datetime> - <datetime> (interval)",
-4.715518243156957), -4.724433606814909),
("Thursdayfrom <time-of-day> - <time-of-day> (interval)", ("Thursdayfrom <time-of-day> - <time-of-day> (interval)",
-4.715518243156957), -4.724433606814909),
("Aprilyear", -5.120983351265121), ("Aprilyear", -5.1298987149230735),
("mm/dd<time-of-day> - <time-of-day> (interval)", ("mm/dd<time-of-day> - <time-of-day> (interval)",
-4.715518243156957), -4.724433606814909),
("tomorrowfrom <time-of-day> - <time-of-day> (interval)", ("tomorrowfrom <time-of-day> - <time-of-day> (interval)",
-5.120983351265121), -5.1298987149230735),
("<duration> after|before|from <time>December", ("<duration> after|before|from <time>December",
-5.120983351265121), -5.1298987149230735),
("yesterday<time-of-day> am|pm", -5.120983351265121), ("yesterday<time-of-day> am|pm", -5.1298987149230735),
("intersect by \",\", \"of\", \"from\", \"'s\"hh:mm", ("intersect by \",\", \"of\", \"from\", \"'s\"hh:mm",
-4.204692619390966), -4.213607983048918),
("<named-month> <day-of-month> (non ordinal)August", ("<named-month> <day-of-month> (non ordinal)August",
-5.120983351265121), -5.1298987149230735),
("until <time-of-day>on <date>", -4.427836170705175), ("until <time-of-day>on <date>", -4.436751534363128),
("at <time-of-day>intersect", -4.715518243156957), ("at <time-of-day>intersect", -4.724433606814909),
("at <time-of-day>intersect by \",\", \"of\", \"from\", \"'s\"", ("at <time-of-day>intersect by \",\", \"of\", \"from\", \"'s\"",
-5.120983351265121), -5.1298987149230735),
("dayminute", -3.175073202209808), ("dayminute", -3.18398856586776),
("intersectSeptember", -3.616905954488847), ("intersectSeptember", -3.6258213181467993),
("absorption of , after named dayintersect by \",\", \"of\", \"from\", \"'s\"", ("absorption of , after named dayintersect by \",\", \"of\", \"from\", \"'s\"",
-5.120983351265121), -5.1298987149230735),
("minuteday", -2.317622970358586), ("minuteday", -2.3265383340165386),
("absorption of , after named dayintersect", ("absorption of , after named dayintersect",
-5.120983351265121), -5.1298987149230735),
("Februaryin|during the <part-of-day>", -5.120983351265121), ("Februaryin|during the <part-of-day>", -5.1298987149230735),
("week-endin <named-month>", -5.120983351265121), ("week-endin <named-month>", -5.1298987149230735),
("Octoberyear", -5.120983351265121), ("Octoberyear", -5.1298987149230735),
("yearhh:mm", -5.120983351265121), ("yearhh:mm", -5.1298987149230735),
("hh:mmon <date>", -3.616905954488847), ("hh:mmon <date>", -3.6258213181467993),
("absorption of , after named daySeptember", ("absorption of , after named daySeptember",
-4.204692619390966), -4.213607983048918),
("on <date>September", -4.715518243156957), ("on <date>September", -4.724433606814909),
("at <time-of-day>on <date>", -4.715518243156957), ("at <time-of-day>on <date>", -4.724433606814909),
("absorption of , after named dayFebruary", -4.204692619390966), ("absorption of , after named dayFebruary", -4.213607983048918),
("July<integer> to|till|before <hour-of-day>", ("July<integer> to|till|before <hour-of-day>",
-5.120983351265121), -5.1298987149230735),
("tomorrowat <time-of-day>", -5.120983351265121), ("tomorrowat <time-of-day>", -5.1298987149230735),
("<integer> to|till|before <hour-of-day>July", ("<integer> to|till|before <hour-of-day>July",
-5.120983351265121), -5.1298987149230735),
("tomorrow<time-of-day> am|pm", -5.120983351265121), ("tomorrow<time-of-day> am|pm", -5.1298987149230735),
("after <time-of-day><time-of-day> am|pm", -5.120983351265121), ("after <time-of-day><time-of-day> am|pm", -5.1298987149230735),
("after <time-of-day>year", -5.120983351265121), ("after <time-of-day>year", -5.1298987149230735),
("yearminute", -5.120983351265121)], ("yearminute", -5.1298987149230735)],
n = 102}}), n = 103}}),
("after lunch/work/school", ("after lunch/work/school",
Classifier{okData = Classifier{okData =
ClassData{prior = 0.0, unseen = -1.3862943611198906, ClassData{prior = 0.0, unseen = -1.3862943611198906,
@ -1343,18 +1349,17 @@ classifiers
n = 1}}), n = 1}}),
("time-of-day (latent)", ("time-of-day (latent)",
Classifier{okData = Classifier{okData =
ClassData{prior = -0.5500463369192721, unseen = -4.143134726391533, ClassData{prior = -0.5596157879354228, unseen = -4.143134726391533,
likelihoods = likelihoods =
HashMap.fromList HashMap.fromList
[("integer (numeric)", -0.10178269430994236), [("integer (numeric)", -0.10178269430994236),
("integer (0..19)", -2.3353749158170367)], ("integer (0..19)", -2.3353749158170367)],
n = 60}, n = 60},
koData = koData =
ClassData{prior = -0.8602012652231115, ClassData{prior = -0.8472978603872037, unseen = -3.871201010907891,
unseen = -3.8501476017100584,
likelihoods = likelihoods =
HashMap.fromList [("integer (numeric)", -2.197890671877523e-2)], HashMap.fromList [("integer (numeric)", -2.150620522096362e-2)],
n = 44}}), n = 45}}),
("year", ("year",
Classifier{okData = Classifier{okData =
ClassData{prior = -0.2113090936672069, unseen = -3.58351893845611, ClassData{prior = -0.2113090936672069, unseen = -3.58351893845611,
@ -1897,9 +1902,9 @@ classifiers
ClassData{prior = -infinity, unseen = -0.6931471805599453, ClassData{prior = -infinity, unseen = -0.6931471805599453,
likelihoods = HashMap.fromList [], n = 0}, likelihoods = HashMap.fromList [], n = 0},
koData = koData =
ClassData{prior = 0.0, unseen = -3.2188758248682006, ClassData{prior = 0.0, unseen = -3.258096538021482,
likelihoods = HashMap.fromList [("integer (numeric)", 0.0)], likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],
n = 23}}), n = 24}}),
("about|exactly <duration>", ("about|exactly <duration>",
Classifier{okData = Classifier{okData =
ClassData{prior = 0.0, unseen = -1.6094379124341003, ClassData{prior = 0.0, unseen = -1.6094379124341003,
@ -2116,8 +2121,8 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}), likelihoods = HashMap.fromList [], n = 0}}),
("ordinal (digits)", ("ordinal (digits)",
Classifier{okData = Classifier{okData =
ClassData{prior = 0.0, unseen = -3.4339872044851463, ClassData{prior = 0.0, unseen = -3.5553480614894135,
likelihoods = HashMap.fromList [("", 0.0)], n = 29}, likelihoods = HashMap.fromList [("", 0.0)], n = 33},
koData = koData =
ClassData{prior = -infinity, unseen = -0.6931471805599453, ClassData{prior = -infinity, unseen = -0.6931471805599453,
likelihoods = HashMap.fromList [], n = 0}}), likelihoods = HashMap.fromList [], n = 0}}),
@ -2285,6 +2290,24 @@ classifiers
ClassData{prior = -3.2188758248682006, ClassData{prior = -3.2188758248682006,
unseen = -1.0986122886681098, unseen = -1.0986122886681098,
likelihoods = HashMap.fromList [("", 0.0)], n = 1}}), likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),
("dd-dd <month> (interval)",
Classifier{okData =
ClassData{prior = 0.0, unseen = -2.9444389791664407,
likelihoods =
HashMap.fromList
[("integer (numeric)integer (numeric)September",
-1.791759469228055),
("ordinal (digits)ordinal (digits)July", -2.1972245773362196),
("ordinal (digits)ordinal (digits)October",
-2.1972245773362196),
("integer (numeric)integer (numeric)July", -2.1972245773362196),
("month", -0.9444616088408514),
("ordinal (digits)ordinal (digits)August",
-2.1972245773362196)],
n = 6},
koData =
ClassData{prior = -infinity, unseen = -1.9459101490553135,
likelihoods = HashMap.fromList [], n = 0}}),
("this <time>", ("this <time>",
Classifier{okData = Classifier{okData =
ClassData{prior = -0.10536051565782628, ClassData{prior = -0.10536051565782628,
@ -2309,8 +2332,8 @@ classifiers
n = 1}}), n = 1}}),
("August", ("August",
Classifier{okData = Classifier{okData =
ClassData{prior = 0.0, unseen = -1.9459101490553135, ClassData{prior = 0.0, unseen = -2.0794415416798357,
likelihoods = HashMap.fromList [("", 0.0)], n = 5}, likelihoods = HashMap.fromList [("", 0.0)], n = 6},
koData = koData =
ClassData{prior = -infinity, unseen = -0.6931471805599453, ClassData{prior = -infinity, unseen = -0.6931471805599453,
likelihoods = HashMap.fromList [], n = 0}})] likelihoods = HashMap.fromList [], n = 0}})]

View File

@ -900,4 +900,17 @@ allExamples = concat
[ "August 27th - 29th" [ "August 27th - 29th"
, "from August 27th - 29th" , "from August 27th - 29th"
] ]
, examples (datetimeInterval ((2013, 10, 23, 0, 0, 0), (2013, 10, 27, 0, 0, 0)) Day)
[ "23rd to 26th Oct"
]
, examples (datetimeInterval ((2013, 9, 1, 0, 0, 0), (2013, 9, 9, 0, 0, 0)) Day)
[ "1-8 september"
]
, examples (datetimeInterval ((2013, 9, 12, 0, 0, 0), (2013, 9, 17, 0, 0, 0)) Day)
[ "12 to 16 september"
]
, examples (datetimeInterval ((2013, 8, 19, 0, 0, 0), (2013, 8, 22, 0, 0, 0)) Day)
[ "19th To 21st aug"
]
] ]

View File

@ -944,6 +944,27 @@ ruleIntervalMonthDDDD = Rule
_ -> Nothing _ -> Nothing
} }
ruleIntervalDDDDMonth :: Rule
ruleIntervalDDDDMonth = Rule
{ name = "dd-dd <month> (interval)"
, pattern =
[ Predicate isDOMValue
, regex "\\-|to|th?ru|through|(un)?til(l)?"
, Predicate isDOMValue
, Predicate isAMonth
]
, prod = \tokens -> case tokens of
(token1:
_:
token2:
Token Time td:
_) -> do
dom1 <- intersectDOM td token1
dom2 <- intersectDOM td token2
Token Time <$> interval TTime.Closed dom1 dom2
_ -> Nothing
}
ruleIntervalFromMonthDDDD :: Rule ruleIntervalFromMonthDDDD :: Rule
ruleIntervalFromMonthDDDD = Rule ruleIntervalFromMonthDDDD = Rule
{ name = "from <month> dd-dd (interval)" { name = "from <month> dd-dd (interval)"
@ -1688,6 +1709,7 @@ rules =
, ruleIntervalFromMonthDDDD , ruleIntervalFromMonthDDDD
, ruleIntervalFromDDDDMonth , ruleIntervalFromDDDDMonth
, ruleIntervalMonthDDDD , ruleIntervalMonthDDDD
, ruleIntervalDDDDMonth
, ruleIntervalDash , ruleIntervalDash
, ruleIntervalFrom , ruleIntervalFrom
, ruleIntervalBetween , ruleIntervalBetween