From 0ff116339aff9b421e4ca5d4680b3981530d9b99 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Mon, 3 Feb 2020 15:25:12 +0000 Subject: zh-ko-or-ja --- zh-ko-or-ja | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 zh-ko-or-ja 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 + -- cgit v1.2.3