From 7f8a8dd56453ef4df6290615a60011355e247287 Mon Sep 17 00:00:00 2001 From: Mike Gerber Date: Wed, 16 Apr 2025 09:10:43 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20for=20changed=20API=20of?= =?UTF-8?q?=20uniseg's=20word=5Fbreak?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.txt | 2 +- src/dinglehopper/word_error_rate.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/requirements.txt b/requirements.txt index 6741fa2..0b3d819 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ click jinja2 lxml -uniseg >= 0.8.0 +uniseg >= 0.9.1 numpy colorama MarkupSafe diff --git a/src/dinglehopper/word_error_rate.py b/src/dinglehopper/word_error_rate.py index 578850f..ec039b3 100644 --- a/src/dinglehopper/word_error_rate.py +++ b/src/dinglehopper/word_error_rate.py @@ -22,11 +22,11 @@ def patch_word_break(): """ old_word_break = uniseg.wordbreak.word_break - def new_word_break(c, index=0): + def new_word_break(c): if 0xE000 <= ord(c) <= 0xF8FF: # Private Use Area - return uniseg.wordbreak.WordBreak.ALETTER + return uniseg.wordbreak.Word_Break.ALetter else: - return old_word_break(c, index) + return old_word_break(c) uniseg.wordbreak.word_break = new_word_break global word_break_patched