Ca time improvements (#639)

Summary:
Some time recognition improvements for Catalan:
- morning should be a time range recognised until noon
- "dema" can also be used for tomorrow (besides "demà")
- "se" alone should not be understood as September

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

Reviewed By: stroxler

Differential Revision: D30312076

Pulled By: chessai

fbshipit-source-id: 1a42bbd7eecc4f5690145ee9cadb8eccae8edd08
This commit is contained in:
Filipe Pereira 2021-08-16 10:43:17 -07:00 committed by Facebook GitHub Bot
parent 32eb5db8c2
commit d8888e2ff8
3 changed files with 193 additions and 166 deletions

View File

@ -23,18 +23,18 @@ classifiers
= HashMap.fromList
[("midnight",
Classifier{okData =
ClassData{prior = 0.0, unseen = -1.3862943611198906,
likelihoods = HashMap.fromList [("", 0.0)], n = 2},
ClassData{prior = 0.0, unseen = -1.0986122886681098,
likelihoods = HashMap.fromList [("", 0.0)], n = 1},
koData =
ClassData{prior = -infinity, unseen = -0.6931471805599453,
likelihoods = HashMap.fromList [], n = 0}}),
("integer (numeric)",
Classifier{okData =
ClassData{prior = -0.6632942174102642, unseen = -3.970291913552122,
likelihoods = HashMap.fromList [("", 0.0)], n = 51},
ClassData{prior = -0.6644370746775139, unseen = -4.007333185232471,
likelihoods = HashMap.fromList [("", 0.0)], n = 53},
koData =
ClassData{prior = -0.723918839226699, unseen = -3.912023005428146,
likelihoods = HashMap.fromList [("", 0.0)], n = 48}}),
ClassData{prior = -0.7227059828014897, unseen = -3.951243718581427,
likelihoods = HashMap.fromList [("", 0.0)], n = 50}}),
("the day before yesterday",
Classifier{okData =
ClassData{prior = 0.0, unseen = -1.0986122886681098,
@ -79,62 +79,64 @@ classifiers
likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),
("dd[/-]mm",
Classifier{okData =
ClassData{prior = 0.0, unseen = -2.1972245773362196,
likelihoods = HashMap.fromList [("", 0.0)], n = 7},
ClassData{prior = 0.0, unseen = -2.3025850929940455,
likelihoods = HashMap.fromList [("", 0.0)], n = 8},
koData =
ClassData{prior = -infinity, unseen = -0.6931471805599453,
likelihoods = HashMap.fromList [], n = 0}}),
("intersect by `de`",
Classifier{okData =
ClassData{prior = -0.18721154208814647, unseen = -4.61512051684126,
ClassData{prior = -0.17768117723745236,
unseen = -4.663439094112067,
likelihoods =
HashMap.fromList
[("Dillunseste|en un <cycle>", -3.912023005428146),
[("Dillunseste|en un <cycle>", -3.960813169597578),
("<day-of-month> de <named-month>year (value by adding three composing numbers together)",
-3.912023005428146),
-3.960813169597578),
("el <day-of-month> (non ordinal)Setembre",
-3.5553480614894135),
("el <day-of-month> (non ordinal)intersect by `de`",
-3.912023005428146),
("daymonth", -1.6607312068216509),
("monthyear", -3.912023005428146),
("el <day-of-month> (non ordinal)Abril", -3.912023005428146),
("Dimecresel <cycle> (proximo|que viene)", -3.912023005428146),
("Maigyear", -3.912023005428146),
("Dimecreseste|en un <cycle>", -3.912023005428146),
("dayyear", -2.5257286443082556),
("quarteryear", -3.912023005428146),
("dd-dd <month>(interval)year", -3.506557897319982),
("el <time>el <cycle> (proximo|que viene)", -3.912023005428146),
("el <day-of-month> (non ordinal)Maig", -3.2188758248682006),
("el <time>year", -3.912023005428146),
("el <day-of-month> de <named-month>year", -3.912023005428146),
("el <time>Mar\231", -3.912023005428146),
("el <day-of-month> (non ordinal)Febrer", -3.912023005428146),
("el <time>este|en un <cycle>", -3.506557897319982),
("el <day-of-month> (non ordinal)Juliol", -3.912023005428146),
("<ordinal> quarteryear", -3.912023005428146),
("el <day-of-month> (non ordinal)Mar\231", -2.995732273553991),
("<day-of-month> de <named-month>year", -3.912023005428146),
("el <day-of-month> (non ordinal)Agost", -3.912023005428146),
("Dimartseste|en un <cycle>", -3.912023005428146),
("dayweek", -2.5257286443082556),
("intersect by `de`year", -3.912023005428146),
("el <day-of-month> (non ordinal)Octubre", -3.912023005428146),
("day of month (1st)Mar\231", -3.2188758248682006),
-3.960813169597578),
("daymonth", -1.6094379124341003),
("monthyear", -3.960813169597578),
("el <day-of-month> (non ordinal)Abril", -3.960813169597578),
("Dimecresel <cycle> (proximo|que viene)", -3.960813169597578),
("Maigyear", -3.960813169597578),
("Dimecreseste|en un <cycle>", -3.960813169597578),
("dayyear", -2.5745188084776873),
("quarteryear", -3.960813169597578),
("dd-dd <month>(interval)year", -3.5553480614894135),
("el <time>el <cycle> (proximo|que viene)", -3.960813169597578),
("el <day-of-month> (non ordinal)Maig", -3.2676659890376327),
("el <time>year", -3.960813169597578),
("el <day-of-month> de <named-month>year", -3.960813169597578),
("el <time>Mar\231", -3.960813169597578),
("el <day-of-month> (non ordinal)Febrer", -3.960813169597578),
("el <time>este|en un <cycle>", -3.5553480614894135),
("el <day-of-month> (non ordinal)Juliol", -3.960813169597578),
("<ordinal> quarteryear", -3.960813169597578),
("el <day-of-month> (non ordinal)Mar\231", -3.044522437723423),
("<day-of-month> de <named-month>year", -3.960813169597578),
("el <day-of-month> (non ordinal)Agost", -3.960813169597578),
("Dimartseste|en un <cycle>", -3.960813169597578),
("dayweek", -2.5745188084776873),
("intersect by `de`year", -3.960813169597578),
("el <day-of-month> (non ordinal)Octubre", -3.960813169597578),
("day of month (1st)Mar\231", -3.2676659890376327),
("el <day-of-month> (non ordinal)intersect",
-3.912023005428146)],
n = 34},
-3.960813169597578)],
n = 36},
koData =
ClassData{prior = -1.7676619176489945,
unseen = -3.8501476017100584,
ClassData{prior = -1.8152899666382492, unseen = -3.871201010907891,
likelihoods =
HashMap.fromList
[("monthyear", -2.2192034840549946),
("Maigyear", -3.1354942159291497),
("dayyear", -2.4423470353692043),
("Juliolyear", -2.7300291078209855),
[("monthyear", -2.2407096892759584),
("Maigyear", -3.1570004211501135),
("dayyear", -2.463853240590168),
("Juliolyear", -2.751535313041949),
("Maigyear (value by adding three composing numbers together)",
-3.1354942159291497),
("<day-of-month> de <named-month>year", -2.4423470353692043)],
-3.1570004211501135),
("<day-of-month> de <named-month>year", -2.463853240590168)],
n = 7}}),
("pasados n <cycle>",
Classifier{okData =
@ -196,29 +198,30 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("<day-of-month> de <named-month>",
Classifier{okData =
ClassData{prior = -8.701137698962981e-2,
unseen = -4.04305126783455,
ClassData{prior = -8.004270767353637e-2,
unseen = -4.127134385045092,
likelihoods =
HashMap.fromList
[("number (0..15)Maig", -2.639057329615259),
("integer (numeric)Gener", -3.332204510175204),
("integer (numeric)Mar\231", -2.2335922215070942),
("integer (numeric)Juliol", -3.332204510175204),
("integer (numeric)Febrer", -2.4159137783010487),
("integer (numeric)Abril", -2.9267394020670396),
("integer (numeric)Maig", -3.332204510175204),
("integer (numeric)Octubre", -3.332204510175204),
("number (0..15)Mar\231", -2.9267394020670396),
("integer (numeric)Agost", -3.332204510175204),
("month", -0.8898574748059995),
("integer (numeric)Desembre", -3.332204510175204)],
n = 22},
[("number (0..15)Maig", -2.7245795030534206),
("integer (numeric)Gener", -3.417726683613366),
("integer (numeric)Mar\231", -2.3191143949452564),
("integer (numeric)Juliol", -3.417726683613366),
("integer (numeric)Febrer", -2.501435951739211),
("integer (numeric)Abril", -3.012261575505202),
("integer (numeric)Maig", -3.417726683613366),
("integer (numeric)Octubre", -3.417726683613366),
("number (0..15)Mar\231", -3.012261575505202),
("integer (numeric)Agost", -3.417726683613366),
("month", -0.8919980393051105),
("integer (numeric)Setembre", -3.012261575505202),
("integer (numeric)Desembre", -3.417726683613366)],
n = 24},
koData =
ClassData{prior = -2.4849066497880004, unseen = -2.833213344056216,
ClassData{prior = -2.5649493574615367, unseen = -2.890371757896165,
likelihoods =
HashMap.fromList
[("integer (numeric)Juliol", -1.6739764335716716),
("month", -1.6739764335716716)],
[("integer (numeric)Juliol", -1.7346010553881064),
("month", -1.7346010553881064)],
n = 2}}),
("<time-of-day> <part-of-day>",
Classifier{okData =
@ -260,39 +263,39 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("intersect",
Classifier{okData =
ClassData{prior = -0.2876820724517809, unseen = -4.189654742026425,
ClassData{prior = -0.25593337413720063,
unseen = -4.276666119016055,
likelihoods =
HashMap.fromList
[("<day-of-month> de <named-month>in the <part-of-day>",
-3.481240089335692),
("dayhour", -1.6894806201076367),
("monthyear", -3.481240089335692),
("tomorrowin the <part-of-day>", -2.7880929087757464),
("Maigdel <year>", -3.481240089335692),
-3.56953269648137),
("dayhour", -1.5546296759391054),
("monthyear", -3.56953269648137),
("tomorrowin the <part-of-day>", -2.316769727986002),
("Maigdel <year>", -3.56953269648137),
("el <day-of-month> de <named-month>in the <part-of-day>",
-3.481240089335692),
("Dillunsin the <part-of-day>", -3.481240089335692),
("dayyear", -1.9771626925594177),
("quarteryear", -3.481240089335692),
("intersect by `de`in the <part-of-day>", -3.481240089335692),
-3.56953269648137),
("Dillunsin the <part-of-day>", -3.56953269648137),
("dayyear", -2.065455299705096),
("quarteryear", -3.56953269648137),
("intersect by `de`in the <part-of-day>", -3.56953269648137),
("Dia Internacional de les Cooperativesel <time>",
-3.481240089335692),
("intersect by `de`del <year>", -3.481240089335692),
-3.56953269648137),
("intersect by `de`del <year>", -3.56953269648137),
("<day-of-month> de <named-month>del <year>",
-3.481240089335692),
-3.56953269648137),
("Dia Internacional de les Cooperativesdel <year>",
-3.481240089335692),
("<ordinal> quarterdel <year>", -3.481240089335692),
("el <time>in the <part-of-day>", -3.481240089335692),
-3.56953269648137),
("<ordinal> quarterdel <year>", -3.56953269648137),
("el <time>in the <part-of-day>", -3.56953269648137),
("el <day-of-month> de <named-month>del <year>",
-3.481240089335692),
("el <time>del <year>", -3.481240089335692),
("yesterdayin the <part-of-day>", -2.7880929087757464),
("dd-dd <month>(interval)del <year>", -3.0757749812275272)],
n = 21},
-3.56953269648137),
("el <time>del <year>", -3.56953269648137),
("yesterdayin the <part-of-day>", -2.8763855159214247),
("dd-dd <month>(interval)del <year>", -3.164067588373206)],
n = 24},
koData =
ClassData{prior = -1.3862943611198906,
unseen = -3.6375861597263857,
ClassData{prior = -1.488077055429833, unseen = -3.6375861597263857,
likelihoods =
HashMap.fromList
[("monthyear", -2.2246235515243336),
@ -367,8 +370,8 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("nit",
Classifier{okData =
ClassData{prior = 0.0, unseen = -1.6094379124341003,
likelihoods = HashMap.fromList [("", 0.0)], n = 3},
ClassData{prior = 0.0, unseen = -1.791759469228055,
likelihoods = HashMap.fromList [("", 0.0)], n = 4},
koData =
ClassData{prior = -infinity, unseen = -0.6931471805599453,
likelihoods = HashMap.fromList [], n = 0}}),
@ -393,22 +396,23 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("el <day-of-month> de <named-month>",
Classifier{okData =
ClassData{prior = 0.0, unseen = -3.5553480614894135,
ClassData{prior = 0.0, unseen = -3.6888794541139363,
likelihoods =
HashMap.fromList
[("number (0..15)Maig", -2.4277482359480516),
("integer (numeric)Mar\231", -2.1400661634962708),
("integer (numeric)Juliol", -2.833213344056216),
("integer (numeric)Febrer", -2.833213344056216),
("integer (numeric)Abril", -2.833213344056216),
("integer (numeric)Maig", -2.833213344056216),
("integer (numeric)Octubre", -2.833213344056216),
("number (0..15)Mar\231", -2.833213344056216),
("integer (numeric)Agost", -2.833213344056216),
("month", -0.9614111671546247)],
n = 12},
[("number (0..15)Maig", -2.5649493574615367),
("integer (numeric)Mar\231", -2.277267285009756),
("integer (numeric)Juliol", -2.9704144655697013),
("integer (numeric)Febrer", -2.9704144655697013),
("integer (numeric)Abril", -2.9704144655697013),
("integer (numeric)Maig", -2.9704144655697013),
("integer (numeric)Octubre", -2.9704144655697013),
("number (0..15)Mar\231", -2.9704144655697013),
("integer (numeric)Agost", -2.9704144655697013),
("month", -0.9555114450274363),
("integer (numeric)Setembre", -2.5649493574615367)],
n = 14},
koData =
ClassData{prior = -infinity, unseen = -2.3978952727983707,
ClassData{prior = -infinity, unseen = -2.4849066497880004,
likelihoods = HashMap.fromList [], n = 0}}),
("dia <day-of-month> (non ordinal)",
Classifier{okData =
@ -426,23 +430,23 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("el <time>",
Classifier{okData =
ClassData{prior = 0.0, unseen = -4.454347296253507,
ClassData{prior = 0.0, unseen = -4.5217885770490405,
likelihoods =
HashMap.fromList
[("<named-month|named-day> past", -3.3440389678222067),
("dd[/-]mm", -2.6508917872622613),
("intersect by `de`", -2.6508917872622613),
("Dimecres", -3.3440389678222067),
("<day-of-month> de <named-month>", -2.044755983691946),
("intersect", -3.3440389678222067),
("Dilluns", -3.7495040759303713), ("day", -0.9769153536905899),
("Diumenge", -3.7495040759303713),
("Dimarts", -3.3440389678222067), ("year", -3.3440389678222067),
("day of month (1st)", -3.7495040759303713),
("<named-month|named-day> next", -3.7495040759303713),
("el proximo <cycle> ", -3.3440389678222067),
("hour", -3.7495040759303713), ("month", -3.7495040759303713)],
n = 35},
[("<named-month|named-day> past", -3.41224721784874),
("dd[/-]mm", -2.5649493574615367),
("intersect by `de`", -2.7191000372887952),
("Dimecres", -3.41224721784874),
("<day-of-month> de <named-month>", -1.9459101490553135),
("intersect", -3.41224721784874),
("Dilluns", -3.817712325956905), ("day", -0.9555114450274363),
("Diumenge", -3.817712325956905),
("Dimarts", -3.41224721784874), ("year", -3.41224721784874),
("day of month (1st)", -3.817712325956905),
("<named-month|named-day> next", -3.817712325956905),
("el proximo <cycle> ", -3.41224721784874),
("hour", -3.817712325956905), ("month", -3.817712325956905)],
n = 38},
koData =
ClassData{prior = -infinity, unseen = -2.833213344056216,
likelihoods = HashMap.fromList [], n = 0}}),
@ -489,13 +493,13 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("number (0..15)",
Classifier{okData =
ClassData{prior = -0.11778303565638351,
ClassData{prior = -0.18924199963852842,
unseen = -3.258096538021482,
likelihoods = HashMap.fromList [("", 0.0)], n = 24},
koData =
ClassData{prior = -2.1972245773362196,
unseen = -1.6094379124341003,
likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),
ClassData{prior = -1.7578579175523736,
unseen = -1.9459101490553135,
likelihoods = HashMap.fromList [("", 0.0)], n = 5}}),
("este|en un <cycle>",
Classifier{okData =
ClassData{prior = 0.0, unseen = -2.70805020110221,
@ -533,12 +537,13 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("tomorrow",
Classifier{okData =
ClassData{prior = -0.2231435513142097, unseen = -1.791759469228055,
likelihoods = HashMap.fromList [("", 0.0)], n = 4},
ClassData{prior = -0.2231435513142097,
unseen = -2.3025850929940455,
likelihoods = HashMap.fromList [("", 0.0)], n = 8},
koData =
ClassData{prior = -1.6094379124341003,
unseen = -1.0986122886681098,
likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),
unseen = -1.3862943611198906,
likelihoods = HashMap.fromList [("", 0.0)], n = 2}}),
("Mar\231",
Classifier{okData =
ClassData{prior = 0.0, unseen = -2.3025850929940455,
@ -593,8 +598,8 @@ classifiers
ClassData{prior = -infinity, unseen = -0.6931471805599453,
likelihoods = HashMap.fromList [], n = 0},
koData =
ClassData{prior = 0.0, unseen = -2.3025850929940455,
likelihoods = HashMap.fromList [("", 0.0)], n = 8}}),
ClassData{prior = 0.0, unseen = -2.3978952727983707,
likelihoods = HashMap.fromList [("", 0.0)], n = 9}}),
("Diumenge",
Classifier{okData =
ClassData{prior = 0.0, unseen = -1.791759469228055,
@ -604,8 +609,8 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("afternoon",
Classifier{okData =
ClassData{prior = 0.0, unseen = -1.6094379124341003,
likelihoods = HashMap.fromList [("", 0.0)], n = 3},
ClassData{prior = 0.0, unseen = -1.791759469228055,
likelihoods = HashMap.fromList [("", 0.0)], n = 4},
koData =
ClassData{prior = -infinity, unseen = -0.6931471805599453,
likelihoods = HashMap.fromList [], n = 0}}),
@ -643,6 +648,13 @@ classifiers
likelihoods =
HashMap.fromList [("integer (numeric)", -0.40546510810816444)],
n = 1}}),
("Setembre",
Classifier{okData =
ClassData{prior = 0.0, unseen = -1.791759469228055,
likelihoods = HashMap.fromList [("", 0.0)], n = 4},
koData =
ClassData{prior = -infinity, unseen = -0.6931471805599453,
likelihoods = HashMap.fromList [], n = 0}}),
("year",
Classifier{okData =
ClassData{prior = -0.8754687373538999,
@ -863,8 +875,8 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("the day after tomorrow",
Classifier{okData =
ClassData{prior = 0.0, unseen = -1.0986122886681098,
likelihoods = HashMap.fromList [("", 0.0)], n = 1},
ClassData{prior = 0.0, unseen = -1.3862943611198906,
likelihoods = HashMap.fromList [("", 0.0)], n = 2},
koData =
ClassData{prior = -infinity, unseen = -0.6931471805599453,
likelihoods = HashMap.fromList [], n = 0}}),
@ -896,8 +908,8 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("noon",
Classifier{okData =
ClassData{prior = 0.0, unseen = -1.3862943611198906,
likelihoods = HashMap.fromList [("", 0.0)], n = 2},
ClassData{prior = 0.0, unseen = -1.0986122886681098,
likelihoods = HashMap.fromList [("", 0.0)], n = 1},
koData =
ClassData{prior = -infinity, unseen = -0.6931471805599453,
likelihoods = HashMap.fromList [], n = 0}}),
@ -910,8 +922,8 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("evening",
Classifier{okData =
ClassData{prior = 0.0, unseen = -1.791759469228055,
likelihoods = HashMap.fromList [("", 0.0)], n = 4},
ClassData{prior = 0.0, unseen = -1.9459101490553135,
likelihoods = HashMap.fromList [("", 0.0)], n = 5},
koData =
ClassData{prior = -infinity, unseen = -0.6931471805599453,
likelihoods = HashMap.fromList [], n = 0}}),
@ -984,18 +996,18 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("el <day-of-month> (non ordinal)",
Classifier{okData =
ClassData{prior = -0.16251892949777494,
unseen = -2.995732273553991,
ClassData{prior = -0.19105523676270922,
unseen = -3.0910424533583156,
likelihoods =
HashMap.fromList
[("integer (numeric)", -0.2363887780642304),
("number (0..15)", -1.55814461804655)],
n = 17},
[("integer (numeric)", -0.2113090936672069),
("number (0..15)", -1.6582280766035324)],
n = 19},
koData =
ClassData{prior = -1.8971199848858813, unseen = -1.791759469228055,
ClassData{prior = -1.749199854809259, unseen = -1.9459101490553135,
likelihoods =
HashMap.fromList [("integer (numeric)", -0.2231435513142097)],
n = 3}}),
HashMap.fromList [("integer (numeric)", -0.1823215567939546)],
n = 4}}),
("next week (alt)",
Classifier{okData =
ClassData{prior = -0.2231435513142097,
@ -1049,13 +1061,14 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("in the <part-of-day>",
Classifier{okData =
ClassData{prior = 0.0, unseen = -3.1780538303479458,
ClassData{prior = 0.0, unseen = -3.4011973816621555,
likelihoods =
HashMap.fromList
[("nit", -2.03688192726104), ("afternoon", -2.03688192726104),
("hour", -0.832909122935104), ("evening", -1.749199854809259),
("morning", -2.03688192726104)],
n = 9},
[("nit", -1.9810014688665833),
("afternoon", -1.9810014688665833),
("hour", -0.8023464725249373), ("evening", -1.7578579175523736),
("morning", -2.268683541318364)],
n = 12},
koData =
ClassData{prior = -infinity, unseen = -1.791759469228055,
likelihoods = HashMap.fromList [], n = 0}}),
@ -1068,8 +1081,8 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("week-end",
Classifier{okData =
ClassData{prior = 0.0, unseen = -1.3862943611198906,
likelihoods = HashMap.fromList [("", 0.0)], n = 2},
ClassData{prior = 0.0, unseen = -1.0986122886681098,
likelihoods = HashMap.fromList [("", 0.0)], n = 1},
koData =
ClassData{prior = -infinity, unseen = -0.6931471805599453,
likelihoods = HashMap.fromList [], n = 0}}),
@ -1119,15 +1132,15 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("ce <time>",
Classifier{okData =
ClassData{prior = 0.0, unseen = -2.995732273553991,
ClassData{prior = 0.0, unseen = -2.890371757896165,
likelihoods =
HashMap.fromList
[("Dilluns", -2.2512917986064953),
("estiu", -2.2512917986064953), ("hivern", -2.2512917986064953),
("day", -1.55814461804655), ("hour", -1.55814461804655),
("evening", -2.2512917986064953),
("week-end", -1.845826690498331)],
n = 6},
[("Dilluns", -2.1400661634962708),
("estiu", -2.1400661634962708), ("hivern", -2.1400661634962708),
("day", -1.4469189829363254), ("hour", -1.7346010553881064),
("evening", -2.1400661634962708),
("week-end", -2.1400661634962708)],
n = 5},
koData =
ClassData{prior = -infinity, unseen = -2.0794415416798357,
likelihoods = HashMap.fromList [], n = 0}})]

View File

@ -50,9 +50,11 @@ allExamples = concat
--}
, examples (datetime (2013, 2, 13, 0, 0, 0) Day)
[ "demà"
, "dema"
]
, examples (datetime (2013, 2, 14, 0, 0, 0) Day)
[ "demà passat"
, "dema passat"
]
, examples (datetime (2013, 2, 18, 0, 0, 0) Day)
[ "dilluns"
@ -121,6 +123,15 @@ allExamples = concat
[ "el 24 d'octubre"
, "el 24/10"
]
, examples (datetime (2013, 09, 24, 0, 0, 0) Day)
[ "el 24 de setembre"
, "el 24 de set"
, "el 24/09"
]
, examples (datetime (2013, 09, 0, 0, 0, 0) Month)
[ "setembre"
, "set"
]
, examples (datetime (2013, 4, 5, 0, 0, 0) Day)
[ "el 5 d'abril"
, "5 d'abril"
@ -297,6 +308,7 @@ allExamples = concat
]
, examples (datetimeInterval ((2013, 2, 13, 14, 0, 0), (2013, 2, 13, 19, 0, 0)) Hour)
[ "demà a la tarda"
, "dema a la tarda"
]
, examples (datetimeInterval ((2013, 2, 11, 14, 0, 0), (2013, 2, 11, 19, 0, 0)) Hour)
[ "ahir per la tarda"
@ -306,6 +318,7 @@ allExamples = concat
]
, examples (datetimeInterval ((2013, 2, 13, 19, 0, 0), (2013, 2, 13, 22, 0, 0)) Hour)
[ "demà al vespre"
, "dema al vespre"
]
, examples (datetimeInterval ((2013, 2, 11, 19, 0, 0), (2013, 2, 11, 22, 0, 0)) Hour)
[ "ahir al vespre"
@ -315,6 +328,7 @@ allExamples = concat
]
, examples (datetimeInterval ((2013, 2, 13, 0, 0, 0), (2013, 2, 13, 1, 0, 0)) Hour)
[ "demà a la nit"
, "dema a la nit"
]
, examples (datetimeInterval ((2013, 2, 11, 0, 0, 0), (2013, 2, 11, 1, 0, 0)) Hour)
[ "ahir per la nit"
@ -322,10 +336,10 @@ allExamples = concat
, examples (datetimeInterval ((2013, 2, 15, 18, 0, 0), (2013, 2, 18, 0, 0, 0)) Hour)
[ "aquest cap de setmana"
]
, examples (datetimeInterval ((2013, 2, 18, 6, 0, 0), (2013, 2, 18, 11, 0, 0)) Hour)
, examples (datetimeInterval ((2013, 2, 18, 6, 0, 0), (2013, 2, 18, 12, 0, 0)) Hour)
[ "dilluns pel matí"
]
, examples (datetimeInterval ((2013, 2, 15, 6, 0, 0), (2013, 2, 15, 11, 0, 0)) Hour)
, examples (datetimeInterval ((2013, 2, 15, 6, 0, 0), (2013, 2, 15, 12, 0, 0)) Hour)
[ "el 15 de febrer pel matí"
]
, examples (datetimeInterval ((2013, 2, 12, 4, 29, 58), (2013, 2, 12, 4, 30, 0)) Second)

View File

@ -33,7 +33,7 @@ ruleTheDayAfterTomorrow :: Rule
ruleTheDayAfterTomorrow = Rule
{ name = "the day after tomorrow"
, pattern =
[ regex "demà passat|l'endemà|passat demà"
[ regex "dem(a|à) passat|l'endem(a|à)|passat dem(a|à)"
]
, prod = \_ -> tt $ cycleNth TG.Day 2
}
@ -85,7 +85,7 @@ ruleMonths = mkRuleMonths
, ( "Juny" , "juny?\\.?")
, ( "Juliol" , "juliol|jul\\.?")
, ( "Agost" , "agost|ago\\.?")
, ( "Setembre" , "setembre|set?\\.?")
, ( "Setembre" , "setembre|set\\.?")
, ( "Octubre" , "octubre|oct\\.?")
, ( "Novembre" , "novembre|nov\\.?")
, ( "Desembre" , "desembre|des\\.?")
@ -1065,7 +1065,7 @@ ruleMorning = Rule
]
, prod = \_ ->
let from = hour False 6
to = hour False 11
to = hour False 12
in Token Time . mkLatent . partOfDay <$>
interval TTime.Open from to
}
@ -1353,7 +1353,7 @@ ruleTomorrow :: Rule
ruleTomorrow = Rule
{ name = "tomorrow"
, pattern =
[ regex "demà"
[ regex "dem(a|à)"
]
, prod = \_ -> tt $ cycleNth TG.Day 1
}