summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Simianer <patrick@lilt.com>2020-02-03 15:25:12 +0000
committerPatrick Simianer <patrick@lilt.com>2020-02-03 15:25:12 +0000
commit0ff116339aff9b421e4ca5d4680b3981530d9b99 (patch)
tree090a75bcb3226229da9b2d85fae1033ffe9b037b
parent4bcee680245bb606c2ce06a304d78c1ac4c83134 (diff)
zh-ko-or-ja
-rwxr-xr-xzh-ko-or-ja18
1 files changed, 18 insertions, 0 deletions
diff --git a/zh-ko-or-ja b/zh-ko-or-ja
new file mode 100755
index 0000000..0b42386
--- /dev/null
+++ b/zh-ko-or-ja
@@ -0,0 +1,18 @@
+#!/usr/bin/env ruby
+
+require 'zipf'
+require 'script_detector'
+
+$to_code = {}
+$to_code["Ambiguous Chinese"] = "??"
+$to_code["Simplified Chinese"] = "zh"
+$to_code["Traditional Chinese"] = "zt"
+$to_code["Korean"] = "ko"
+$to_code["Japanese"] = "ja"
+$to_code.default = "??"
+
+while line = STDIN.gets
+ code = $to_code[line.identify_script]
+ puts code
+end
+