summaryrefslogtreecommitdiffstats
path: root/identify/identify.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-03-20 22:23:04 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-03-20 22:23:04 +0000
commitda7561b1d44bce2db12d63129cd466bbff4f5a80 (patch)
treede741261fe84c3ad804f32ef9a2893266c216c5b /identify/identify.py
parentAdding upstream version 2.1.2. (diff)
downloadidentify-da7561b1d44bce2db12d63129cd466bbff4f5a80.tar.xz
identify-da7561b1d44bce2db12d63129cd466bbff4f5a80.zip
Adding upstream version 2.2.0.upstream/2.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'identify/identify.py')
-rw-r--r--identify/identify.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/identify/identify.py b/identify/identify.py
index 52d2c2d..59bc6ba 100644
--- a/identify/identify.py
+++ b/identify/identify.py
@@ -240,7 +240,7 @@ def license_id(filename: str) -> Optional[str]:
3. check exact text match with existing licenses
4. failing that use edit distance
"""
- import editdistance # `pip install identify[license]`
+ import editdistance_s # `pip install identify[license]`
with open(filename, encoding='UTF-8') as f:
contents = f.read()
@@ -260,7 +260,7 @@ def license_id(filename: str) -> Optional[str]:
if norm and abs(len(norm) - len(norm_license)) / len(norm) > .05:
continue
- edit_dist = editdistance.eval(norm, norm_license)
+ edit_dist = editdistance_s.distance(norm, norm_license)
if edit_dist < min_edit_dist:
min_edit_dist = edit_dist
min_edit_dist_spdx = spdx