Skip to content

Commit

Permalink
retrace bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Jemoka committed Apr 20, 2024
1 parent 179555b commit c390b42
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion batchalign/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def _detokenize(self):
self.content[indx+2].text != i.text and
self.content[indx+2].type == TokenType.RETRACE):
result.append("<")
elif self.content[indx+1].type == TokenType.REGULAR:
elif self.content[indx+1].type != TokenType.RETRACE:
if indx > 0 and self.content[indx-1].type == TokenType.RETRACE and self.content[indx-1].text != i.text:
result.append(i.text+">")
result.append("[/]")
Expand Down
4 changes: 2 additions & 2 deletions batchalign/version
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
0.7.1-beta.4
0.7.1-beta.5
Apr 20th, 2024
more alignment bug patches
minor retrace bug fix
12 changes: 8 additions & 4 deletions scratchpad.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@
########### The Batchalign Core Test Harness ###########
# from batchalign.formats.chat.parser import chat_parse_utterance

sue = StanzaUtteranceEngine()
doc = Document.new("john is a chicken and robert is a chicken", lang="eng")
# ng = NgramRetraceEngine()
# disf = DisfluencyReplacementEngine()
# doc = Document.new("um I'm seeing I'm seeing light and dark to create uh uh to create uh to create uh time", lang="eng")
# pipe = BatchalignPipeline(ng, disf)
# tmp = pipe(doc)
# tmp


tmp = sue(doc)
tmp
# tmp[0].content


# import stanza
Expand Down

0 comments on commit c390b42

Please sign in to comment.