Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Rules.hs #711

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions Duckling/Duration/RO/Rules.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,32 @@ ruleQuarterOfAnHour = Rule
, prod = \_ -> Just . Token Duration $ duration TG.Minute 15
}

ruleJumatateDeOra :: Rule
ruleJumatateDeOra = Rule
{ name = "jumatate de ora"
ruleHalfOfAnHour :: Rule
ruleHalfOfAnHour = Rule
{ name = "half of an hour"
, pattern =
[ regex "(1/2\\s?(h|or(a|ă))|jum(a|ă)tate (de )?or(a|ă))"
]
, prod = \_ -> Just . Token Duration $ duration TG.Minute 30
}

ruleTreiSferturiDeOra :: Rule
ruleTreiSferturiDeOra = Rule
{ name = "trei sferturi de ora"
ruleThreeQuartersOfAnHour :: Rule
ruleThreeQuartersOfAnHour = Rule
{ name = "three quarters of an hour"
, pattern =
[ regex "(3/4\\s?(h|or(a|ă))|trei sferturi de or(a|ă))"
]
, prod = \_ -> Just . Token Duration $ duration TG.Minute 45
}

ruleOneNight :: Rule
ruleOneNight = Rule
{ name = "one night"
, pattern =
[ regex "(1\s?noapte)|(o noapte)"
]
, prod = _ -> Just . Token Duration $ duration TG.Day 1
}

ruleOUnitofduration :: Rule
ruleOUnitofduration = Rule
Expand Down Expand Up @@ -93,9 +102,10 @@ ruleIntegerDeUnitofduration = Rule
rules :: [Rule]
rules =
[ ruleExactInJurDeDuration
, ruleJumatateDeOra
, ruleHalfOfAnHour
, ruleOUnitofduration
, ruleQuarterOfAnHour
, ruleTreiSferturiDeOra
, ruleThreeQuartersOfAnHour
, ruleIntegerDeUnitofduration
, ruleOneNight
]