Revert "Update languagedetect library"
This commit is contained in:
parent
c22920edba
commit
071946fa78
101 changed files with 3632 additions and 311 deletions
18
library/langdet/docs/confidence.php
Normal file
18
library/langdet/docs/confidence.php
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
require_once 'Text/LanguageDetect.php';
|
||||
|
||||
$text = 'Was wäre, wenn ich Ihnen das jetzt sagen würde?';
|
||||
|
||||
$ld = new Text_LanguageDetect();
|
||||
//3 most probable languages
|
||||
$results = $ld->detect($text, 3);
|
||||
|
||||
foreach ($results as $language => $confidence) {
|
||||
echo $language . ': ' . number_format($confidence, 2) . "\n";
|
||||
}
|
||||
|
||||
//output:
|
||||
//german: 0.35
|
||||
//dutch: 0.25
|
||||
//swedish: 0.20
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue