From 62727012d37ef3d3cacc413d5667dc2d7bbf9cbb Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 12 May 2012 01:55:18 -0700 Subject: language detection library --- library/langdet/docs/example_clui.php | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 library/langdet/docs/example_clui.php (limited to 'library/langdet/docs/example_clui.php') diff --git a/library/langdet/docs/example_clui.php b/library/langdet/docs/example_clui.php new file mode 100644 index 000000000..8e7d8577d --- /dev/null +++ b/library/langdet/docs/example_clui.php @@ -0,0 +1,35 @@ +getLanguages(); +sort($langs); +echo join(', ', $langs); + +echo "\ntotal ", count($langs), "\n\n"; + +while ($line = fgets($stdin)) { + $result = $l->detect($line, 4); + print_r($result); + $blocks = $l->detectUnicodeBlocks($line, true); + print_r($blocks); +} + +fclose($stdin); +unset($l); + +/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ + +?> -- cgit v1.2.3