0

Possible Duplicate:
detect language from string in PHP

how can i detect the lang of the user input string?

for exemple the string:

בדיקה בלה בלה heb אחד שתיים שלוש

will give the result: hebrew

10x!

Community
  • 1
  • 1
dvdx
  • 121
  • 1
  • 1
  • 4
  • possible duplicate: http://stackoverflow.com/questions/1441562/detect-language-from-string-in-php – MByD Apr 02 '11 at 11:29

1 Answers1

0

The easiest way would be to compare the string with a database of dictionaries, and depending on which dictionary the word is contained within, you can find the language.

However, caveats

  • some words will appear in many languages
  • Getting hold of all dictionaries for all the languages you wish to support may not be easy.
Codemwnci
  • 54,176
  • 10
  • 96
  • 129