summaryrefslogtreecommitdiff
path: root/zh-ko-or-ja
blob: 0b42386df9e015c47af66ddfa6ea60cfb5b2c216 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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