mirror of
https://github.com/qurator-spk/dinglehopper.git
synced 2025-06-08 19:30:01 +02:00
🐛 Fix for changed API of uniseg's word_break
This commit is contained in:
parent
b72d4f5af9
commit
7f8a8dd564
2 changed files with 4 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
||||||
click
|
click
|
||||||
jinja2
|
jinja2
|
||||||
lxml
|
lxml
|
||||||
uniseg >= 0.8.0
|
uniseg >= 0.9.1
|
||||||
numpy
|
numpy
|
||||||
colorama
|
colorama
|
||||||
MarkupSafe
|
MarkupSafe
|
||||||
|
|
|
@ -22,11 +22,11 @@ def patch_word_break():
|
||||||
"""
|
"""
|
||||||
old_word_break = uniseg.wordbreak.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
|
if 0xE000 <= ord(c) <= 0xF8FF: # Private Use Area
|
||||||
return uniseg.wordbreak.WordBreak.ALETTER
|
return uniseg.wordbreak.Word_Break.ALetter
|
||||||
else:
|
else:
|
||||||
return old_word_break(c, index)
|
return old_word_break(c)
|
||||||
|
|
||||||
uniseg.wordbreak.word_break = new_word_break
|
uniseg.wordbreak.word_break = new_word_break
|
||||||
global word_break_patched
|
global word_break_patched
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue