mirror of
https://github.com/facebook/duckling.git
synced 2024-10-26 21:59:44 +03:00
Add more variants of egp to EN and AR AmountOfMoney dimension (#590)
Summary: These are popular variants/abbreviations of Egyptian pounds. All these forms are documented on wikipedia (https://en.wikipedia.org/wiki/Egyptian_pound) Pull Request resolved: https://github.com/facebook/duckling/pull/590 Reviewed By: haoxuany Differential Revision: D27598249 Pulled By: chessai fbshipit-source-id: 42ae9115b1def48c58e50a6deb624c3407c029f3
This commit is contained in:
parent
3157d2e553
commit
8a8f557002
@ -86,6 +86,8 @@ allExamples = concat
|
||||
[ "42 EGP"
|
||||
, "42 جنيه مصري"
|
||||
, "42 جنيهات مصريه"
|
||||
, "42 ج.م"
|
||||
, "42 ج.م."
|
||||
]
|
||||
, examples (simple QAR 42)
|
||||
[ "42 QAR"
|
||||
|
@ -51,6 +51,15 @@ rulePounds = Rule
|
||||
, prod = \_ -> Just . Token AmountOfMoney $ currencyOnly Pound
|
||||
}
|
||||
|
||||
ruleEgpAbrreviation :: Rule
|
||||
ruleEgpAbrreviation = Rule
|
||||
{ name = "EGP abbreviation"
|
||||
, pattern =
|
||||
[ regex "ج[.]م[.]?"
|
||||
]
|
||||
, prod = \_ -> Just . Token AmountOfMoney $ currencyOnly EGP
|
||||
}
|
||||
|
||||
ruleDinars :: Rule
|
||||
ruleDinars = Rule
|
||||
{ name = "dinars"
|
||||
@ -390,6 +399,7 @@ rules =
|
||||
[ ruleUnitAmount
|
||||
, ruleCent
|
||||
, rulePounds
|
||||
, ruleEgpAbrreviation
|
||||
, ruleDinars
|
||||
, ruleDirhams
|
||||
, ruleRiyals
|
||||
|
@ -149,6 +149,12 @@ allExamples = concat
|
||||
, examples (simple EGP 42)
|
||||
[ "42 EGP"
|
||||
, "42 egyptianpound"
|
||||
, "42 LE"
|
||||
, "42 L.E"
|
||||
, "42 l.e."
|
||||
, "42 le"
|
||||
, "42 geneh"
|
||||
, "42 genihat masriya"
|
||||
]
|
||||
, examples (simple QAR 42)
|
||||
[ "42 QAR"
|
||||
|
@ -65,6 +65,24 @@ ruleOtherPounds = Rule
|
||||
_ -> Nothing
|
||||
}
|
||||
|
||||
ruleEgpAbrreviation :: Rule
|
||||
ruleEgpAbrreviation = Rule
|
||||
{ name = "livre égyptienne"
|
||||
, pattern =
|
||||
[ regex "[lL].?[eE].?"
|
||||
]
|
||||
, prod = \_ -> Just . Token AmountOfMoney $ currencyOnly EGP
|
||||
}
|
||||
|
||||
ruleEgpArabizi :: Rule
|
||||
ruleEgpArabizi = Rule
|
||||
{ name = "geneh"
|
||||
, pattern =
|
||||
[ regex "[Gg][eiy]*n[eiy]*h(at)?( m[aiey]?sr[eiy]+a?)?"
|
||||
]
|
||||
, prod = \_ -> Just . Token AmountOfMoney $ currencyOnly EGP
|
||||
}
|
||||
|
||||
ruleRiyals :: Rule
|
||||
ruleRiyals = Rule
|
||||
{ name = "riyals"
|
||||
@ -405,6 +423,8 @@ rules =
|
||||
, ruleIntervalDash
|
||||
, ruleKopiyka
|
||||
, ruleOtherPounds
|
||||
, ruleEgpAbrreviation
|
||||
, ruleEgpArabizi
|
||||
, rulePounds
|
||||
, rulePrecision
|
||||
, ruleRinggit
|
||||
|
Loading…
Reference in New Issue
Block a user