adds german time rule for expressions like: Montag in 3 Wochen (#332)

Summary:
closes https://github.com/facebook/duckling/issues/331

Pull Request resolved: https://github.com/facebook/duckling/pull/332

Reviewed By: girifb

Differential Revision: D26283481

Pulled By: chessai

fbshipit-source-id: 054c6467a69896ff3ebbd1f9bc0734aadf1b6dbe
This commit is contained in:
Maurice Döpke 2021-02-09 14:28:42 -08:00 committed by Facebook GitHub Bot
parent 998b13bceb
commit 75af12524f
3 changed files with 398 additions and 347 deletions

View File

@ -42,11 +42,11 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("integer (numeric)",
Classifier{okData =
ClassData{prior = -0.41886243767998566,
unseen = -5.8522024797744745,
likelihoods = HashMap.fromList [("", 0.0)], n = 346},
ClassData{prior = -0.41689380393178715,
unseen = -5.857933154483459,
likelihoods = HashMap.fromList [("", 0.0)], n = 348},
koData =
ClassData{prior = -1.0723443618474995, unseen = -5.204006687076795,
ClassData{prior = -1.0761394328160512, unseen = -5.204006687076795,
likelihoods = HashMap.fromList [("", 0.0)], n = 180}}),
("exactly <time-of-day>",
Classifier{okData =
@ -348,11 +348,11 @@ classifiers
n = 8}}),
("integer (0..19)",
Classifier{okData =
ClassData{prior = -0.10536051565782628,
unseen = -3.6375861597263857,
likelihoods = HashMap.fromList [("", 0.0)], n = 36},
ClassData{prior = -0.10008345855698253,
unseen = -3.6888794541139363,
likelihoods = HashMap.fromList [("", 0.0)], n = 38},
koData =
ClassData{prior = -2.3025850929940455, unseen = -1.791759469228055,
ClassData{prior = -2.3513752571634776, unseen = -1.791759469228055,
likelihoods = HashMap.fromList [("", 0.0)], n = 4}}),
("between <time-of-day> and <time-of-day> (interval)",
Classifier{okData =
@ -579,334 +579,337 @@ classifiers
n = 3}}),
("intersect",
Classifier{okData =
ClassData{prior = -0.11743683520286512,
unseen = -7.332369205929062,
ClassData{prior = -0.12020308869575518,
unseen = -7.333676395657684,
likelihoods =
HashMap.fromList
[("Boghiyear", -6.638567789166521),
("Lailat al-Qadryear", -5.134490392390246),
("Samstag<time-of-day> o'clock", -6.638567789166521),
("hourday", -5.385804820671153),
("<datetime> - <datetime> (interval)year", -5.385804820671153),
("dayhour", -2.937265815054027),
("daymonth", -3.39988933700214),
("Orthodoxer Ostersonntagyear", -6.638567789166521),
[("Boghiyear", -6.639875833826536),
("Lailat al-Qadryear", -5.135798437050262),
("Samstag<time-of-day> o'clock", -6.639875833826536),
("hourday", -5.387112865331168),
("<datetime> - <datetime> (interval)year", -5.387112865331168),
("dayhour", -2.9385738597140425),
("daymonth", -3.4011973816621555),
("Orthodoxer Ostersonntagyear", -6.639875833826536),
("<day-of-month>(ordinal) <named-month> year<time-of-day> o'clock",
-6.638567789166521),
("monthyear", -4.846808319938465),
("yearhour", -6.638567789166521),
("Naraka Chaturdashiyear", -6.233102681058356),
("Govardhan Pujayear", -6.233102681058356),
("Juliintersect", -6.638567789166521),
("intersect<time-of-day> o'clock", -4.49850162567025),
("after lunchat <time-of-day>", -6.638567789166521),
-6.639875833826536),
("monthyear", -4.848116364598481),
("yearhour", -6.639875833826536),
("Naraka Chaturdashiyear", -6.234410725718371),
("Govardhan Pujayear", -6.234410725718371),
("Juliintersect", -6.639875833826536),
("intersect<time-of-day> o'clock", -4.499809670330265),
("after lunchat <time-of-day>", -6.639875833826536),
("absorption of , after named daymm/dd/yyyy",
-6.638567789166521),
("intersectJuli", -5.945420608606575),
("Isra and Mi'rajyear", -5.722277057292366),
("Schawuotyear", -6.233102681058356),
("Aschermontagyear", -5.945420608606575),
("<day-of-month> (ordinal)Dienstag", -6.638567789166521),
("Sukkotyear", -6.233102681058356),
("intersect by 'of', 'from', 'syear", -6.233102681058356),
("<day-of-month> (ordinal)September", -6.233102681058356),
("intersect<time> <part-of-day>", -4.5591262474866845),
("Jom Kippuryear", -6.233102681058356),
("<time-of-day> o'clockafter lunch", -5.945420608606575),
("<day-of-month> (ordinal)Mittwoch", -6.638567789166521),
("Montagthis <cycle>", -6.638567789166521),
("Holiyear", -5.945420608606575),
-6.639875833826536),
("intersectJuli", -5.94672865326659),
("Isra and Mi'rajyear", -5.723585101952381),
("Schawuotyear", -6.234410725718371),
("Aschermontagyear", -5.94672865326659),
("<day-of-month> (ordinal)Dienstag", -6.639875833826536),
("Sukkotyear", -6.234410725718371),
("intersect by 'of', 'from', 'syear", -6.234410725718371),
("<day-of-month> (ordinal)September", -6.234410725718371),
("intersect<time> <part-of-day>", -4.5604342921467),
("Jom Kippuryear", -6.234410725718371),
("<time-of-day> o'clockafter lunch", -5.94672865326659),
("<day-of-month> (ordinal)Mittwoch", -6.639875833826536),
("Montagthis <cycle>", -6.639875833826536),
("Holiyear", -5.94672865326659),
("<time> <part-of-day><time-of-day> o'clock",
-6.638567789166521),
("Oktoberyear", -5.539955500498411),
("today<time-of-day> o'clock", -6.638567789166521),
("Dhanterasyear", -6.233102681058356),
("<time-of-day> o'clockon <date>", -6.233102681058356),
("Islamisches Neujahryear", -6.233102681058356),
("intersect by ','year", -5.539955500498411),
("Holika Dahanyear", -5.945420608606575),
("on <date><time-of-day> o'clock", -6.638567789166521),
("exactly <time-of-day>tomorrow", -6.233102681058356),
("Jumu'atul-Widayear", -5.722277057292366),
("mm/dd<time-of-day> o'clock", -6.638567789166521),
("monthhour", -6.233102681058356),
-6.639875833826536),
("Oktoberyear", -5.541263545158426),
("today<time-of-day> o'clock", -6.639875833826536),
("Dhanterasyear", -6.234410725718371),
("<time-of-day> o'clockon <date>", -6.234410725718371),
("Islamisches Neujahryear", -6.234410725718371),
("intersect by ','year", -5.541263545158426),
("Holika Dahanyear", -5.94672865326659),
("on <date><time-of-day> o'clock", -6.639875833826536),
("exactly <time-of-day>tomorrow", -6.234410725718371),
("Jumu'atul-Widayear", -5.723585101952381),
("mm/dd<time-of-day> o'clock", -6.639875833826536),
("monthhour", -6.234410725718371),
("on <date>between <datetime> and <datetime> (interval)",
-6.233102681058356),
("last <day-of-week> of <time>year", -6.638567789166521),
("hourmonth", -6.233102681058356),
("Krishna Janmashtamiyear", -6.233102681058356),
("todayat <time-of-day>", -5.945420608606575),
("Guru Gobind Singh Jayantiyear", -6.638567789166521),
("mm/ddabout <time-of-day>", -6.233102681058356),
-6.234410725718371),
("last <day-of-week> of <time>year", -6.639875833826536),
("hourmonth", -6.234410725718371),
("Krishna Janmashtamiyear", -6.234410725718371),
("todayat <time-of-day>", -5.94672865326659),
("Guru Gobind Singh Jayantiyear", -6.639875833826536),
("mm/ddabout <time-of-day>", -6.234410725718371),
("Donnerstagfrom <datetime> - <datetime> (interval)",
-5.722277057292366),
("<day-of-month> (ordinal)Mai", -6.638567789166521),
-5.723585101952381),
("<day-of-month> (ordinal)Mai", -6.639875833826536),
("on <date>between <time-of-day> and <time-of-day> (interval)",
-6.233102681058356),
("Christi Himmelfahrtyear", -5.945420608606575),
("on <date>at <time-of-day>", -6.233102681058356),
("dayday", -3.460513958818575),
("<time> <part-of-day>at <time-of-day>", -6.233102681058356),
("Thai Pongalyear", -5.722277057292366),
("Thiru Onamyear", -5.945420608606575),
("Maulid an-Nab\299year", -6.233102681058356),
("Vijayadashamiyear", -6.233102681058356),
("about <time-of-day>on <date>", -6.638567789166521),
-6.234410725718371),
("Christi Himmelfahrtyear", -5.94672865326659),
("on <date>at <time-of-day>", -6.234410725718371),
("dayday", -3.46182200347859),
("<time> <part-of-day>at <time-of-day>", -6.234410725718371),
("Thai Pongalyear", -5.723585101952381),
("Thiru Onamyear", -5.94672865326659),
("Maulid an-Nab\299year", -6.234410725718371),
("Vijayadashamiyear", -6.234410725718371),
("about <time-of-day>on <date>", -6.639875833826536),
("<hour-of-day> <integer> (as relative minutes)in|during the <part-of-day>",
-6.233102681058356),
("<day-of-month> (ordinal)intersect", -5.385804820671153),
("hourhour", -4.112839144858265),
("hh:mmintersect by ','", -5.385804820671153),
-6.234410725718371),
("<day-of-month> (ordinal)intersect", -5.387112865331168),
("hourhour", -4.11414718951828),
("hh:mmintersect by ','", -5.387112865331168),
("Donnerstagfrom <time-of-day> - <time-of-day> (interval)",
-5.385804820671153),
("Dienstagthis <cycle>", -6.638567789166521),
("<part-of-day> of <time>Februar", -6.233102681058356),
("Raksha Bandhanyear", -6.638567789166521),
("Tu biSchevatyear", -6.233102681058356),
("dayyear", -1.8427772435697796),
("Eid al-Adhayear", -4.49850162567025),
("Orthodoxer Palmsonntagyear", -6.638567789166521),
("K\246nigstagyear", -5.945420608606575),
("Mittwochthis <cycle>", -6.638567789166521),
("Jom HaShoahyear", -5.722277057292366),
("Lag BaOmeryear", -6.233102681058356),
-5.387112865331168),
("Dienstagthis <cycle>", -6.639875833826536),
("<part-of-day> of <time>Februar", -6.234410725718371),
("Raksha Bandhanyear", -6.639875833826536),
("Tu biSchevatyear", -6.234410725718371),
("dayyear", -1.844085288229795),
("Eid al-Adhayear", -4.499809670330265),
("Orthodoxer Palmsonntagyear", -6.639875833826536),
("K\246nigstagyear", -5.94672865326659),
("Mittwochthis <cycle>", -6.639875833826536),
("Jom HaShoahyear", -5.723585101952381),
("Lag BaOmeryear", -6.234410725718371),
("<time-of-day> o'clockin|during the <part-of-day>",
-5.539955500498411),
("Guru Ravidass Jayantiyear", -5.539955500498411),
("tomorrow<time-of-day> o'clock", -6.233102681058356),
("<time-of-day> o'clocktomorrow", -5.945420608606575),
("Jom Ha'atzmautyear", -5.945420608606575),
-5.541263545158426),
("Guru Ravidass Jayantiyear", -5.541263545158426),
("tomorrow<time-of-day> o'clock", -6.234410725718371),
("<time-of-day> o'clocktomorrow", -5.94672865326659),
("Jom Ha'atzmautyear", -5.94672865326659),
("<day-of-month>(ordinal) <named-month>year",
-5.945420608606575),
-5.94672865326659),
("half <integer> (german style hour-of-day)after lunch",
-6.638567789166521),
("Pargat Diwasyear", -5.722277057292366),
-6.639875833826536),
("Pargat Diwasyear", -5.723585101952381),
("absorption of , after named day<day-of-month>(ordinal) <named-month>",
-5.385804820671153),
("Rabindra Jayantiyear", -5.722277057292366),
("hourminute", -5.945420608606575),
("the <day-of-month> (ordinal)Juli", -6.638567789166521),
("Ostermontagyear", -6.638567789166521),
("Fastenzeityear", -6.638567789166521),
-5.387112865331168),
("Rabindra Jayantiyear", -5.723585101952381),
("hourminute", -5.94672865326659),
("the <day-of-month> (ordinal)Juli", -6.639875833826536),
("Ostermontagyear", -6.639875833826536),
("Fastenzeityear", -6.639875833826536),
("on <date><day-of-month>(ordinal) <named-month>",
-6.233102681058356),
("minutemonth", -4.112839144858265),
("minutehour", -4.387275990560026),
("Maha Navamiyear", -6.638567789166521),
("Simchat Torahyear", -6.638567789166521),
-6.234410725718371),
("minutemonth", -4.11414718951828),
("minutehour", -4.388584035220041),
("Maha Navamiyear", -6.639875833826536),
("Simchat Torahyear", -6.639875833826536),
("at <time-of-day>in|during the <part-of-day>",
-5.722277057292366),
("Palmsonntagyear", -6.638567789166521),
-5.723585101952381),
("Palmsonntagyear", -6.639875833826536),
("absorption of , after named day<day-of-month>(ordinal) <named-month> year",
-6.233102681058356),
-6.234410725718371),
("absorption of , after named day<named-month> <day-of-month> (non ordinal)",
-5.539955500498411),
("Kaanum Pongalyear", -6.233102681058356),
("Maha Saptamiyear", -6.638567789166521),
-5.541263545158426),
("Kaanum Pongalyear", -6.234410725718371),
("Maha Saptamiyear", -6.639875833826536),
("<day-of-month>(ordinal) <named-month> year<time> <part-of-day>",
-6.638567789166521),
-6.639875833826536),
("<hour-of-day> <integer> (as relative minutes)after lunch",
-6.638567789166521),
("Donnerstag<time> timezone", -6.233102681058356),
("on <date>Dezember", -6.638567789166521),
("Parsi Neujahryear", -5.722277057292366),
("Corpus Christiyear", -6.233102681058356),
("Samstagat <time-of-day>", -6.233102681058356),
-6.639875833826536),
("Donnerstag<time> timezone", -6.234410725718371),
("on <date>Dezember", -6.639875833826536),
("Parsi Neujahryear", -5.723585101952381),
("Corpus Christiyear", -6.234410725718371),
("Samstagat <time-of-day>", -6.234410725718371),
("intersect<day-of-month>(ordinal) <named-month>",
-5.385804820671153),
("Orthodoxer Ostermontagyear", -6.638567789166521),
-5.387112865331168),
("Orthodoxer Ostermontagyear", -6.639875833826536),
("this <part-of-day><time-of-day> o'clock",
-6.638567789166521),
-6.639875833826536),
("<day-of-month>(ordinal) <named-month>intersect",
-6.638567789166521),
("hh:mmintersect", -4.196220753797316),
("Fastnachtyear", -5.945420608606575),
("Donnerstaghh:mm", -6.638567789166521),
("Weihnachtenyear", -6.638567789166521),
("<day-of-month> (ordinal)Juli", -5.945420608606575),
("Dayananda Saraswati Jayantiyear", -6.638567789166521),
("Orthodoxer Karfreitagyear", -6.638567789166521),
("Chanukkayear", -6.233102681058356),
("intersect by ','intersect", -5.385804820671153),
("intersect by 'of', 'from', 'sJuli", -6.638567789166521),
-6.639875833826536),
("hh:mmintersect", -4.1975287984573315),
("Fastnachtyear", -5.94672865326659),
("Donnerstaghh:mm", -6.639875833826536),
("Weihnachtenyear", -6.639875833826536),
("<day-of-month> (ordinal)Juli", -5.94672865326659),
("Dayananda Saraswati Jayantiyear", -6.639875833826536),
("Orthodoxer Karfreitagyear", -6.639875833826536),
("Chanukkayear", -6.234410725718371),
("intersect by ','intersect", -5.387112865331168),
("intersect by 'of', 'from', 'sJuli", -6.639875833826536),
("half <integer> (german style hour-of-day)in|during the <part-of-day>",
-6.233102681058356),
("Mahavir Jayantiyear", -6.233102681058356),
-6.234410725718371),
("Mahavir Jayantiyear", -6.234410725718371),
("from <datetime> - <datetime> (interval)year",
-5.945420608606575),
("at <time-of-day>intersect", -4.846808319938465),
-5.94672865326659),
("at <time-of-day>intersect", -4.848116364598481),
("on <date>from <time-of-day> - <time-of-day> (interval)",
-5.722277057292366),
-5.723585101952381),
("<time> <part-of-day>from <time-of-day> - <time-of-day> (interval)",
-6.638567789166521),
-6.639875833826536),
("absorption of , after named day<day-of-month> (ordinal)",
-5.385804820671153),
-5.387112865331168),
("Donnerstagbetween <time-of-day> and <time-of-day> (interval)",
-6.233102681058356),
("Dreifaltigkeitssonntagyear", -5.722277057292366),
("Tisha B'Avyear", -6.638567789166521),
("the <day-of-month> (ordinal)Dezember", -6.638567789166521),
("dayminute", -3.865979066926739),
-6.234410725718371),
("Dreifaltigkeitssonntagyear", -5.723585101952381),
("Tisha B'Avyear", -6.639875833826536),
("the <day-of-month> (ordinal)Dezember", -6.639875833826536),
("dayminute", -3.8672871115867546),
("on <date>from <datetime> - <datetime> (interval)",
-6.233102681058356),
("Maiyear", -6.638567789166521),
("Mittwochnext <cycle>", -6.638567789166521),
-6.234410725718371),
("Maiyear", -6.639875833826536),
("Mittwochnext <cycle>", -6.639875833826536),
("Donnerstagbetween <datetime> and <datetime> (interval)",
-6.233102681058356),
-6.234410725718371),
("<time> <part-of-day>from <datetime> - <datetime> (interval)",
-6.638567789166521),
("intersectyear", -4.766765612264929),
("on <date>intersect", -6.233102681058356),
("on <date><day-of-month> (ordinal)", -6.233102681058356),
("intersectSeptember", -3.999510459551262),
("<ordinal> <cycle> of <time>year", -6.638567789166521),
("minuteday", -2.788420187456462),
("absorption of , after named dayintersect", -4.24067251636815),
("intersect by ','September", -5.25227342804663),
("year<time-of-day> o'clock", -6.638567789166521),
("Juliyear", -6.233102681058356),
("at <time-of-day>intersect by ','", -5.945420608606575),
("hh:mmabsorption of , after named day", -6.233102681058356),
("Earth Houryear", -6.233102681058356),
("intersect by ','<time> <part-of-day>", -5.722277057292366),
("Karfreitagyear", -5.945420608606575),
("Chinesisches Neujahryear", -6.638567789166521),
("Gr\252ndonnerstagyear", -5.539955500498411),
("hh:mmon <date>", -4.196220753797316),
("Pfingstenyear", -6.233102681058356),
("Mattu Pongalyear", -6.638567789166521),
("Rosch haSchanayear", -5.945420608606575),
-6.639875833826536),
("intersectyear", -4.768073656924945),
("on <date>intersect", -6.234410725718371),
("on <date><day-of-month> (ordinal)", -6.234410725718371),
("intersectSeptember", -4.000818504211277),
("<ordinal> <cycle> of <time>year", -6.639875833826536),
("minuteday", -2.7897282321164774),
("absorption of , after named dayintersect",
-4.241980561028165),
("intersect by ','September", -5.253581472706645),
("year<time-of-day> o'clock", -6.639875833826536),
("Juliyear", -6.234410725718371),
("at <time-of-day>intersect by ','", -5.94672865326659),
("hh:mmabsorption of , after named day", -6.234410725718371),
("Earth Houryear", -6.234410725718371),
("intersect by ','<time> <part-of-day>", -5.723585101952381),
("Karfreitagyear", -5.94672865326659),
("Chinesisches Neujahryear", -6.639875833826536),
("Gr\252ndonnerstagyear", -5.541263545158426),
("hh:mmon <date>", -4.1975287984573315),
("Pfingstenyear", -6.234410725718371),
("Mattu Pongalyear", -6.639875833826536),
("Rosch haSchanayear", -5.94672865326659),
("at <time-of-day>absorption of , after named day",
-6.638567789166521),
("until <time-of-day>after lunch", -6.638567789166521),
("Pfingstmontagyear", -6.233102681058356),
("mm/ddyear", -6.233102681058356),
("intersect by ','<time-of-day> o'clock", -5.722277057292366),
("intersect<day-of-month> (ordinal)", -5.385804820671153),
("absorption of , after named daymm/dd", -6.638567789166521),
("on <date>September", -5.722277057292366),
("Septemberyear", -6.233102681058356),
-6.639875833826536),
("until <time-of-day>after lunch", -6.639875833826536),
("Pfingstmontagyear", -6.234410725718371),
("mm/ddyear", -6.234410725718371),
("intersect by ','<time-of-day> o'clock", -5.723585101952381),
("intersect<day-of-month> (ordinal)", -5.387112865331168),
("absorption of , after named daymm/dd", -6.639875833826536),
("on <date>September", -5.723585101952381),
("Septemberyear", -6.234410725718371),
("<day-of-month> (ordinal)intersect by 'of', 'from', 's",
-5.945420608606575),
("at <time-of-day>on <date>", -4.766765612264929),
("Pessachyear", -5.539955500498411),
("intersectintersect", -4.5591262474866845),
("<day-of-month> (ordinal)Februar", -5.539955500498411),
("Aschurayear", -5.945420608606575),
("dayweek", -5.539955500498411),
("intersect by ','Juli", -5.945420608606575),
-5.94672865326659),
("at <time-of-day>on <date>", -4.768073656924945),
("Pessachyear", -5.541263545158426),
("intersectintersect", -4.5604342921467),
("<day-of-month> (ordinal)Februar", -5.541263545158426),
("Aschurayear", -5.94672865326659),
("dayweek", -5.541263545158426),
("intersect by ','Juli", -5.94672865326659),
("absorption of , after named daythe <day-of-month> (ordinal)",
-6.638567789166521),
("weekyear", -6.233102681058356),
("<day-of-month> (ordinal)Dezember", -5.539955500498411),
("hh:mmin|during the <part-of-day>", -5.722277057292366),
("Karva Chauthyear", -6.233102681058356),
("Orthodoxer Karsamstagyear", -6.638567789166521),
("Navaratriyear", -6.233102681058356),
("Maha Shivaratriyear", -6.638567789166521),
("Ramadanyear", -5.385804820671153),
("Marzyear", -6.638567789166521),
("Bhai Doojyear", -6.638567789166521),
("tomorrowat <time-of-day>", -6.233102681058356),
-6.639875833826536),
("weekyear", -6.234410725718371),
("<day-of-month> (ordinal)Dezember", -5.541263545158426),
("hh:mmin|during the <part-of-day>", -5.723585101952381),
("Karva Chauthyear", -6.234410725718371),
("Orthodoxer Karsamstagyear", -6.639875833826536),
("Navaratriyear", -6.234410725718371),
("Maha Shivaratriyear", -6.639875833826536),
("Ramadanyear", -5.387112865331168),
("Marzyear", -6.639875833826536),
("Bhai Doojyear", -6.639875833826536),
("tomorrowat <time-of-day>", -6.234410725718371),
("<hour-of-day> <integer> (as relative minutes)on <date>",
-6.638567789166521),
("Eid al-Fitryear", -5.25227342804663),
-6.639875833826536),
("Eid al-Fitryear", -5.253581472706645),
("Donnerstag<time-of-day> - <time-of-day> (interval)",
-6.233102681058356),
-6.234410725718371),
("Donnerstag<datetime> - <datetime> (interval)",
-6.638567789166521),
("Aschermittwochyear", -5.945420608606575),
("Lazarus-Samstagyear", -6.233102681058356),
("Sonntaglast <cycle>", -6.638567789166521),
("at <time-of-day>tomorrow", -6.638567789166521),
("Ostersonntagyear", -6.638567789166521),
("tomorrowabout <time-of-day>", -6.233102681058356),
("Gro\223e Fastenzeityear", -6.638567789166521),
-6.639875833826536),
("Aschermittwochyear", -5.94672865326659),
("Lazarus-Samstagyear", -6.234410725718371),
("Sonntaglast <cycle>", -6.639875833826536),
("at <time-of-day>tomorrow", -6.639875833826536),
("Ostersonntagyear", -6.639875833826536),
("tomorrowabout <time-of-day>", -6.234410725718371),
("Gro\223e Fastenzeityear", -6.639875833826536),
("about <time-of-day>in|during the <part-of-day>",
-6.233102681058356),
("Schmini Azeretyear", -5.945420608606575),
-6.234410725718371),
("Schmini Azeretyear", -5.94672865326659),
("half <integer> (german style hour-of-day)on <date>",
-6.638567789166521),
("this <part-of-day>at <time-of-day>", -6.233102681058356),
("<datetime> - <datetime> (interval)Juli", -6.233102681058356),
("Vaisakhiyear", -5.722277057292366),
("Diwaliyear", -5.945420608606575),
-6.639875833826536),
("this <part-of-day>at <time-of-day>", -6.234410725718371),
("<datetime> - <datetime> (interval)Juli", -6.234410725718371),
("Vaisakhiyear", -5.723585101952381),
("Diwaliyear", -5.94672865326659),
("after lunch<hour-of-day> <integer> (as relative minutes)",
-6.233102681058356),
("<day-of-month> (ordinal)Marz", -6.638567789166521),
("last <cycle> of <time>year", -6.233102681058356),
-6.234410725718371),
("<day-of-month> (ordinal)Marz", -6.639875833826536),
("last <cycle> of <time>year", -6.234410725718371),
("<named-month> <day-of-month> (non ordinal)year",
-6.638567789166521),
("minuteyear", -6.233102681058356),
-6.639875833826536),
("minuteyear", -6.234410725718371),
("<day-of-month> (non ordinal) <named-month>year",
-6.638567789166521),
("Chhathyear", -5.945420608606575),
("Vasant Panchamiyear", -6.233102681058356),
("Global Youth Service-Tagyear", -6.638567789166521),
("Karsamstagyear", -5.945420608606575)],
-6.639875833826536),
("Chhathyear", -5.94672865326659),
("Vasant Panchamiyear", -6.234410725718371),
("Global Youth Service-Tagyear", -6.639875833826536),
("Karsamstagyear", -5.94672865326659)],
n = 642},
koData =
ClassData{prior = -2.1999985042189447, unseen = -6.003887067106539,
ClassData{prior = -2.178072145121463, unseen = -6.018593214496234,
likelihoods =
HashMap.fromList
[("absorption of , after named daythe <day-of-month> (non ordinal)",
-5.308267697401205),
("<datetime> - <datetime> (interval)year", -5.308267697401205),
("dayhour", -4.61512051684126),
("daymonth", -3.6035196051627794),
("monthyear", -5.308267697401205),
("yearhour", -5.308267697401205),
("after lunchat <time-of-day>", -4.9028025892930405),
("mm/dduntil <time-of-day>", -4.9028025892930405),
("until <time-of-day>year", -4.9028025892930405),
("<day-of-month> (ordinal)Dienstag", -4.9028025892930405),
("absorption of , after named dayFebruar", -4.209655408733095),
("Donnerstagyear", -4.61512051684126),
("on <date>Februar", -5.308267697401205),
("intersect by 'of', 'from', 'syear", -4.61512051684126),
("intersect<time> <part-of-day>", -5.308267697401205),
("<time-of-day> o'clockafter lunch", -5.308267697401205),
("<day-of-month> (ordinal)Mittwoch", -5.308267697401205),
("after lunch<time-of-day> o'clock", -5.308267697401205),
("Holiyear", -5.308267697401205),
("absorption of , after named dayhh:mm", -5.308267697401205),
-5.3230099791384085),
("<datetime> - <datetime> (interval)year", -5.3230099791384085),
("Mittwochby the end of <time>", -4.917544871030244),
("dayhour", -4.629862798578463),
("daymonth", -3.618261886899983),
("monthyear", -5.3230099791384085),
("yearhour", -5.3230099791384085),
("after lunchat <time-of-day>", -4.917544871030244),
("mm/dduntil <time-of-day>", -4.917544871030244),
("until <time-of-day>year", -4.917544871030244),
("<day-of-month> (ordinal)Dienstag", -4.917544871030244),
("absorption of , after named dayFebruar", -4.2243976904702984),
("Donnerstagyear", -4.629862798578463),
("on <date>Februar", -5.3230099791384085),
("intersect by 'of', 'from', 'syear", -4.629862798578463),
("intersect<time> <part-of-day>", -5.3230099791384085),
("<time-of-day> o'clockafter lunch", -5.3230099791384085),
("<day-of-month> (ordinal)Mittwoch", -5.3230099791384085),
("after lunch<time-of-day> o'clock", -5.3230099791384085),
("Holiyear", -5.3230099791384085),
("absorption of , after named dayhh:mm", -5.3230099791384085),
("<time-of-day> o'clock<time> <part-of-day>",
-4.39197696552705),
("monthhour", -5.308267697401205),
("todayat <time-of-day>", -5.308267697401205),
("dayday", -3.9219733362813143),
("Thai Pongalyear", -4.61512051684126),
("hourhour", -3.804190300624931),
("Donnerstagafter <time-of-day>", -5.308267697401205),
("dayyear", -2.2402147622675876),
("Ostermontagyear", -5.308267697401205),
("Fastenzeityear", -5.308267697401205),
("Palmsonntagyear", -5.308267697401205),
("Aprilyear", -5.308267697401205),
("Sonntagyear", -5.308267697401205),
("Montagyear", -4.61512051684126),
("Dienstagafter <time-of-day>", -5.308267697401205),
("Donnerstaghh:mm", -4.9028025892930405),
("<day-of-month> (ordinal)Juli", -4.9028025892930405),
("dayminute", -3.9219733362813143),
("until <time-of-day>Juli", -5.308267697401205),
("Karfreitagyear", -5.308267697401205),
("Freitagyear", -4.9028025892930405),
("year<time> <part-of-day>", -5.308267697401205),
("mm/ddyear", -3.804190300624931),
("Neujahryear", -4.39197696552705),
-4.406719247264253),
("monthhour", -5.3230099791384085),
("todayat <time-of-day>", -5.3230099791384085),
("dayday", -3.9367156180185177),
("Thai Pongalyear", -4.629862798578463),
("hourhour", -3.8189325823621343),
("Donnerstagafter <time-of-day>", -5.3230099791384085),
("dayyear", -2.254957044004791),
("Ostermontagyear", -5.3230099791384085),
("Fastenzeityear", -5.3230099791384085),
("Palmsonntagyear", -5.3230099791384085),
("Aprilyear", -5.3230099791384085),
("Sonntagyear", -5.3230099791384085),
("Montagyear", -4.629862798578463),
("Dienstagafter <time-of-day>", -5.3230099791384085),
("Donnerstaghh:mm", -4.917544871030244),
("<day-of-month> (ordinal)Juli", -4.917544871030244),
("dayminute", -3.9367156180185177),
("until <time-of-day>Juli", -5.3230099791384085),
("Karfreitagyear", -5.3230099791384085),
("Freitagyear", -4.917544871030244),
("year<time> <part-of-day>", -5.3230099791384085),
("mm/ddyear", -3.8189325823621343),
("Neujahryear", -4.406719247264253),
("<day-of-month> (ordinal)intersect by 'of', 'from', 's",
-4.9028025892930405),
("Donnerstag<part-of-day> of <time>", -5.308267697401205),
("<day-of-month> (ordinal)April", -5.308267697401205),
("Ostersonntagyear", -5.308267697401205),
("after <time-of-day>year", -5.308267697401205),
("on <date>after <time-of-day>", -5.308267697401205),
("Diwaliyear", -5.308267697401205),
("tomorrownoon", -5.308267697401205),
("Samstagyear", -4.61512051684126),
("Karsamstagyear", -5.308267697401205)],
n = 80}}),
-4.917544871030244),
("Donnerstag<part-of-day> of <time>", -5.3230099791384085),
("<day-of-month> (ordinal)April", -5.3230099791384085),
("daynograin", -4.917544871030244),
("Ostersonntagyear", -5.3230099791384085),
("after <time-of-day>year", -5.3230099791384085),
("on <date>after <time-of-day>", -5.3230099791384085),
("Diwaliyear", -5.3230099791384085),
("tomorrownoon", -5.3230099791384085),
("Samstagyear", -4.629862798578463),
("Karsamstagyear", -5.3230099791384085)],
n = 82}}),
("<ordinal> <cycle> of <time>",
Classifier{okData =
ClassData{prior = 0.0, unseen = -2.4849066497880004,
@ -1127,6 +1130,23 @@ classifiers
koData =
ClassData{prior = -infinity, unseen = -0.6931471805599453,
likelihoods = HashMap.fromList [], n = 0}}),
("<day-of-week> in <duration>",
Classifier{okData =
ClassData{prior = -0.2231435513142097,
unseen = -2.5649493574615367,
likelihoods =
HashMap.fromList
[("Mittwoch<integer> <unit-of-duration>", -0.8754687373538999),
("dayweek", -0.8754687373538999)],
n = 4},
koData =
ClassData{prior = -1.6094379124341003,
unseen = -1.9459101490553135,
likelihoods =
HashMap.fromList
[("dayday", -1.0986122886681098),
("Mittwochfortnight", -1.0986122886681098)],
n = 1}}),
("Orthodoxer Ostermontag",
Classifier{okData =
ClassData{prior = 0.0, unseen = -1.0986122886681098,
@ -1229,8 +1249,8 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("week (grain)",
Classifier{okData =
ClassData{prior = 0.0, unseen = -3.367295829986474,
likelihoods = HashMap.fromList [("", 0.0)], n = 27},
ClassData{prior = 0.0, unseen = -3.4965075614664802,
likelihoods = HashMap.fromList [("", 0.0)], n = 31},
koData =
ClassData{prior = -infinity, unseen = -0.6931471805599453,
likelihoods = HashMap.fromList [], n = 0}}),
@ -1593,19 +1613,20 @@ classifiers
n = 1}}),
("time-of-day (latent)",
Classifier{okData =
ClassData{prior = -0.21197025071608455, unseen = -4.31748811353631,
ClassData{prior = -0.23419338750079477, unseen = -4.31748811353631,
likelihoods =
HashMap.fromList
[("integer (numeric)", -6.995858860691034e-2),
("integer (0..19)", -2.6946271807700692)],
n = 72},
koData =
ClassData{prior = -1.6554230256759237, unseen = -2.995732273553991,
ClassData{prior = -1.5664205273504095,
unseen = -3.0910424533583156,
likelihoods =
HashMap.fromList
[("integer (numeric)", -0.17185025692665928),
("integer (0..19)", -1.845826690498331)],
n = 17}}),
[("integer (numeric)", -0.2113090936672069),
("integer (0..19)", -1.6582280766035324)],
n = 19}}),
("year",
Classifier{okData =
ClassData{prior = -1.731645001146093e-2,
@ -1631,29 +1652,29 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("<integer> <unit-of-duration>",
Classifier{okData =
ClassData{prior = -0.8850381883700507, unseen = -4.330733340286331,
ClassData{prior = -0.8034952377288106, unseen = -4.430816798843313,
likelihoods =
HashMap.fromList
[("week", -2.2380465718564744),
("integer (0..19)year (grain)", -3.2188758248682006),
("integer (numeric)day (grain)", -2.70805020110221),
("couplehour (grain)", -3.624340932976365),
("integer (0..19)hour (grain)", -3.2188758248682006),
("second", -3.624340932976365),
("integer (numeric)year (grain)", -3.624340932976365),
("day", -2.70805020110221), ("year", -2.9311937524164198),
("integer (numeric)week (grain)", -2.9311937524164198),
("integer (0..19)month (grain)", -3.624340932976365),
("integer (0..19)second (grain)", -3.624340932976365),
("hour", -2.70805020110221), ("month", -3.624340932976365),
("integer (numeric)minute (grain)", -2.5257286443082556),
("integer (0..19)minute (grain)", -3.624340932976365),
("minute", -2.371577964480997),
("integer (numeric)hour (grain)", -3.624340932976365),
("integer (0..19)week (grain)", -2.70805020110221)],
n = 26},
[("week", -1.9339339580085977),
("integer (0..19)year (grain)", -3.3202283191284883),
("integer (numeric)day (grain)", -2.8094026953624978),
("couplehour (grain)", -3.7256934272366524),
("integer (0..19)hour (grain)", -3.3202283191284883),
("second", -3.7256934272366524),
("integer (numeric)year (grain)", -3.7256934272366524),
("day", -2.8094026953624978), ("year", -3.0325462466767075),
("integer (numeric)week (grain)", -2.627081138568543),
("integer (0..19)month (grain)", -3.7256934272366524),
("integer (0..19)second (grain)", -3.7256934272366524),
("hour", -2.8094026953624978), ("month", -3.7256934272366524),
("integer (numeric)minute (grain)", -2.627081138568543),
("integer (0..19)minute (grain)", -3.7256934272366524),
("minute", -2.472930458741285),
("integer (numeric)hour (grain)", -3.7256934272366524),
("integer (0..19)week (grain)", -2.472930458741285)],
n = 30},
koData =
ClassData{prior = -0.5322168137473082, unseen = -4.584967478670572,
ClassData{prior = -0.5937747067467416, unseen = -4.584967478670572,
likelihoods =
HashMap.fromList
[("week", -2.62880082944807),
@ -1757,11 +1778,11 @@ classifiers
likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),
("Mittwoch",
Classifier{okData =
ClassData{prior = -0.11778303565638351,
unseen = -2.3025850929940455,
likelihoods = HashMap.fromList [("", 0.0)], n = 8},
ClassData{prior = -8.004270767353637e-2,
unseen = -2.639057329615259,
likelihoods = HashMap.fromList [("", 0.0)], n = 12},
koData =
ClassData{prior = -2.1972245773362196,
ClassData{prior = -2.5649493574615367,
unseen = -1.0986122886681098,
likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),
("Maulid an-Nab\299",
@ -2008,7 +2029,7 @@ classifiers
likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),
("<duration> ago",
Classifier{okData =
ClassData{prior = -0.13353139262452263,
ClassData{prior = -0.45198512374305727,
unseen = -3.044522437723423,
likelihoods =
HashMap.fromList
@ -2018,13 +2039,13 @@ classifiers
("month", -2.3025850929940455)],
n = 7},
koData =
ClassData{prior = -2.0794415416798357,
unseen = -2.1972245773362196,
ClassData{prior = -1.0116009116784799, unseen = -2.70805020110221,
likelihoods =
HashMap.fromList
[("day", -1.3862943611198906),
("fortnight", -1.3862943611198906)],
n = 1}}),
[("week", -1.540445040947149), ("day", -1.540445040947149),
("<integer> <unit-of-duration>", -1.540445040947149),
("fortnight", -1.540445040947149)],
n = 4}}),
("last <time>",
Classifier{okData =
ClassData{prior = 0.0, unseen = -2.0794415416798357,
@ -2273,38 +2294,43 @@ classifiers
ClassData{prior = -infinity, unseen = -1.6094379124341003,
likelihoods = HashMap.fromList [], n = 0},
koData =
ClassData{prior = 0.0, unseen = -2.5649493574615367,
ClassData{prior = 0.0, unseen = -2.833213344056216,
likelihoods =
HashMap.fromList
[("time-of-day (latent)", -1.0986122886681098),
("hh:mm", -1.791759469228055), ("hour", -1.0986122886681098),
("minute", -1.791759469228055)],
n = 4}}),
[("time-of-day (latent)", -0.9808292530117262),
("hh:mm", -2.0794415416798357), ("hour", -0.9808292530117262),
("minute", -2.0794415416798357)],
n = 6}}),
("in <duration>",
Classifier{okData =
ClassData{prior = -0.10008345855698253,
unseen = -3.912023005428146,
ClassData{prior = -0.2336148511815052,
unseen = -3.9318256327243257,
likelihoods =
HashMap.fromList
[("week", -2.793208009442517),
("<integer> and a half hour", -3.1986731175506815),
("second", -3.1986731175506815), ("day", -2.793208009442517),
("half an hour", -3.1986731175506815),
("year", -3.1986731175506815),
("<integer> <unit-of-duration>", -1.1192315758708455),
("number,number hours", -3.1986731175506815),
("hour", -2.2823823856765264),
("about|exactly <duration>", -3.1986731175506815),
("minute", -1.589235205116581)],
[("week", -2.8134107167600364),
("<integer> and a half hour", -3.2188758248682006),
("second", -3.2188758248682006), ("day", -2.8134107167600364),
("half an hour", -3.2188758248682006),
("year", -3.2188758248682006),
("<integer> <unit-of-duration>", -1.1394342831883648),
("number,number hours", -3.2188758248682006),
("hour", -2.3025850929940455),
("about|exactly <duration>", -3.2188758248682006),
("minute", -1.6094379124341003)],
n = 19},
koData =
ClassData{prior = -2.3513752571634776, unseen = -2.772588722239781,
ClassData{prior = -1.5686159179138452,
unseen = -3.1354942159291497,
likelihoods =
HashMap.fromList
[("<integer> and a half hour", -2.0149030205422647),
("about|exactly <duration>", -2.0149030205422647),
("minute", -1.6094379124341003)],
n = 2}}),
[("week", -1.9924301646902063),
("<integer> and a half hour", -2.3978952727983707),
("day", -2.3978952727983707),
("<integer> <unit-of-duration>", -1.9924301646902063),
("about|exactly <duration>", -2.3978952727983707),
("fortnight", -2.3978952727983707),
("minute", -1.9924301646902063)],
n = 5}}),
("<datetime> - <datetime> (interval)",
Classifier{okData =
ClassData{prior = -0.9694005571881036, unseen = -4.189654742026425,
@ -2348,8 +2374,8 @@ classifiers
ClassData{prior = -infinity, unseen = -0.6931471805599453,
likelihoods = HashMap.fromList [], n = 0},
koData =
ClassData{prior = 0.0, unseen = -1.3862943611198906,
likelihoods = HashMap.fromList [("", 0.0)], n = 2}}),
ClassData{prior = 0.0, unseen = -1.791759469228055,
likelihoods = HashMap.fromList [("", 0.0)], n = 4}}),
("Orthodoxer Ostersonntag",
Classifier{okData =
ClassData{prior = 0.0, unseen = -1.0986122886681098,

View File

@ -209,6 +209,14 @@ allExamples = concat
, "mittwoch nächste woche"
, "mittwoch nach dem nächsten"
]
, examples (datetime (2013, 2, 27, 0, 0, 0) Day)
[ "mittwoch in 2 wochen"
, "mittwoch in zwei wochen"
]
, examples (datetime (2013, 1, 30, 0, 0, 0) Day)
[ "mittwoch vor 2 wochen"
, "mittwoch vor zwei wochen"
]
, examples (datetime (2013, 2, 22, 0, 0, 0) Day)
[ "freitag nach dem nächsten"
]

View File

@ -1112,6 +1112,22 @@ ruleIntersect = Rule
_ -> Nothing
}
ruleDayOfWeekIntersectDuration :: Rule
ruleDayOfWeekIntersectDuration = Rule
{ name = "<day-of-week> in <duration>"
, pattern =
[ Predicate isADayOfWeek
, regex "(in|vor)"
, dimension Duration
]
, prod = \case
(Token Time td:Token RegexMatch (GroupMatch (match:_)):Token Duration dd:_) ->
case Text.toLower match of
"vor" -> Token Time <$> intersect td (durationIntervalAgo dd)
_ -> Token Time <$> intersect td (inDurationInterval dd)
_ -> Nothing
}
ruleAboutTimeofday :: Rule
ruleAboutTimeofday = Rule
{ name = "about <time-of-day>"
@ -1843,6 +1859,7 @@ rules =
, ruleIntersect
, ruleIntersectBy
, ruleIntersectByOfFromS
, ruleDayOfWeekIntersectDuration
, ruleLastCycle
, ruleLastCycleOfTime
, ruleLastDayofweekOfTime