]> git.mxchange.org Git - friendica.git/blob - library/langdet/docs/errorhandling.php
updated pear LangDetect to version 1.0.0
[friendica.git] / library / langdet / docs / errorhandling.php
1 <?php
2 /**
3  * How to handle errors
4  */
5 require_once 'Text/LanguageDetect.php';
6 require_once 'Text/LanguageDetect/Exception.php';
7
8 try {
9     $ld = new Text_LanguageDetect();
10     $lang = $ld->detectSimple('Das ist ein kleiner Text');
11     echo "Language is: $lang\n";
12 } catch (Text_LanguageDetect_Exception $e) {
13     echo 'An error occured! Message: ' . $e . "\n";
14 }
15 ?>