Skip to content

Commit

Permalink
#421: Get rid of puncutation oddities
Browse files Browse the repository at this point in the history
  • Loading branch information
berndmoos committed Apr 18, 2024
1 parent 907cf76 commit a7da5d0
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ public void run() {
}

public void whisperSuccess(String result, int editRow, int editCol, double startTime, double endTime) throws IOException, JexmaraldaException{
result = postProcessWhisperResult(result);
if ((editRow>=0) && (editCol>=0)){
partitur.getModel().setTableDataItem(result, editRow, editCol);
} else {
Expand Down Expand Up @@ -245,6 +246,16 @@ public void whisperSuccess(String result, int editRow, int editCol, double start
}
whisperASRAction.setEnabled(true);
}

private String postProcessWhisperResult(String result) {
// ": "We're really good friends on top of everything."
if (result.startsWith("\": \"") && result.trim().endsWith("\"")){
String better = result.substring(4);
better = better.substring(0, better.lastIndexOf("\""));
return better;
}
return result;
}



Expand Down

0 comments on commit a7da5d0

Please sign in to comment.