mirror of
https://github.com/facebook/duckling.git
synced 2024-09-11 21:27:13 +03:00
Use mkRuleHoliday for KO language
Summary: Use mkRuleHoliday for KO language Reviewed By: patapizza Differential Revision: D16441727 fbshipit-source-id: 167c47ed5f3960e9ab68d9b4b444ae9f1c63eda5
This commit is contained in:
parent
e8ecb23113
commit
70dde3bc60
@ -507,7 +507,7 @@ classifiers
|
||||
ClassData{prior = -0.40546510810816444,
|
||||
unseen = -1.791759469228055,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 4}}),
|
||||
("christmas eve",
|
||||
("Christmas Eve",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -1.0986122886681098,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 1},
|
||||
@ -985,6 +985,15 @@ classifiers
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("Christmas",
|
||||
Classifier{okData =
|
||||
ClassData{prior = -0.6931471805599453,
|
||||
unseen = -1.0986122886681098,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 1},
|
||||
koData =
|
||||
ClassData{prior = -0.6931471805599453,
|
||||
unseen = -1.0986122886681098,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),
|
||||
("<integer> and an half hours",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -1.9459101490553135,
|
||||
@ -1070,15 +1079,6 @@ classifiers
|
||||
("day", -1.6739764335716716),
|
||||
("day (grain)", -1.6739764335716716)],
|
||||
n = 4}}),
|
||||
("christmas",
|
||||
Classifier{okData =
|
||||
ClassData{prior = -0.6931471805599453,
|
||||
unseen = -1.0986122886681098,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 1},
|
||||
koData =
|
||||
ClassData{prior = -0.6931471805599453,
|
||||
unseen = -1.0986122886681098,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),
|
||||
("next n <cycle>",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -3.4965075614664802,
|
||||
|
@ -348,35 +348,35 @@ allExamples = concat
|
||||
, examples (datetimeInterval ((2012, 12, 21, 0, 0, 0), (2013, 3, 21, 0, 0, 0)) Day)
|
||||
[ "이번겨울"
|
||||
]
|
||||
, examples (datetime (2013, 12, 25, 0, 0, 0) Day)
|
||||
, examples (datetimeHoliday (2013, 12, 25, 0, 0, 0) Day "Christmas")
|
||||
[ "크리스마스"
|
||||
]
|
||||
, examples (datetime (2013, 12, 24, 0, 0, 0) Day)
|
||||
, examples (datetimeHoliday (2013, 12, 24, 0, 0, 0) Day "Christmas Eve")
|
||||
[ "크리스마스이브"
|
||||
]
|
||||
, examples (datetime (2014, 1, 1, 0, 0, 0) Day)
|
||||
, examples (datetimeHoliday (2014, 1, 1, 0, 0, 0) Day "New Year's Day")
|
||||
[ "신정"
|
||||
, "설날"
|
||||
]
|
||||
, examples (datetime (2013, 3, 1, 0, 0, 0) Day)
|
||||
, examples (datetimeHoliday (2013, 3, 1, 0, 0, 0) Day "Independence Movement Day")
|
||||
[ "삼일절"
|
||||
]
|
||||
, examples (datetime (2013, 5, 5, 0, 0, 0) Day)
|
||||
, examples (datetimeHoliday (2013, 5, 5, 0, 0, 0) Day "Children's Day")
|
||||
[ "어린이날"
|
||||
]
|
||||
, examples (datetime (2013, 6, 6, 0, 0, 0) Day)
|
||||
, examples (datetimeHoliday (2013, 6, 6, 0, 0, 0) Day "Memorial Day")
|
||||
[ "현충일"
|
||||
]
|
||||
, examples (datetime (2013, 6, 17, 0, 0, 0) Day)
|
||||
, examples (datetimeHoliday (2013, 7, 17, 0, 0, 0) Day "Constitution Day")
|
||||
[ "제헌절"
|
||||
]
|
||||
, examples (datetime (2013, 8, 15, 0, 0, 0) Day)
|
||||
, examples (datetimeHoliday (2013, 8, 15, 0, 0, 0) Day "Liberation Day")
|
||||
[ "광복절"
|
||||
]
|
||||
, examples (datetime (2013, 10, 3, 0, 0, 0) Day)
|
||||
, examples (datetimeHoliday (2013, 10, 3, 0, 0, 0) Day "National Foundation Day")
|
||||
[ "개천절"
|
||||
]
|
||||
, examples (datetime (2013, 10, 9, 0, 0, 0) Day)
|
||||
, examples (datetimeHoliday (2013, 10, 9, 0, 0, 0) Day "Hangul Day")
|
||||
[ "한글날"
|
||||
]
|
||||
, examples (datetimeInterval ((2013, 2, 12, 18, 0, 0), (2013, 2, 13, 0, 0, 0)) Hour)
|
||||
|
@ -26,6 +26,30 @@ import qualified Duckling.Ordinal.Types as TOrdinal
|
||||
import qualified Duckling.Time.Types as TTime
|
||||
import qualified Duckling.TimeGrain.Types as TG
|
||||
|
||||
ruleHolidays :: [Rule]
|
||||
ruleHolidays = mkRuleHolidays
|
||||
[ ( "Liberation Day" , "광복절"
|
||||
, monthDay 8 15 )
|
||||
, ( "Constitution Day" , "제헌절"
|
||||
, monthDay 7 17 )
|
||||
, ( "New Year's Day" , "(신정)|(설날)"
|
||||
, monthDay 1 1 )
|
||||
, ( "Hangul Day" , "한글날"
|
||||
, monthDay 10 9 )
|
||||
, ( "National Foundation Day" , "개천절"
|
||||
, monthDay 10 3 )
|
||||
, ( "Independence Movement Day" , "삼일절"
|
||||
, monthDay 3 1 )
|
||||
, ( "Memorial Day" , "현충일"
|
||||
, monthDay 6 6 )
|
||||
, ( "Christmas" , "크리스마스"
|
||||
, monthDay 12 25 )
|
||||
, ( "Christmas Eve" , "(크리스마스)?이브"
|
||||
, monthDay 12 24 )
|
||||
, ( "Children's Day" , "어린이날"
|
||||
, monthDay 5 5 )
|
||||
]
|
||||
|
||||
ruleNamedday :: Rule
|
||||
ruleNamedday = Rule
|
||||
{ name = "<named-day>에"
|
||||
@ -38,15 +62,6 @@ ruleNamedday = Rule
|
||||
_ -> Nothing
|
||||
}
|
||||
|
||||
ruleLiberationDay :: Rule
|
||||
ruleLiberationDay = Rule
|
||||
{ name = "Liberation Day"
|
||||
, pattern =
|
||||
[ regex "광복절"
|
||||
]
|
||||
, prod = \_ -> tt $ monthDay 8 15
|
||||
}
|
||||
|
||||
ruleTheDayAfterTomorrow :: Rule
|
||||
ruleTheDayAfterTomorrow = Rule
|
||||
{ name = "the day after tomorrow - 내일모레"
|
||||
@ -57,15 +72,6 @@ ruleTheDayAfterTomorrow = Rule
|
||||
tt . cycleNthAfter False TG.Day 1 $ cycleNth TG.Day 1
|
||||
}
|
||||
|
||||
ruleConstitutionDay :: Rule
|
||||
ruleConstitutionDay = Rule
|
||||
{ name = "Constitution Day"
|
||||
, pattern =
|
||||
[ regex "제헌절"
|
||||
]
|
||||
, prod = \_ -> tt $ monthDay 6 17
|
||||
}
|
||||
|
||||
ruleTimeofday4 :: Rule
|
||||
ruleTimeofday4 = Rule
|
||||
{ name = "<time-of-day>이전"
|
||||
@ -119,15 +125,6 @@ ruleThisDayofweek = Rule
|
||||
_ -> Nothing
|
||||
}
|
||||
|
||||
ruleNewYearsDay :: Rule
|
||||
ruleNewYearsDay = Rule
|
||||
{ name = "New Year's Day"
|
||||
, pattern =
|
||||
[ regex "신정|설날"
|
||||
]
|
||||
, prod = \_ -> tt $ monthDay 1 1
|
||||
}
|
||||
|
||||
ruleLastTime :: Rule
|
||||
ruleLastTime = Rule
|
||||
{ name = "last <time>"
|
||||
@ -450,15 +447,6 @@ ruleAfternoon = Rule
|
||||
interval TTime.Open from to
|
||||
}
|
||||
|
||||
ruleChristmasEve :: Rule
|
||||
ruleChristmasEve = Rule
|
||||
{ name = "christmas eve"
|
||||
, pattern =
|
||||
[ regex "(크리스마스)?이브"
|
||||
]
|
||||
, prod = \_ -> tt $ monthDay 12 24
|
||||
}
|
||||
|
||||
ruleInduringThePartofday :: Rule
|
||||
ruleInduringThePartofday = Rule
|
||||
{ name = "in|during the <part-of-day>"
|
||||
@ -884,15 +872,6 @@ ruleTimeofday3 = Rule
|
||||
_ -> Nothing
|
||||
}
|
||||
|
||||
ruleMemorialDay :: Rule
|
||||
ruleMemorialDay = Rule
|
||||
{ name = "Memorial Day"
|
||||
, pattern =
|
||||
[ regex "현충일"
|
||||
]
|
||||
, prod = \_ -> tt $ monthDay 6 6
|
||||
}
|
||||
|
||||
ruleYearLatent :: Rule
|
||||
ruleYearLatent = Rule
|
||||
{ name = "year (latent)"
|
||||
@ -940,15 +919,6 @@ ruleAfterTimeofday = Rule
|
||||
_ -> Nothing
|
||||
}
|
||||
|
||||
ruleChristmas :: Rule
|
||||
ruleChristmas = Rule
|
||||
{ name = "christmas"
|
||||
, pattern =
|
||||
[ regex "크리스마스"
|
||||
]
|
||||
, prod = \_ -> tt $ monthDay 12 25
|
||||
}
|
||||
|
||||
ruleTimeofdayAmpm :: Rule
|
||||
ruleTimeofdayAmpm = Rule
|
||||
{ name = "<time-of-day> am|pm"
|
||||
@ -1006,15 +976,6 @@ ruleTimeofday = Rule
|
||||
_ -> Nothing
|
||||
}
|
||||
|
||||
ruleHangulDay :: Rule
|
||||
ruleHangulDay = Rule
|
||||
{ name = "Hangul Day"
|
||||
, pattern =
|
||||
[ regex "한글날"
|
||||
]
|
||||
, prod = \_ -> tt $ monthDay 10 9
|
||||
}
|
||||
|
||||
ruleHhmm :: Rule
|
||||
ruleHhmm = Rule
|
||||
{ name = "hh:mm"
|
||||
@ -1057,15 +1018,6 @@ ruleYear = Rule
|
||||
_ -> Nothing
|
||||
}
|
||||
|
||||
ruleChildrensDay :: Rule
|
||||
ruleChildrensDay = Rule
|
||||
{ name = "Children's Day"
|
||||
, pattern =
|
||||
[ regex "어린이날"
|
||||
]
|
||||
, prod = \_ -> tt $ monthDay 5 5
|
||||
}
|
||||
|
||||
ruleAbsorptionOfAfterNamedDay :: Rule
|
||||
ruleAbsorptionOfAfterNamedDay = Rule
|
||||
{ name = "absorption of , after named day"
|
||||
@ -1136,15 +1088,6 @@ ruleTimeofdayTimeofdayInterval = Rule
|
||||
_ -> Nothing
|
||||
}
|
||||
|
||||
ruleNationalFoundationDay :: Rule
|
||||
ruleNationalFoundationDay = Rule
|
||||
{ name = "National Foundation Day"
|
||||
, pattern =
|
||||
[ regex "개천절"
|
||||
]
|
||||
, prod = \_ -> tt $ monthDay 10 3
|
||||
}
|
||||
|
||||
ruleEveningnight :: Rule
|
||||
ruleEveningnight = Rule
|
||||
{ name = "evening|night"
|
||||
@ -1158,15 +1101,6 @@ ruleEveningnight = Rule
|
||||
interval TTime.Open from to
|
||||
}
|
||||
|
||||
ruleIndependenceMovementDay :: Rule
|
||||
ruleIndependenceMovementDay = Rule
|
||||
{ name = "Independence Movement Day"
|
||||
, pattern =
|
||||
[ regex "삼일절"
|
||||
]
|
||||
, prod = \_ -> tt $ monthDay 3 1
|
||||
}
|
||||
|
||||
ruleMmddyyyy :: Rule
|
||||
ruleMmddyyyy = Rule
|
||||
{ name = "mm/dd/yyyy"
|
||||
@ -1258,10 +1192,6 @@ rules =
|
||||
, ruleAfternoon
|
||||
, ruleAmpmTimeofday
|
||||
, ruleByTime
|
||||
, ruleChildrensDay
|
||||
, ruleChristmas
|
||||
, ruleChristmasEve
|
||||
, ruleConstitutionDay
|
||||
, ruleDate
|
||||
, ruleDatetimeDatetimeInterval
|
||||
, ruleDay
|
||||
@ -1273,14 +1203,12 @@ rules =
|
||||
, ruleEndOfTime
|
||||
, ruleEveningnight
|
||||
, ruleExactlyTimeofday
|
||||
, ruleHangulDay
|
||||
, ruleHhmm
|
||||
, ruleHhmmMilitaryAmpm
|
||||
, ruleHhmmss
|
||||
, ruleHourofdayIntegerAsRelativeMinutes
|
||||
, ruleHourofdayHalfAsRelativeMinutes
|
||||
, ruleInDuration
|
||||
, ruleIndependenceMovementDay
|
||||
, ruleInduringThePartofday
|
||||
, ruleIntegerHourofdayRelativeMinutes
|
||||
, ruleHalfHourofdayRelativeMinutes
|
||||
@ -1289,9 +1217,7 @@ rules =
|
||||
, ruleLastCycle
|
||||
, ruleLastNCycle
|
||||
, ruleLastTime
|
||||
, ruleLiberationDay
|
||||
, ruleLunch
|
||||
, ruleMemorialDay
|
||||
, ruleMidnighteodendOfDay
|
||||
, ruleMmdd
|
||||
, ruleMmddyyyy
|
||||
@ -1299,8 +1225,6 @@ rules =
|
||||
, ruleMorning
|
||||
, ruleNamedday
|
||||
, ruleNamedmonth
|
||||
, ruleNationalFoundationDay
|
||||
, ruleNewYearsDay
|
||||
, ruleNextCycle
|
||||
, ruleNextNCycle
|
||||
, ruleNextTime
|
||||
@ -1346,3 +1270,4 @@ rules =
|
||||
, ruleSeconds
|
||||
, ruleTimezone
|
||||
]
|
||||
++ ruleHolidays
|
||||
|
Loading…
Reference in New Issue
Block a user