Matthew Franglen commited on
Commit
4104e84
1 Parent(s): 3ae464f

Casefold before calculating indices

Browse files

Complete case difference for a opinion/aspect term broke a row

Files changed (1) hide show
  1. src/alignment.py +3 -0
src/alignment.py CHANGED
@@ -122,6 +122,9 @@ def _is_sequential(span: tuple[int, ...]) -> bool:
122
 
123
 
124
  def _aligned_character_indices(original: str, replacement: str) -> list[Optional[int]]:
 
 
 
125
  indices: list[Optional[int]] = list(range(len(original)))
126
  for operation, _source_position, destination_position in Levenshtein.editops(
127
  original, replacement
 
122
 
123
 
124
  def _aligned_character_indices(original: str, replacement: str) -> list[Optional[int]]:
125
+ original = original.casefold()
126
+ replacement = replacement.casefold()
127
+
128
  indices: list[Optional[int]] = list(range(len(original)))
129
  for operation, _source_position, destination_position in Levenshtein.editops(
130
  original, replacement