class FamilyReunion
Constants
- VERSION
Attributes
primary_node[RW]
primary_synonyms_set[RW]
primary_valid_names_set[RW]
Public Class Methods
logger()
click to toggle source
# File lib/family-reunion.rb, line 21 def self.logger @@logger ||= Logger.new(nil) end
logger=(logger)
click to toggle source
# File lib/family-reunion.rb, line 25 def self.logger=(logger) @@logger = logger end
logger_reset()
click to toggle source
# File lib/family-reunion.rb, line 29 def self.logger_reset self.logger = Logger.new(nil) end
logger_write(obj_id, message, method = :info)
click to toggle source
# File lib/family-reunion.rb, line 33 def self.logger_write(obj_id, message, method = :info) self.logger.send(method, "|%s|%s|" % [obj_id, message]) end
new(primary_node, secondary_node)
click to toggle source
# File lib/family-reunion.rb, line 37 def initialize(primary_node, secondary_node) @primary_node = FamilyReunion::TopNode.new(primary_node) @secondary_node = FamilyReunion::TopNode.new(secondary_node) @primary_valid_names_set = Set.new(@primary_node.valid_names_hash.keys) @secondary_valid_names_set = Set.new(@secondary_node.valid_names_hash.keys) @primary_synonyms_set = Set.new(@primary_node.synonyms_hash.keys) @secondary_synonyms_set = Set.new(@secondary_node.synonyms_hash.keys) @merges = nil end
Public Instance Methods
merge()
click to toggle source
# File lib/family-reunion.rb, line 47 def merge unless @merges @merges = {} merge_exact_matches merge_fuzzy_matches merge_no_matches FamilyReunion.logger_write(self.object_id, "Merging is complete") end @merges end
Private Instance Methods
merge_exact_matches()
click to toggle source
# File lib/family-reunion.rb, line 60 def merge_exact_matches FamilyReunion.logger_write(self.object_id, "Started merging of exact matches") ExactMatcher.new(self).merge end
merge_fuzzy_matches()
click to toggle source
# File lib/family-reunion.rb, line 65 def merge_fuzzy_matches FamilyReunion.logger_write(self.object_id, "Started merging of fuzzy matches") FuzzyMatcher.new(self).merge end
merge_no_matches()
click to toggle source
# File lib/family-reunion.rb, line 70 def merge_no_matches FamilyReunion.logger_write(self.object_id, "Started gap filling, adding new species and uninomials") NomatchOrganizer.new(self).merge end