Locale-aware number parsing #5501
Replies: 2 comments 2 replies
-
Not at the moment, no. @sffc is this an API available in ICU4C? I know in general we have avoided parsing APIs. |
Beta Was this translation helpful? Give feedback.
-
ICU4X and ECMA-402 do not currently support parsing of localized strings. Please read my blog post on the subject: https://blog.sffc.xyz/post/190943794505/why-you-should-not-parse-localized-strings We should, but I think we don't currently, export the Digit property so that you can write your own parser for your own use case. As I've stated previously, I don't consider adding a "good" number or date parser to be out of scope. ICU4C's approach, essentially "backwards formatting", is very brittle, error-prone, and an excellent example of how not to write a parser. The "best" parser would be to use an LLM, and if we were to implement one in ICU4X, I think it should start from the perspective of having behavior on par with what you would get from an LLM. |
Beta Was this translation helpful? Give feedback.
-
Is there a way to parse numbers from localized strings? Like parse 100 from
"১০০"
in localebn
?Beta Was this translation helpful? Give feedback.
All reactions