Sha256: 7fd51407e26a5f88313657e6df3346d973b5941d5643b33847ec13d0d98e0fb7
Contents?: true
Size: 539 Bytes
Versions: 6
Compression:
Stored size: 539 Bytes
Contents
#!/usr/bin/env ruby # Usage: merge_mazegaki_dic /path/to/mazegaki.dic /path/to/skkdic/SKK-JISYO.* > ~/.textbringer/tcode/mazegaki.dic MAZEGAKI_DIC = Hash.new([]) ARGF.each_line do |line| next if /^\p{ascii}/.match?(line) x, y = line.split key = x.sub(/\A(\p{hiragana}+)[a-z>]\z/, "\\1—") values = y.split("/").map { |i| i.sub(/;.*/, "") }.reject { |i| i.empty? || i == key } MAZEGAKI_DIC[key] |= values end MAZEGAKI_DIC.sort_by { |key,| key }.each do |key, values| puts "#{key} /#{values.join('/')}/" end
Version data entries
6 entries across 6 versions & 1 rubygems