lib/rbbt/association/item.rb in rbbt-util-5.14.9 vs lib/rbbt/association/item.rb in rbbt-util-5.14.10

- old
+ new

@@ -59,9 +59,19 @@ value.collect{|v| Hash[*fields.zip(v).flatten] } end + property :tsv => :array do + fields = self.info_fields + type = [self.source_type, self.target_type] * "~" + tsv = TSV.setup({}, :key_field => type, :fields => fields, :type => :list, :namespace => self.namespace) + self.each do |match| + tsv[match] = match.info.values_at *fields + end + tsv + end + def self.incidence(pairs, key_field = nil) matrix = {} targets = [] sources = [] matches = {}