File tree Expand file tree Collapse file tree
main/src/main/java/tw/firemaples/onscreenocr/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,14 +16,14 @@ object WordBoundary {
1616 // Skip punctuations and blanks
1717 } else {
1818 if (boundaries.size >= 2 && boundaries.last().word.isDash()) {
19- val sb = StringBuilder (boundaries.removeLast( ).word)
20- val lastWord = boundaries.removeLast( )
19+ val sb = StringBuilder (boundaries.removeAt(boundaries.lastIndex ).word)
20+ val lastWord = boundaries.removeAt(boundaries.lastIndex )
2121 sb.insert(0 , lastWord.word)
2222 sb.append(word)
2323 boundaries.add(Boundary (sb.toString(), lastWord.start, end))
2424 } else {
2525 if (boundaries.isNotEmpty() && boundaries.last().word.isDash()) {
26- boundaries.removeLast( )
26+ boundaries.removeAt(boundaries.lastIndex )
2727 }
2828 if (word.isDash() && previousWord?.isBlank() == true ) {
2929 // Skip dash following blank pattern. " -"
You can’t perform that action at this time.
0 commit comments