X
X
xexsus2010-09-09 18:08:03
PHP
xexsus, 2010-09-09 18:08:03

Multilingual transliteration to PHP?

It is necessary to get a similar-sounding text in ANSII from text in any language.
Is there such a solution in php?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
D
dmiceman, 2010-09-09
@dmiceman

I'm afraid that Google does not find anything ready. And this is indeed a very difficult and complex task, quite unlike the work of mb_strtoupper(). With changing the case of characters, everything is simple - there are Unicode characters, there are correspondence tables. But there are no tables of "proximity in sound". And something tells me that it is impossible to create them regardless of the context of the language.
Even in phonetic languages, there is great arbitrariness in the sound of the same letters depending on the context. And the same Cyrillic alphabet is used in many languages, while sounding a little differently.
What can we say about hieroglyphs, which, being encoded by the same byte sequences, sound different for different peoples using them. Moreover, the sounds of languages ​​with variable pitch are quite difficult to convey using ASCII.
But here, in particular, I found tables for Russian: textpattern.ru/html/transliteration-tables.htm

L
LIAL, 2010-09-09
@LIAL

I think no.
> in any language,
you can imagine the scope of implementation and think you would do such a project??

D
diggy, 2010-09-09
@diggy

iconv //TRANSLIT checked? (I never needed it, just as an option)

V
voroninman, 2010-09-10
@voroninman

Everything is simple. Take an array of matches 'yo'='yo' and feed it to the strtr() function.

K
Karsonito, 2012-06-04
@Karsonito

As I understand it, the question is still open. The transliteration
module from drupal helped me. There is a function there. You just need to saw off the binding to Drupal. By the way, the sources are based on MediaWiki and Text::Unidecode.

B
Boris, 2013-11-27
@ekho

http://www.php.net/manual/ru/class.transliterator.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question