Time/VI: update rule Sunday (#611)

Summary:
In Vietnam, sunday is "chủ nhật" or "Chúa nhật (Catholic)".

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

Reviewed By: haoxuany

Differential Revision: D28399277

Pulled By: chessai

fbshipit-source-id: 26aa7c76cf1f8b8c2ba32e049f7f470a140e3d92
This commit is contained in:
tuantvk 2021-06-04 12:15:59 -07:00 committed by Facebook GitHub Bot
parent 99e1dce9c4
commit 25b39f4a8b
3 changed files with 103 additions and 100 deletions

View File

@ -41,10 +41,10 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}), likelihoods = HashMap.fromList [], n = 0}}),
("integer (numeric)", ("integer (numeric)",
Classifier{okData = Classifier{okData =
ClassData{prior = -0.5108256237659907, unseen = -4.61512051684126, ClassData{prior = -0.5028732955754956, unseen = -4.634728988229636,
likelihoods = HashMap.fromList [("", 0.0)], n = 99}, likelihoods = HashMap.fromList [("", 0.0)], n = 101},
koData = koData =
ClassData{prior = -0.916290731874155, unseen = -4.219507705176107, ClassData{prior = -0.9283390703903296, unseen = -4.219507705176107,
likelihoods = HashMap.fromList [("", 0.0)], n = 66}}), likelihoods = HashMap.fromList [("", 0.0)], n = 66}}),
("exactly <time-of-day>", ("exactly <time-of-day>",
Classifier{okData = Classifier{okData =
@ -93,21 +93,21 @@ classifiers
likelihoods = HashMap.fromList [("", 0.0)], n = 5}}), likelihoods = HashMap.fromList [("", 0.0)], n = 5}}),
("<part-of-day> <time>", ("<part-of-day> <time>",
Classifier{okData = Classifier{okData =
ClassData{prior = -0.40546510810816444, ClassData{prior = -0.3746934494414107,
unseen = -3.4657359027997265, unseen = -3.5263605246161616,
likelihoods = likelihoods =
HashMap.fromList HashMap.fromList
[("hourday", -1.0360919316867756), [("hourday", -1.0116009116784799),
("noonh\244m nay", -2.740840023925201), ("noonh\244m nay", -2.803360380906535),
("lunchng\224y mai", -2.3353749158170367), ("lunchng\224y mai", -2.3978952727983707),
("noonng\224y h\244m qua", -2.3353749158170367), ("noonng\224y h\244m qua", -2.3978952727983707),
("morningSunday", -2.740840023925201), ("morningSunday", -2.3978952727983707),
("noonng\224y mai", -2.3353749158170367), ("noonng\224y mai", -2.3978952727983707),
("afternoonng\224y dd/mm", -2.740840023925201), ("afternoonng\224y dd/mm", -2.803360380906535),
("afternoonng\224y mai", -2.740840023925201)], ("afternoonng\224y mai", -2.803360380906535)],
n = 10}, n = 11},
koData = koData =
ClassData{prior = -1.0986122886681098, ClassData{prior = -1.1631508098056809,
unseen = -3.0910424533583156, unseen = -3.0910424533583156,
likelihoods = likelihoods =
HashMap.fromList HashMap.fromList
@ -153,12 +153,11 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}), likelihoods = HashMap.fromList [], n = 0}}),
("month (grain)", ("month (grain)",
Classifier{okData = Classifier{okData =
ClassData{prior = -1.4271163556401458, ClassData{prior = -1.466337068793427, 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.2744368457017603, unseen = -3.044522437723423, ClassData{prior = -0.262364264467491, unseen = -3.0910424533583156,
likelihoods = HashMap.fromList [("", 0.0)], n = 19}}), likelihoods = HashMap.fromList [("", 0.0)], n = 20}}),
("Wednesday", ("Wednesday",
Classifier{okData = Classifier{okData =
ClassData{prior = 0.0, unseen = -1.3862943611198906, ClassData{prior = 0.0, unseen = -1.3862943611198906,
@ -190,65 +189,66 @@ classifiers
likelihoods = HashMap.fromList [("", 0.0)], n = 20}}), likelihoods = HashMap.fromList [("", 0.0)], n = 20}}),
("intersect", ("intersect",
Classifier{okData = Classifier{okData =
ClassData{prior = -0.24921579162398486, ClassData{prior = -0.24512245803298496,
unseen = -5.017279836814924, unseen = -5.030437921392435,
likelihoods = likelihoods =
HashMap.fromList HashMap.fromList
[("<time-of-day> s\225ng|chi\7873u|t\7889ing\224y dd/mm", [("<time-of-day> s\225ng|chi\7873u|t\7889ing\224y dd/mm",
-3.624340932976365), -3.6375861597263857),
("hourday", -3.624340932976365), ("dayhour", -4.31748811353631), ("hourday", -3.6375861597263857),
("dayhour", -4.330733340286331),
("h\244m nay<time-of-day> s\225ng|chi\7873u|t\7889i", ("h\244m nay<time-of-day> s\225ng|chi\7873u|t\7889i",
-4.31748811353631), -4.330733340286331),
("monthyear", -3.4011973816621555), ("monthyear", -3.414442608412176),
("Wednesdaynext <cycle>", -4.31748811353631), ("Wednesdaynext <cycle>", -4.330733340286331),
("Tuesday<day-of-month> (numeric with day symbol) <named-month>", ("Tuesday<day-of-month> (numeric with day symbol) <named-month>",
-4.31748811353631), -4.330733340286331),
("time-of-day gi\7901<part-of-day> <time>", -4.31748811353631), ("time-of-day gi\7901<part-of-day> <time>", -4.330733340286331),
("Sunday<day-of-month> (numeric with day symbol) <named-month>", ("Sunday<day-of-month> (numeric with day symbol) <named-month>",
-3.912023005428146), -3.6375861597263857),
("time-of-day gi\7901<time> n\224y", -4.31748811353631), ("time-of-day gi\7901<time> n\224y", -4.330733340286331),
("month (numeric with month symbol)year (numeric with year symbol)", ("month (numeric with month symbol)year (numeric with year symbol)",
-3.624340932976365), -3.6375861597263857),
("dayday", -2.6127400212978853), ("dayday", -2.538973871058276),
("hourhour", -3.4011973816621555), ("hourhour", -3.414442608412176),
("intersectyear (numeric with year symbol)", ("intersectyear (numeric with year symbol)",
-3.624340932976365), -3.6375861597263857),
("dayyear", -2.445685936634719), ("dayyear", -2.4589311633847397),
("<ordinal> <cycle> of <time>year (numeric with year symbol)", ("<ordinal> <cycle> of <time>year (numeric with year symbol)",
-4.31748811353631), -4.330733340286331),
("minutehour", -3.912023005428146), ("minutehour", -3.925268232178167),
("<time-of-day> s\225ng|chi\7873u|t\7889iintersect", ("<time-of-day> s\225ng|chi\7873u|t\7889iintersect",
-3.912023005428146), -3.925268232178167),
("Thursdaynext <cycle>", -3.912023005428146), ("Thursdaynext <cycle>", -3.925268232178167),
("Octoberyear (numeric with year symbol)", -4.31748811353631), ("Octoberyear (numeric with year symbol)", -4.330733340286331),
("time-of-day gi\7901<part-of-day> (h\244m )?nay", ("time-of-day gi\7901<part-of-day> (h\244m )?nay",
-4.31748811353631), -4.330733340286331),
("<day-of-month> (numeric with day symbol) <named-month>year (numeric with year symbol)", ("<day-of-month> (numeric with day symbol) <named-month>year (numeric with year symbol)",
-3.2188758248682006), -3.2321210516182215),
("<time-of-day> s\225ng|chi\7873u|t\7889i<day-of-month> (numeric with day symbol) <named-month>", ("<time-of-day> s\225ng|chi\7873u|t\7889i<day-of-month> (numeric with day symbol) <named-month>",
-3.4011973816621555), -3.414442608412176),
("time-of-day gi\7901tonight", -4.31748811353631), ("time-of-day gi\7901tonight", -4.330733340286331),
("minuteday", -2.8134107167600364), ("minuteday", -2.826655943510057),
("hh:mm<part-of-day> <time>", -4.31748811353631), ("hh:mm<part-of-day> <time>", -4.330733340286331),
("<day-of-month> <named-month>year (numeric with year symbol)", ("<day-of-month> <named-month>year (numeric with year symbol)",
-3.2188758248682006), -3.2321210516182215),
("Fridaythis <cycle>", -3.912023005428146), ("Fridaythis <cycle>", -3.925268232178167),
("Thursdaythis <cycle>", -4.31748811353631), ("Thursdaythis <cycle>", -4.330733340286331),
("at hh:mm<part-of-day> <time>", -4.31748811353631), ("at hh:mm<part-of-day> <time>", -4.330733340286331),
("dayweek", -3.0647251450409425), ("dayweek", -3.077970371790963),
("weekyear", -4.31748811353631), ("weekyear", -4.330733340286331),
("<time-of-day> s\225ng|chi\7873u|t\7889ing\224y dd/mm/yyyy", ("<time-of-day> s\225ng|chi\7873u|t\7889ing\224y dd/mm/yyyy",
-4.31748811353631), -4.330733340286331),
("<time-of-day> s\225ng|chi\7873u|t\7889ing\224y mai", ("<time-of-day> s\225ng|chi\7873u|t\7889ing\224y mai",
-4.31748811353631), -4.330733340286331),
("Tuesdayintersect", -4.31748811353631), ("Tuesdayintersect", -4.330733340286331),
("Monday<day-of-month> (numeric with day symbol) <named-month>", ("Monday<day-of-month> (numeric with day symbol) <named-month>",
-3.0647251450409425), -3.077970371790963),
("seasonthis <cycle>", -4.31748811353631), ("seasonthis <cycle>", -4.330733340286331),
("minuteyear", -3.912023005428146)], ("minuteyear", -3.925268232178167)],
n = 53}, n = 54},
koData = koData =
ClassData{prior = -1.5114575040738967, unseen = -4.31748811353631, ClassData{prior = -1.5260563034950494, unseen = -4.31748811353631,
likelihoods = likelihoods =
HashMap.fromList HashMap.fromList
[("<time-of-day> s\225ng|chi\7873u|t\7889ing\224y dd/mm", [("<time-of-day> s\225ng|chi\7873u|t\7889ing\224y dd/mm",
@ -533,12 +533,12 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}), likelihoods = HashMap.fromList [], n = 0}}),
("month (numeric with month symbol)", ("month (numeric with month symbol)",
Classifier{okData = Classifier{okData =
ClassData{prior = 0.0, unseen = -3.4339872044851463, ClassData{prior = 0.0, unseen = -3.4657359027997265,
likelihoods = likelihoods =
HashMap.fromList HashMap.fromList
[("integer (numeric)", -0.2231435513142097), [("integer (numeric)", -0.21511137961694557),
("integer (0..19)", -1.6094379124341003)], ("integer (0..19)", -1.6422277352570913)],
n = 28}, n = 29},
koData = koData =
ClassData{prior = -infinity, unseen = -1.0986122886681098, ClassData{prior = -infinity, unseen = -1.0986122886681098,
likelihoods = HashMap.fromList [], n = 0}}), likelihoods = HashMap.fromList [], n = 0}}),
@ -592,8 +592,8 @@ classifiers
likelihoods = HashMap.fromList [("", 0.0)], n = 11}}), likelihoods = HashMap.fromList [("", 0.0)], n = 11}}),
("Sunday", ("Sunday",
Classifier{okData = Classifier{okData =
ClassData{prior = 0.0, unseen = -1.791759469228055, ClassData{prior = 0.0, unseen = -2.1972245773362196,
likelihoods = HashMap.fromList [("", 0.0)], n = 4}, likelihoods = HashMap.fromList [("", 0.0)], n = 7},
koData = koData =
ClassData{prior = -infinity, unseen = -0.6931471805599453, ClassData{prior = -infinity, unseen = -0.6931471805599453,
likelihoods = HashMap.fromList [], n = 0}}), likelihoods = HashMap.fromList [], n = 0}}),
@ -690,27 +690,27 @@ classifiers
ClassData{prior = -infinity, unseen = -2.995732273553991, ClassData{prior = -infinity, unseen = -2.995732273553991,
likelihoods = HashMap.fromList [], n = 0}, likelihoods = HashMap.fromList [], n = 0},
koData = koData =
ClassData{prior = 0.0, unseen = -5.225746673713201, ClassData{prior = 0.0, unseen = -5.236441962829949,
likelihoods = likelihoods =
HashMap.fromList HashMap.fromList
[("week", -3.42859635585027), [("week", -3.4393491476265314),
("integer (0..19)year (grain)", -4.527208644518379), ("integer (0..19)year (grain)", -4.537961436294641),
("integer (numeric)day (grain)", -3.0231312477421053), ("integer (numeric)day (grain)", -3.0338840395183673),
("integer (0..19)hour (grain)", -3.834061463958434), ("integer (0..19)hour (grain)", -3.844814255734696),
("second", -3.6109179126442243), ("second", -3.6216707044204863),
("integer (numeric)second (grain)", -3.6109179126442243), ("integer (numeric)second (grain)", -3.6216707044204863),
("integer (numeric)year (grain)", -2.655406467616788), ("integer (numeric)year (grain)", -2.66615925939305),
("day", -2.822460552279954), ("year", -2.581298495463066), ("day", -2.833213344056216), ("year", -2.592051287239328),
("integer (numeric)week (grain)", -4.121743536410215), ("integer (numeric)week (grain)", -4.132496328186477),
("integer (0..19)month (grain)", -4.527208644518379), ("integer (0..19)month (grain)", -4.537961436294641),
("hour", -2.001480000210124), ("month", -2.042301994730379), ("hour", -2.012232791986386), ("month", -2.012232791986386),
("integer (numeric)minute (grain)", -3.6109179126442243), ("integer (numeric)minute (grain)", -3.6216707044204863),
("integer (numeric)month (grain)", -2.084861609149175), ("integer (numeric)month (grain)", -2.053054786506641),
("minute", -3.6109179126442243), ("minute", -3.6216707044204863),
("integer (numeric)hour (grain)", -2.129313371720009), ("integer (numeric)hour (grain)", -2.1400661634962708),
("integer (0..19)day (grain)", -4.121743536410215), ("integer (0..19)day (grain)", -4.132496328186477),
("integer (0..19)week (grain)", -3.834061463958434)], ("integer (0..19)week (grain)", -3.844814255734696)],
n = 83}}), n = 84}}),
("<time-of-day> am|pm", ("<time-of-day> am|pm",
Classifier{okData = Classifier{okData =
ClassData{prior = 0.0, unseen = -1.6094379124341003, ClassData{prior = 0.0, unseen = -1.6094379124341003,
@ -857,17 +857,17 @@ classifiers
n = 2}}), n = 2}}),
("<day-of-month> <named-month>", ("<day-of-month> <named-month>",
Classifier{okData = Classifier{okData =
ClassData{prior = -0.10008345855698253, ClassData{prior = -9.53101798043249e-2,
unseen = -3.7376696182833684, unseen = -3.784189633918261,
likelihoods = likelihoods =
HashMap.fromList HashMap.fromList
[("integer (numeric)month (numeric with month symbol)", [("integer (numeric)month (numeric with month symbol)",
-0.8232003088081431), -0.8167611365271219),
("month", -0.7178397931503169), ("month", -0.7166776779701395),
("integer (numeric)March", -2.6149597780361984)], ("integer (numeric)March", -2.662587827025453)],
n = 19}, n = 20},
koData = koData =
ClassData{prior = -2.3513752571634776, ClassData{prior = -2.3978952727983707,
unseen = -2.0794415416798357, unseen = -2.0794415416798357,
likelihoods = likelihoods =
HashMap.fromList HashMap.fromList
@ -911,8 +911,8 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}), likelihoods = HashMap.fromList [], n = 0}}),
("morning", ("morning",
Classifier{okData = Classifier{okData =
ClassData{prior = 0.0, unseen = -1.3862943611198906, ClassData{prior = 0.0, unseen = -1.6094379124341003,
likelihoods = HashMap.fromList [("", 0.0)], n = 2}, likelihoods = HashMap.fromList [("", 0.0)], n = 3},
koData = koData =
ClassData{prior = -infinity, unseen = -0.6931471805599453, ClassData{prior = -infinity, unseen = -0.6931471805599453,
likelihoods = HashMap.fromList [], n = 0}}), likelihoods = HashMap.fromList [], n = 0}}),
@ -938,14 +938,14 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}), likelihoods = HashMap.fromList [], n = 0}}),
("<day-of-month> (numeric with day symbol) <named-month>", ("<day-of-month> (numeric with day symbol) <named-month>",
Classifier{okData = Classifier{okData =
ClassData{prior = 0.0, unseen = -3.784189633918261, ClassData{prior = 0.0, unseen = -3.828641396489095,
likelihoods = likelihoods =
HashMap.fromList HashMap.fromList
[("integer (numeric)month (numeric with month symbol)", [("integer (numeric)month (numeric with month symbol)",
-0.8167611365271219), -0.8109302162163288),
("month", -0.7166776779701395), ("month", -0.7156200364120039),
("integer (numeric)March", -2.662587827025453)], ("integer (numeric)March", -2.70805020110221)],
n = 20}, n = 21},
koData = koData =
ClassData{prior = -infinity, unseen = -1.3862943611198906, ClassData{prior = -infinity, unseen = -1.3862943611198906,
likelihoods = HashMap.fromList [], n = 0}})] likelihoods = HashMap.fromList [], n = 0}})]

