facebook / facebook/duckling

Rules with no Spaces in numerals

Đang mở
#415 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug IT (Italian)
Ngôn ngữ chính
Haskell
Star
4.3k
Fork
740
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hi,

the rule below works for Italian in parsing number with three digits such as `tre cento venti` (320), but fails in recognizing the same expression without spaces (`trecentoventi`) which is actually the correct one in Italian.

Could anyone points out an easy way to transform this rule, to make it working without spaces?

Thanks! 🙏

https://github.com/facebook/duckling/blob/1b36e2b8191a1c37dc316e0ebf6c7468751faac6/Duckling/Numeral/IT/Rules.hs#L286

```haskell
ruleNumerals :: Rule
ruleNumerals = Rule
{ name = "numbers 200..999"
, pattern =
[ numberBetween 2 10
, numberWith TNumeral.value (== 100)
, numberBetween 0 100
]
, prod = \tokens -> case tokens of
(Token Numeral NumeralData{TNumeral.value = v1}:
Token Numeral NumeralData{TNumeral.value = v2}:
Token Numeral NumeralData{TNumeral.value = v3}:
_) -> double $ v1 * v2 + v3
_ -> Nothing
}
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.