Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yokurang committed Aug 15, 2024
1 parent f48a9cd commit b5068e3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/WordDiff.ml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
type word = Unchanged of string | Changed of string
type line_content = word list

let string_to_word_array s = s |> String.split_on_char ' ' |> Array.of_list
let string_to_words s = Array.of_list (String.split_on_char ' ' s)
let longest xs ys = if List.length xs > List.length ys then xs else ys

Expand Down Expand Up @@ -86,8 +85,8 @@ let pair_lines lines1 lines2 =
for j = 0 to Array.length lines2 - 1 do
distances.(i).(j) <-
edit_distance ( = )
(string_to_word_array lines1.(i))
(string_to_word_array lines2.(j))
(string_to_words lines1.(i))
(string_to_words lines2.(j))
done
done;

Expand Down

0 comments on commit b5068e3

Please sign in to comment.