1
0
mirror of https://github.com/ilri/csv-metadata-quality.git synced 2024-12-22 04:02:19 +01:00

csv_metadata_quality/util.py: update for ftfy 6.0

The sequence_weirdness() heuristic is deprecated. Now we should use
is_bad().

See: https://ftfy.readthedocs.io/en/v6.0/heuristic.html
See: https://github.com/rspeer/python-ftfy/blob/master/CHANGELOG.md#version-60-april-2-2021
This commit is contained in:
Alan Orth 2021-12-15 21:58:07 +02:00
parent ff49a80432
commit e4faf114dc
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

View File

@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-3.0-only
from ftfy.badness import sequence_weirdness
from ftfy.badness import is_bad
def is_nfc(field):
@ -38,7 +38,7 @@ def is_mojibake(field):
Return boolean.
"""
if not sequence_weirdness(field):
if not is_bad(field):
# Nothing weird, should be okay
return False
try: