How to remove accentuation?
How to remove accentuation of a word?
Ex:
Árvore = Arvore
você = voce
Então = entao
The words above are in brazilian portuguese, I need to get rid with the accentuation such that I can compare two sentences.
Thanks in advance.
Use $translate?
e.g.
ClassMethod NoAccents(stringWithAccents as %String) as %String { w "before: ",stringWithAccents set accent="Áêã",usual="Aea",! set val=$translate(stringWithAccents,accent,usual) w "after: ",val return val }
To handle this in the general case, you would decompose the string, then strip out non-spacing marks. Unicode normalization has been requested previously, and will hopefully make it into the product at some point.
Another option is to use a regular expression, like this:
This is a very delayed answer to an old question, but there is now a $zconvert mode in IRIS that will do this for you:
WOW! Nice!
But...is there any reason why this is not documented?
When was it introduced?
A quick test shows it was not available in Caché based products, that is 2018 and is available in 2022.1.
At the moment I cannot test version 2019 to 2021.