Class: FuzzyStringMatch::JaroWinkler

Inherits:
Object
  • Object
show all
Defined in:
lib/fuzzystringmatch.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.create(type = :pure) ⇒ Object

factory method



30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/fuzzystringmatch.rb', line 30

def self.create( type = :pure )     # factory method
  case type
  when :pure
    FuzzyStringMatch::JaroWinklerPure.new
  when :native
    begin
      FuzzyStringMatch::JaroWinklerInline.new
    rescue NameError
      STDERR.puts "fuzzy-string-match Warning: native version is disabled. falled back to pure ruby version..."
      FuzzyStringMatch::JaroWinklerPure.new
    end
  end
end

Instance Method Details

#create(type = :pure) ⇒ Object

this is obsolute



43
44
45
46
# File 'lib/fuzzystringmatch.rb', line 43

def create( type = :pure )         # this is obsolute
  STDERR.puts "fuzzy-string-match Warning: FuzzyStringMatch.new.create() is obsolute, please use FuzzyStringMatch.create() ..."
  FuzzyStringMatch::JaroWinkler.create( type )
end