Skip to content

Commit

Permalink
Fix Hirschberg recursion call
Browse files Browse the repository at this point in the history
  • Loading branch information
nictru committed Jul 17, 2023
1 parent ec1fc3c commit b305a27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/alignment/general_alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ def __align_hirschberg__(self, s: str, t: str):
end_index = min_index+1
alignment1 = self.__backtracking__(D1[:,:end_index], B1[:,:end_index], s1, t1[:end_index])
else:
alignment1 = self.__align__(s[:delim], t[:min_index])
alignment1 = self.__align_hirschberg__(s[:delim], t[:min_index])

if len(s2) == 1:
end_index = len(t2)-min_index+1
alignment2 = self.__backtracking__(D2[:,:end_index], B2[:,:end_index], s2, t2[:end_index])
alignment2 = alignment2[0][::-1], alignment2[1][::-1]
else:
alignment2 = self.__align__(s[delim:], t[min_index:])
alignment2 = self.__align_hirschberg__(s[delim:], t[min_index:])

alignment = alignment1[0] + alignment2[0], alignment1[1] + alignment2[1]

Expand Down

0 comments on commit b305a27

Please sign in to comment.