Class: FamilyReunion
- Inherits:
-
Object
- Object
- FamilyReunion
- Defined in:
- lib/family-reunion.rb,
lib/family-reunion/cache.rb,
lib/family-reunion/top_node.rb,
lib/family-reunion/exact_matcher.rb,
lib/family-reunion/fuzzy_matcher.rb,
lib/family-reunion/matcher_helper.rb,
lib/family-reunion/nomatch_organizer.rb,
lib/family-reunion/taxamatch_wrapper.rb,
lib/family-reunion/taxamatch_preprocessor.rb
Defined Under Namespace
Modules: MatcherHelper Classes: Cache, ExactMatcher, FuzzyMatcher, NomatchOrganizer, TaxamatchPreprocessor, TaxamatchWrapper, TopNode
Constant Summary collapse
- VERSION =
open(File.join(File.dirname(__FILE__), '..', 'VERSION')).readline.strip
Instance Attribute Summary collapse
-
#merges ⇒ Object
readonly
Returns the value of attribute merges.
-
#primary_node ⇒ Object
readonly
Returns the value of attribute primary_node.
-
#primary_synonyms_set ⇒ Object
readonly
Returns the value of attribute primary_synonyms_set.
-
#primary_valid_names_set ⇒ Object
readonly
Returns the value of attribute primary_valid_names_set.
-
#secondary_node ⇒ Object
readonly
Returns the value of attribute secondary_node.
Class Method Summary collapse
- .logger ⇒ Object
- .logger=(logger) ⇒ Object
- .logger_reset ⇒ Object
- .logger_write(obj_id, message, method = :info) ⇒ Object
Instance Method Summary collapse
-
#initialize(primary_node, secondary_node) ⇒ FamilyReunion
constructor
A new instance of FamilyReunion.
- #merge ⇒ Object
Constructor Details
#initialize(primary_node, secondary_node) ⇒ FamilyReunion
Returns a new instance of FamilyReunion.
37 38 39 40 41 42 43 44 45 |
# 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 |
Instance Attribute Details
#merges ⇒ Object (readonly)
Returns the value of attribute merges.
15 16 17 |
# File 'lib/family-reunion.rb', line 15 def merges @merges end |
#primary_node ⇒ Object (readonly)
Returns the value of attribute primary_node.
15 16 17 |
# File 'lib/family-reunion.rb', line 15 def primary_node @primary_node end |
#primary_synonyms_set ⇒ Object (readonly)
Returns the value of attribute primary_synonyms_set.
17 18 19 |
# File 'lib/family-reunion.rb', line 17 def primary_synonyms_set @primary_synonyms_set end |
#primary_valid_names_set ⇒ Object (readonly)
Returns the value of attribute primary_valid_names_set.
16 17 18 |
# File 'lib/family-reunion.rb', line 16 def primary_valid_names_set @primary_valid_names_set end |
#secondary_node ⇒ Object (readonly)
Returns the value of attribute secondary_node.
15 16 17 |
# File 'lib/family-reunion.rb', line 15 def secondary_node @secondary_node end |
Class Method Details
.logger ⇒ Object
21 22 23 |
# File 'lib/family-reunion.rb', line 21 def self.logger @@logger ||= Logger.new(nil) end |
.logger=(logger) ⇒ Object
25 26 27 |
# File 'lib/family-reunion.rb', line 25 def self.logger=(logger) @@logger = logger end |
.logger_reset ⇒ Object
29 30 31 |
# File 'lib/family-reunion.rb', line 29 def self.logger_reset self.logger = Logger.new(nil) end |
.logger_write(obj_id, message, method = :info) ⇒ Object
33 34 35 |
# File 'lib/family-reunion.rb', line 33 def self.logger_write(obj_id, , method = :info) self.logger.send(method, "|%s|%s|" % [obj_id, ]) end |
Instance Method Details
#merge ⇒ Object
47 48 49 50 51 52 53 54 55 56 |
# 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 |