Skip to content

Instantly share code, notes, and snippets.

@holysugar
Created November 13, 2014 04:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save holysugar/e5917f8653b0fab491f4 to your computer and use it in GitHub Desktop.
Save holysugar/e5917f8653b0fab491f4 to your computer and use it in GitHub Desktop.
2文字の漢字リスト生成(メモ)
File.open("x.txt",'w'){|f| f.puts File.read("SKK-JISYO.L", external_encoding: Encoding::EUC_JP).encode(Encoding::UTF_8).split(/\n+/).map{|x| x.scan(%r!/(\p{Han}{2})(?=[;/])!).flatten.first if x !~ /[a-z]/ }.compact.flatten.sort.uniq }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment