aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2020-12-12 03:50:31 +0100
committerMartin Czygan <martin.czygan@gmail.com>2020-12-12 03:50:31 +0100
commitfc27e33c247a5c846740a8afd946efee4cdb37a7 (patch)
tree9bd6565ebbea37787f7ada55370e2dcf079f1771
parentc4b61bf40640640925c1892f66c4c10d88047a2a (diff)
downloadfuzzycat-fc27e33c247a5c846740a8afd946efee4cdb37a7.tar.gz
fuzzycat-fc27e33c247a5c846740a8afd946efee4cdb37a7.zip
update docs
-rw-r--r--fuzzycat/utils.py7
-rw-r--r--fuzzycat/verify.py1
2 files changed, 7 insertions, 1 deletions
diff --git a/fuzzycat/utils.py b/fuzzycat/utils.py
index e4d7bdc..7f08fa3 100644
--- a/fuzzycat/utils.py
+++ b/fuzzycat/utils.py
@@ -10,10 +10,15 @@ printable_no_punct = string.digits + string.ascii_letters + string.whitespace
# More correct: https://www.johndcook.com/blog/2016/02/04/regular-expression-to-match-a-chemical-element/
CHEM_FORMULA = re.compile(r"([A-Z]{1,2}[0-9]{1,2})+")
+def parse_page_string(s):
+ """
+ Parse typical page strings, e.g. 150-180.
+ """
+ raise NotImplementedError()
def dict_key_exists(doc, path):
"""
- Return true, if a value at a given path exists. XXX: probably in glom, too.
+ Return true, if key at a given path exists. XXX: probably already in glom.
"""
try:
_ = glom(doc, path)
diff --git a/fuzzycat/verify.py b/fuzzycat/verify.py
index d73dbdc..bd8e69b 100644
--- a/fuzzycat/verify.py
+++ b/fuzzycat/verify.py
@@ -579,6 +579,7 @@ def verify(a: Dict, b: Dict, min_title_length=5) -> Tuple[str, str]:
try:
a_pages = glom(a, "pages")
b_pages = glom(b, "pages")
+ # XXX: Pages might be of the form "261-5", meaning: 261-265.
page_pattern = re.compile("([0-9]{1,})-([0-9]{1,})")
a_match = page_pattern.match(a_pages)
b_match = page_pattern.match(b_pages)