How to compare two strings [已 ] , [巳 ] and see how close to each others? Using PHP

Viewed 125

I have tried many different ways to do this task:

  1. Levenshtein
  2. Fuzzy
  3. Damerau Levenshtein
  4. Jaro Winkler
  5. Smith Waterman Gotoh

My code:

<?php
        echo levenshtein("ЛИЧНА КАРТАlоемптY CARO Пренные ЂУРЂЕВИЋ Hercinian","Михајло Ђурђевић")."<br>";
?>

Output:

enter image description here

All of this is working properly with the English language. however, In my case, I have many different languages[Arabic, Chinese, Russian...etc]. Some letters in these languages are similar to each other.

Example:

  • in Arabic "ت" & "ث"

  • in Chinese "已" & "巳"

  • in Russian "ћ" & "h"

How to deal with these letters multibyte language to get good accuracy?

1 Answers
Related