View File

@ -75,6 +75,7 @@ allExamples = concat
] ]
, examples (datetime (2017, 2, 5, 0, 0, 0) Day) , examples (datetime (2017, 2, 5, 0, 0, 0) Day)
[ "chủ nhật" [ "chủ nhật"
, "chúa nhật"
] ]
, examples (datetime (2017, 6, 1, 0, 0, 0) Month) , examples (datetime (2017, 6, 1, 0, 0, 0) Month)
[ "tháng 6" [ "tháng 6"
@ -124,6 +125,7 @@ allExamples = concat
, examples (datetime (2017, 4, 9, 0, 0, 0) Day) , examples (datetime (2017, 4, 9, 0, 0, 0) Day)
[ "chủ nhật ngày mồng 9 tháng 4" [ "chủ nhật ngày mồng 9 tháng 4"
, "chủ nhật ngày 9 tháng 4" , "chủ nhật ngày 9 tháng 4"
, "chúa nhật ngày 9 tháng 4"
] ]
, examples (datetime (2017, 2, 6, 0, 0, 0) Day) , examples (datetime (2017, 2, 6, 0, 0, 0) Day)
[ "thứ 2 ngày 6 tháng 2" [ "thứ 2 ngày 6 tháng 2"
@ -292,6 +294,7 @@ allExamples = concat
] ]
, examples (datetimeInterval ((2017, 2, 5, 4, 0, 0), (2017, 2, 5, 12, 0, 0)) Hour) , examples (datetimeInterval ((2017, 2, 5, 4, 0, 0), (2017, 2, 5, 12, 0, 0)) Hour)
[ "sáng chủ nhật" [ "sáng chủ nhật"
, "sáng chúa nhật"
] ]
, examples (datetimeInterval ((2017, 2, 2, 3, 54, 58), (2017, 2, 2, 3, 55, 0)) Second) , examples (datetimeInterval ((2017, 2, 2, 3, 54, 58), (2017, 2, 2, 3, 55, 0)) Second)
[ "2 giây vừa rồi" [ "2 giây vừa rồi"

View File

@ -47,7 +47,7 @@ ruleDaysOfWeek = mkRuleDaysOfWeek
, ( "Thursday" , "th(ứ) (5|n(ă)m)" ) , ( "Thursday" , "th(ứ) (5|n(ă)m)" )
, ( "Friday" , "th(ứ) 6|th(ứ) s(á)u" ) , ( "Friday" , "th(ứ) 6|th(ứ) s(á)u" )
, ( "Saturday" , "th(ứ) (7|b((ả)|(ẩ))y)" ) , ( "Saturday" , "th(ứ) (7|b((ả)|(ẩ))y)" )
, ( "Sunday" , "ch(ủ) nh(ậ)t" ) , ( "Sunday" , "ch(()|(ú)a) nh(ậ)t" )
] ]
ruleMonths :: [Rule] ruleMonths :: [Rule]