#!/usr/bin/env ruby
#
# 2009/7/7 to read morphosyntactic_rozbieznosc from log file

msrs = { :segmentation => [], :sentences => [], :morphosyntactic => [] }

msrs.each_key { |poz|
  File.open( "log/nk8003.log" ) { |f|
    f.each { |li|
      if li =~ /:#{poz}=>\[((\d+,* *)+)\]/
          $1.split(',').collect { |tid| msrs[ poz ] << tid.to_i }
      end
    }
  }
  msrs[ poz ] |= [] # bo uniq! niluje tablicę
  msrs[ poz ].sort!
}

puts msrs.inspect





### Local Variables:
### coding: utf-8
### mode: ruby
### End:
