summaryrefslogtreecommitdiff
path: root/zh-ko-or-ja
diff options
context:
space:
mode:
Diffstat (limited to '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
+