lib/inferno/terminology/loader.rb
# Saves the valueset bloomfilter to a msgpack file
#
# @param [String] filename the name of the file
Saves the valueset bloomfilter to a msgpack file
Saves the valueset bloomfilter to a msgpack file
def save_bloom_to_file(codings, filename)
          bloom_filter =
            if File.file? filename
              Bloomer::Scalable.from_msgpack(File.read(filename))
            else
              Bloomer::Scalable.create_with_sufficient_size(codings.length)
            end
          codings.each do |coding|
            bloom_filter.add_without_duplication("#{coding[:system]}|#{coding[:code]}")
          end
          bloom_file = File.new(filename, 'wb')
          bloom_file.write(bloom_filter.to_msgpack) unless bloom_filter.nil?
          bloom_filter.count
        end
def save_bloom_to_file ( codings , filename ) bloom_filter = if File . file? filename Bloomer :: Scalable . from_msgpack ( File . read ( filename ) ) else Bloomer :: Scalable . create_with_sufficient_size ( codings . length ) end codings . each do | coding | bloom_filter . add_without_duplication ( "#{coding[:system]}|#{coding[:code]}" ) end bloom_file = File . new ( filename , 'wb' ) bloom_file . write ( bloom_filter . to_msgpack ) unless bloom_filter . nil? bloom_filter . count end
Saves the valueset bloomfilter to a msgpack file
Saves the valueset bloomfilter to a msgpack file
# If the file already exists, load it in
codings
<not_specific>
filename
<not_specific>
<not_specific>
filename the name of the file
filename the name of the file