Skip to content

Commit a09a624

Browse files
authored
Merge pull request #132 from qurator-spk/fix/uniseg-removed-index-parameter
🐛 Fix for changed API of uniseg's word_break
2 parents b72d4f5 + badfa9c commit a09a624

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
strategy:
2626
fail-fast: false
2727
matrix:
28-
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ]
28+
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
2929

3030
runs-on: "ubuntu-latest"
3131

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
click
22
jinja2
33
lxml
4-
uniseg >= 0.8.0
4+
uniseg >= 0.9.1
55
numpy
66
colorama
77
MarkupSafe

src/dinglehopper/word_error_rate.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ def patch_word_break():
2222
"""
2323
old_word_break = uniseg.wordbreak.word_break
2424

25-
def new_word_break(c, index=0):
25+
def new_word_break(c):
2626
if 0xE000 <= ord(c) <= 0xF8FF: # Private Use Area
27-
return uniseg.wordbreak.WordBreak.ALETTER
27+
return uniseg.wordbreak.Word_Break.ALetter
2828
else:
29-
return old_word_break(c, index)
29+
return old_word_break(c)
3030

3131
uniseg.wordbreak.word_break = new_word_break
3232
global word_break_patched

0 commit comments

Comments
 (0)