Replace words in a Greek given text, for example with English words.
Here an example:
var str= "Ενώ Gallant δεν λειτουργεί στην προσπάθεια να χτίσει πια μηχανές αποκωδικοποίησης, οι άλλοι."
function findword(){
word = new RegExp("\\b(προσπάθεια)\\b","gi")
var sust = str.replace(word,'effort');
}
It should return: "Ενώ Gallant δεν λειτουργεί στην effort να χτίσει πια μηχανές αποκωδικοποίησης, οι άλλοι.
Trying to do it in JavaScript I failed, but I have read that this is not possible since this language does not handle Unicode characters other than English. The only possibility I found is xregexp, but it seems that only would work to detect character classes and not individual words. ¿Is really impossible to make it work in JavaScript?
The Python 3 Documentation states that this language can handle unicode characters, but in this case it seems that it's necessary to write characters with the unicode code... With which languaje would it be possible to replace words in the simplest way as I wrote in the code? Python, Java, Perl ...?