Class: Aspeller::EditDistanceWeights
- Inherits:
-
Object
- Object
- Aspeller::EditDistanceWeights
- Defined in:
- lib/aspell_edit_dist_stub.rb,
ext/aspell_edit_dist.cpp
Overview
weights that are used by Aspell to determine edit distance between two strings
Instance Attribute Summary collapse
-
#del1 ⇒ Object
the cost of deleting a char in the first string, defaults to 1.
-
#del2 ⇒ Object
the cost of inserting a character or deleting a char in the next string, defaults to 1.
-
#max ⇒ Object
the max of del1, del2, swap and sub, defaults to 1.
-
#min ⇒ Object
the min of del1, del2, swap and sub, defaults to 1.
-
#similar ⇒ Object
the cost of a “similar” but not exact match for two characters, defaults to 0.
-
#sub ⇒ Object
the cost of replacing one letter with another, defaults to 1.
-
#swap ⇒ Object
the cost of swapping two adjacent letters, defaults to 1.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize ⇒ Object constructor
Constructor Details
#initialize ⇒ Object
26 27 28 29 |
# File 'ext/aspell_edit_dist.cpp', line 26
static VALUE weights_init(VALUE self) {
aspeller::EditDistanceWeights * new_obj = new aspeller::EditDistanceWeights();
return Data_Wrap_Struct(cEditDistanceWeights, 0, weights_free, new_obj);
}
|
Instance Attribute Details
#del1 ⇒ Object
the cost of deleting a char in the first string, defaults to 1
10 11 12 |
# File 'lib/aspell_edit_dist_stub.rb', line 10 def del1 @del1 end |
#del2 ⇒ Object
the cost of inserting a character or deleting a char in the next string, defaults to 1
13 14 15 |
# File 'lib/aspell_edit_dist_stub.rb', line 13 def del2 @del2 end |
#max ⇒ Object
the max of del1, del2, swap and sub, defaults to 1
28 29 30 |
# File 'lib/aspell_edit_dist_stub.rb', line 28 def max @max end |
#min ⇒ Object
the min of del1, del2, swap and sub, defaults to 1
25 26 27 |
# File 'lib/aspell_edit_dist_stub.rb', line 25 def min @min end |
#similar ⇒ Object
the cost of a “similar” but not exact match for two characters, defaults to 0
22 23 24 |
# File 'lib/aspell_edit_dist_stub.rb', line 22 def similar @similar end |
#sub ⇒ Object
the cost of replacing one letter with another, defaults to 1
19 20 21 |
# File 'lib/aspell_edit_dist_stub.rb', line 19 def sub @sub end |
#swap ⇒ Object
the cost of swapping two adjacent letters, defaults to 1
16 17 18 |
# File 'lib/aspell_edit_dist_stub.rb', line 16 def swap @swap end |
Class Method Details
.new ⇒ Object
26 27 28 29 |
# File 'ext/aspell_edit_dist.cpp', line 26
static VALUE weights_init(VALUE self) {
aspeller::EditDistanceWeights * new_obj = new aspeller::EditDistanceWeights();
return Data_Wrap_Struct(cEditDistanceWeights, 0, weights_free, new_obj);
}
|