mirror of
https://gitlab.freedesktop.org/uchardet/uchardet.git
synced 2026-10-28 18:07:22 +08:00
BuildLangModel: allow the alphabet list to be written in string format.
This commit is contained in:
parent
6b2722885a
commit
055332ac7d
@ -128,6 +128,8 @@ def local_lowercase(text, lang):
|
||||
return lowercased
|
||||
|
||||
if lang.alphabet is not None:
|
||||
# Allowing to provide an alphabet in string format rather than list.
|
||||
lang.alphabet = list(lang.alphabet)
|
||||
if lang.use_ascii:
|
||||
lang.alphabet += [chr(l) for l in range(65, 91)] + [chr(l) for l in range(97, 123)]
|
||||
if lang.case_mapping or lang.custom_case_mapping is not None:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user