Method: TextAlignment.cdiff

Defined in:
lib/text_alignment/lcs_cdiff.rb

.cdiff(str1, str2) ⇒ Object

Raises:

  • (ArgumentError)


10
11
12
13
14
# File 'lib/text_alignment/lcs_cdiff.rb', line 10

def cdiff(str1, str2)
	raise ArgumentError, "nil string" if str1.nil? || str2.nil?
	raise "a nil character appears in the input string" if str1.index(TextAlignment::NIL_CHARACTER) || str2.index(TextAlignment::NIL_CHARACTER)
	sdiff2cdiff(Diff::LCS.sdiff(str1, str2))
end