Class: TRE::AParams
- Inherits:
-
Object
- Object
- TRE::AParams
- Defined in:
- lib/tre-ruby.rb
Overview
Parameters for approximate matching.
Instance Attribute Summary collapse
-
#cost_del ⇒ Object
Default cost of a deleted character.
-
#cost_ins ⇒ Object
Default cost of an inserted character.
-
#cost_subst ⇒ Object
Default cost of a substituted character.
-
#max_cost ⇒ Object
Maximum allowed cost of a match.
-
#max_del ⇒ Object
Maximum allowed number of deletes.
-
#max_err ⇒ Object
Maximum allowed number of errors total.
-
#max_ins ⇒ Object
Maximum allowed number of inserts.
-
#max_subst ⇒ Object
Maximum allowed number of substitutes.
Instance Method Summary collapse
-
#initialize {|_self| ... } ⇒ AParams
constructor
Creates a AParams object with default values.
Constructor Details
#initialize {|_self| ... } ⇒ AParams
Creates a AParams object with default values
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_del ⇒ Object
Default cost of a deleted character.
113 114 115 |
# File 'lib/tre-ruby.rb', line 113 def cost_del @cost_del end |
#cost_ins ⇒ Object
Default cost of an inserted character.
111 112 113 |
# File 'lib/tre-ruby.rb', line 111 def cost_ins @cost_ins end |
#cost_subst ⇒ Object
Default cost of a substituted character.
115 116 117 |
# File 'lib/tre-ruby.rb', line 115 def cost_subst @cost_subst end |
#max_cost ⇒ Object
Maximum allowed cost of a match.
118 119 120 |
# File 'lib/tre-ruby.rb', line 118 def max_cost @max_cost end |
#max_del ⇒ Object
Maximum allowed number of deletes.
122 123 124 |
# File 'lib/tre-ruby.rb', line 122 def max_del @max_del end |
#max_err ⇒ Object
Maximum allowed number of errors total.
126 127 128 |
# File 'lib/tre-ruby.rb', line 126 def max_err @max_err end |
#max_ins ⇒ Object
Maximum allowed number of inserts.
120 121 122 |
# File 'lib/tre-ruby.rb', line 120 def max_ins @max_ins end |
#max_subst ⇒ Object
Maximum allowed number of substitutes.
124 125 126 |
# File 'lib/tre-ruby.rb', line 124 def max_subst @max_subst end |