Skip to content

Instantly share code, notes, and snippets.

@sdomermpc
Forked from tmaeda/extract_idm_file.rb
Created February 8, 2014 08:17
Show Gist options
  • Save sdomermpc/8878453 to your computer and use it in GitHub Desktop.
Save sdomermpc/8878453 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'zlib'
require 'rexml/document'
File.open("CONTENT.tda") do |zipped_f|
File.open("CONTENT.tda.tdz", "r") do |index_f|
while record = index_f.read(8)
size = record.unpack("V*")[1]
puts size
z_content = zipped_f.read(size)
content = Zlib::Inflate.inflate(z_content)
puts "########################################"
content.split(/\0+/).each do |chunk|
begin
doc = REXML::Document.new chunk
doc.write(STDOUT, 2)
rescue
puts chunk
end
end
end
end
end
topic_maps.skn: なんかバイナリが入ってるな
fs.skn: 辞書内容っぽい
topic.skn: よくわからん。テキストなんだけど、fs.sknに比べると情報が少ない気がする。
extras.skn: なんか.psのような.pdfのようなデータが入ってる
help.skn: 名前の通りヘルプっぽい
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment