summaryrefslogtreecommitdiffstats
path: root/python/fatcat_tools
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2020-12-24 11:59:43 -0800
committerBryan Newbold <bnewbold@robocracy.org>2020-12-24 11:59:43 -0800
commit42bc443ccedbbf42510f06b1d5531c06f2b15bed (patch)
treefd961dcdbd5a94d0e8cf9fd9ac1899d174d158c7 /python/fatcat_tools
parentf2f78b04ddee7983e1ebef8480c611e072fcd3c6 (diff)
downloadfatcat-42bc443ccedbbf42510f06b1d5531c06f2b15bed.tar.gz
fatcat-42bc443ccedbbf42510f06b1d5531c06f2b15bed.zip
normalizer: test for un-versioned arxiv_id
Diffstat (limited to 'python/fatcat_tools')
-rw-r--r--python/fatcat_tools/normal.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/python/fatcat_tools/normal.py b/python/fatcat_tools/normal.py
index d792979d..4218856c 100644
--- a/python/fatcat_tools/normal.py
+++ b/python/fatcat_tools/normal.py
@@ -94,6 +94,9 @@ def clean_arxiv_id(raw):
- 'arxiv:' prefix
Works with versioned or un-versioned arxiv identifiers.
+
+ TODO: version of this function that only works with versioned identifiers?
+ That is the behavior of fatcat API
"""
if not raw:
return None
@@ -116,6 +119,7 @@ def test_clean_arxiv_id():
assert clean_arxiv_id("math.CA/0611800v2") == "math.CA/0611800v2"
assert clean_arxiv_id("math.CA/0611800") == "math.CA/0611800"
assert clean_arxiv_id("0806.2878v1 ") == "0806.2878v1"
+ assert clean_arxiv_id("cs/0207047") == "cs/0207047"
assert clean_arxiv_id("https://arxiv.org/abs/0806.2878v1") == "0806.2878v1"
assert clean_arxiv_id("arxiv:0806.2878v1") == "0806.2878v1"