Class: TextAlignment::GLCSTextAlignment

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(str1, str2, mappings = [], lcs = nil, sdiff = nil) ⇒ GLCSTextAlignment

Returns a new instance of GLCSTextAlignment.

Raises:

  • (ArgumentError)


20
21
22
23
24
25
# File 'lib/text_alignment/glcs_alignment_fast.rb', line 20

def initialize(str1, str2, mappings = [], lcs = nil, sdiff = nil)
  raise ArgumentError, "nil string" if str1.nil? || str2.nil?
  raise ArgumentError, "nil mappings" if mappings.nil?

  _glcs_alignment_fast(str1, str2, mapptings, lcs, sdiff)
end

Instance Attribute Details

#common_elementsObject (readonly)

Returns the value of attribute common_elements.



16
17
18
# File 'lib/text_alignment/glcs_alignment_fast.rb', line 16

def common_elements
  @common_elements
end

#mapped_elementsObject (readonly)

Returns the value of attribute mapped_elements.



16
17
18
# File 'lib/text_alignment/glcs_alignment_fast.rb', line 16

def mapped_elements
  @mapped_elements
end

#position_map_beginObject (readonly)

Returns the value of attribute position_map_begin.



15
16
17
# File 'lib/text_alignment/glcs_alignment_fast.rb', line 15

def position_map_begin
  @position_map_begin
end

#position_map_endObject (readonly)

Returns the value of attribute position_map_end.



15
16
17
# File 'lib/text_alignment/glcs_alignment_fast.rb', line 15

def position_map_end
  @position_map_end
end

#similarityObject (readonly)

Returns the value of attribute similarity.



17
18
19
# File 'lib/text_alignment/glcs_alignment_fast.rb', line 17

def similarity
  @similarity
end

#str1_match_finalObject (readonly)

Returns the value of attribute str1_match_final.



18
19
20
# File 'lib/text_alignment/glcs_alignment_fast.rb', line 18

def str1_match_final
  @str1_match_final
end

#str1_match_initialObject (readonly)

Returns the value of attribute str1_match_initial.



18
19
20
# File 'lib/text_alignment/glcs_alignment_fast.rb', line 18

def str1_match_initial
  @str1_match_initial
end

#str2_match_finalObject (readonly)

Returns the value of attribute str2_match_final.



18
19
20
# File 'lib/text_alignment/glcs_alignment_fast.rb', line 18

def str2_match_final
  @str2_match_final
end

#str2_match_initialObject (readonly)

Returns the value of attribute str2_match_initial.



18
19
20
# File 'lib/text_alignment/glcs_alignment_fast.rb', line 18

def str2_match_initial
  @str2_match_initial
end