Permalink
Browse files

Give LTD's a #find alias for the #left_to_right method. Also, re-enab…

…le tests.
  • Loading branch information...
rossmeissl committed Mar 1, 2011
1 parent 8483630 commit bdbd07fa615a72b670bda81e13066e6e61a2bfe8
Showing with 175 additions and 183 deletions.
  1. +2 −6 README.rdoc
  2. +1 −0 lib/loose_tight_dictionary.rb
  3. +172 −177 test/test_loose_tight_dictionary.rb
View
@@ -4,13 +4,9 @@ Match things based on string similarity (using the Pair Distance algorithm) and
= Quickstart
- >> right_records = [ 'seamus', 'andy', 'ben' ]
+ >> d = LooseTightDictionary.new %w(seamus andy ben)
=> [...]
- >> left_record = 'Shamus Heaney'
- => [...]
- >> d = LooseTightDictionary.new right_records
- => [...]
- >> puts d.left_to_right left_record
+ >> puts d.find 'Shamus Heaney'
=> 'seamus'
Try running the included example file:
@@ -218,6 +218,7 @@ def left_to_right(left_record)
inline_check left_record, right_record
right_record
end
+ alias_method :find, :left_to_right
def optimize(t_options_left, t_options_right)
cart_prod(t_options_left, t_options_right).max do |a, b|
Oops, something went wrong.

0 comments on commit bdbd07f

Please sign in to comment.