Class: TRE::AParams

Inherits:
Object
  • Object
show all
Defined in:
lib/tre-ruby.rb

Overview

Parameters for approximate matching.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ AParams

Creates a AParams object with default values

Yields:

  • (_self)

Yield Parameters:

  • _self (TRE::AParams)

    the object that the method was called on



129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/tre-ruby.rb', line 129

def initialize
	self.cost_ins = 1
	self.cost_del = 1
	self.cost_subst = 1
	self.max_cost = nil
	self.max_ins = nil
	self.max_del = nil
	self.max_del = nil
	self.max_subst = nil
	self.max_err = 0

	yield self if block_given?
end

Instance Attribute Details

#cost_delObject

Default cost of a deleted character.



113
114
115
# File 'lib/tre-ruby.rb', line 113

def cost_del
  @cost_del
end

#cost_insObject

Default cost of an inserted character.



111
112
113
# File 'lib/tre-ruby.rb', line 111

def cost_ins
  @cost_ins
end

#cost_substObject

Default cost of a substituted character.



115
116
117
# File 'lib/tre-ruby.rb', line 115

def cost_subst
  @cost_subst
end

#max_costObject

Maximum allowed cost of a match.



118
119
120
# File 'lib/tre-ruby.rb', line 118

def max_cost
  @max_cost
end

#max_delObject

Maximum allowed number of deletes.



122
123
124
# File 'lib/tre-ruby.rb', line 122

def max_del
  @max_del
end

#max_errObject

Maximum allowed number of errors total.



126
127
128
# File 'lib/tre-ruby.rb', line 126

def max_err
  @max_err
end

#max_insObject

Maximum allowed number of inserts.



120
121
122
# File 'lib/tre-ruby.rb', line 120

def max_ins
  @max_ins
end

#max_substObject

Maximum allowed number of substitutes.



124
125
126
# File 'lib/tre-ruby.rb', line 124

def max_subst
  @max_subst
end