-1
It is possible using Javascript to convert string to camelCase, eg: areaEspacoReservado
in Área espaço reservado
Obs: add the accents where necessary ?
-1
It is possible using Javascript to convert string to camelCase, eg: areaEspacoReservado
in Área espaço reservado
Obs: add the accents where necessary ?
1
It is possible but laborious. You would need to create an accent "dictionary" to make the conversion (area
for área
, for example). The flow would be:
regex
And even then it would not solve all the problems, because in these phrases: "Today I went to the office" and "Today I talked to the secretary" which will delimit that secretaria
should or should not carry accent?
Correct, it would be necessary a contextual analysis also in this case.
Browser other questions tagged javascript
You are not signed in. Login or sign up in order to post.
"Add the accents where necessary" Then you pushed a little, right
– Jéf Bueno
Yes it is possible, as long as you create a dictionary with all the accented words to make the substitution..
– Leandro Angelo
What are the criteria? List them all.
– Maniero
formaDaForma - is it "formwork form" or "formwork shape"? In some cases the accent will be impossible to determine.
– William John Adam Trindade
You also have to ensure that there will be no words that are written in the same way but only differentiated by the accent (as "knew", "wise" and "wise"). Maybe in your case you don’t, but anyway. The string variation is so great that you need such a general solution? Maybe it’s easier to map the entire string (
areaEspacoReservado
) to its respective text...– hkotsubo
The criteria would be to use values in camelCase that comes in the keys of a json dynamically, I can manipulate this JSON if I can add the accents would have any problem? would help ?
– wDrik
@wDrik I believe accents are no problem.
– Sam
In my opinion, putting the accents correctly makes the question very broad, and liable to be closed for that reason. To be done correctly is probably thing for master’s thesis.
– Isac
In fact it doesn’t even need the dictionary, just an algorithm for the grammatical rules, ex: area is proparoxitone, so will accent...
– MagicHat
@Magichat and how exactly the algorithm will know which syllable of each word to define what is oxytone, paroxitone or proparoxitone?
– Máttheus Spoo
@Máttheusspoo look for
algorítimo prosódico
.– MagicHat