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)


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

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.



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

def common_elements
  @common_elements
end

#mapped_elementsObject (readonly)

Returns the value of attribute mapped_elements.



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

def mapped_elements
  @mapped_elements
end

#position_map_beginObject (readonly)

Returns the value of attribute position_map_begin.



13
14
15
# File 'lib/text_alignment/glcs_alignment_fast.rb', line 13

def position_map_begin
  @position_map_begin
end

#position_map_endObject (readonly)

Returns the value of attribute position_map_end.



13
14
15
# File 'lib/text_alignment/glcs_alignment_fast.rb', line 13

def position_map_end
  @position_map_end
end

#similarityObject (readonly)

Returns the value of attribute similarity.



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

def similarity
  @similarity
end

#str1_match_finalObject (readonly)

Returns the value of attribute str1_match_final.



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

def str1_match_final
  @str1_match_final
end

#str1_match_initialObject (readonly)

Returns the value of attribute str1_match_initial.



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

def str1_match_initial
  @str1_match_initial
end

#str2_match_finalObject (readonly)

Returns the value of attribute str2_match_final.



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

def str2_match_final
  @str2_match_final
end

#str2_match_initialObject (readonly)

Returns the value of attribute str2_match_initial.



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

def str2_match_initial
  @str2_match_initial
end