From fc051ed49e6baa8a7c48047919372cbff4b9fbd6 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 14 Jan 2023 11:39:43 +0100 Subject: [PATCH] Add distance calculation information to docstrings --- pubs/plugs/extract/annotation.py | 3 ++- pubs/plugs/extract/extract.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pubs/plugs/extract/annotation.py b/pubs/plugs/extract/annotation.py index 0baefbb..a12dec8 100644 --- a/pubs/plugs/extract/annotation.py +++ b/pubs/plugs/extract/annotation.py @@ -87,7 +87,8 @@ class Annotation: def colorname(self): """Return the stringified version of the annotation color. - Finds the closest named color to the annotation and returns it. + Finds the closest named color to the annotation and returns it, + using euclidian distance between the two color vectors. """ annot_colors = ( self.colors.get("stroke") or self.colors.get("fill") or (0.0, 0.0, 0.0) diff --git a/pubs/plugs/extract/extract.py b/pubs/plugs/extract/extract.py index c513813..e5c356d 100644 --- a/pubs/plugs/extract/extract.py +++ b/pubs/plugs/extract/extract.py @@ -225,7 +225,8 @@ class ExtractPlugin(PapersPlugin): that is only the written words, sometimes that is only annotation notes, sometimes it is both. Runs a similarity comparison between strings to find out whether they - should both be included or are doubling up. + should both be included or are doubling up, using + Levenshtein distance. """ content = annotation.info["content"].replace("\n", " ") written = page.get_textbox(annotation.rect).replace("\n", " ")