aboutsummaryrefslogtreecommitdiffstats
path: root/library/langdet/docs/iso.php
diff options
context:
space:
mode:
authorVasudev Kamath <kamathvasudev@gmail.com>2012-06-04 12:04:17 +0530
committerVasudev Kamath <kamathvasudev@gmail.com>2012-06-04 12:04:17 +0530
commit12474e3c2eb21e4b5f9f6cd4b9d223f1f39bfe89 (patch)
tree49e5e7dd30e1b1263fa5a9c9921b4a59758d94bd /library/langdet/docs/iso.php
parent3a45d4f9e0af301b8fdd4d509fc7ffe7514fb519 (diff)
parentca105f1c669950768a1f4cd6b93f471cabbc5114 (diff)
downloadvolse-hubzilla-12474e3c2eb21e4b5f9f6cd4b9d223f1f39bfe89.tar.gz
volse-hubzilla-12474e3c2eb21e4b5f9f6cd4b9d223f1f39bfe89.tar.bz2
volse-hubzilla-12474e3c2eb21e4b5f9f6cd4b9d223f1f39bfe89.zip
Merge branch 'master' of git://github.com/friendica/friendica
Diffstat (limited to 'library/langdet/docs/iso.php')
-rw-r--r--library/langdet/docs/iso.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/library/langdet/docs/iso.php b/library/langdet/docs/iso.php
new file mode 100644
index 000000000..6d7ec1d2e
--- /dev/null
+++ b/library/langdet/docs/iso.php
@@ -0,0 +1,21 @@
+<?php
+/**
+ * Demonstrates how to use ISO language codes.
+ *
+ * The "name mode" changes the way languages are accepted and returned.
+ */
+require_once 'Text/LanguageDetect.php';
+$l = new Text_LanguageDetect();
+
+
+//will output the ISO 639-1 two-letter language code
+// "de"
+$l->setNameMode(2);
+echo $l->detectSimple('Das ist ein kleiner Text') . "\n";
+
+//will output the ISO 639-2 three-letter language code
+// "deu"
+$l->setNameMode(3);
+echo $l->detectSimple('Das ist ein kleiner Text') . "\n";
+
+?> \ No newline at end of file