Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- def parse(f)
- buffer = ""
- open(f) { |file| file.seek 0x404;file.each_byte {|c| buffer << (0xff - c).chr} }
- rindex = buffer.rindex(/<\/word>/) + "</word>".size
- open(f.sub(".ydic", ".xml"), "w+").write(buffer[0...rindex].gsub("</word>", "</word>\n"))
- end
- (puts "Usage: #{File.basename $0} dict_file_1 [...]";exit 1) if ARGV.size < 1
- ARGV.each { |f| parse f }
Add Comment
Please, Sign In to add comment