Class: Aspeller::EditDistanceWeights

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeObject



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

#del1Object

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

#del2Object

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

#maxObject

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

#minObject

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

#similarObject

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

#subObject

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

#swapObject

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

.newObject



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);
}