aboutsummaryrefslogtreecommitdiffstats
path: root/skate
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2021-05-08 00:15:52 +0200
committerMartin Czygan <martin.czygan@gmail.com>2021-05-08 00:15:52 +0200
commitff4b988b8920d73747e344bd8f47b3c24025fc7c (patch)
tree2b795cb415df331e80e9a7a3a94bd9482f05b485 /skate
parent46a8f6917377ac08dcd7d3bb73efa75c6bb7c10e (diff)
downloadrefcat-ff4b988b8920d73747e344bd8f47b3c24025fc7c.tar.gz
refcat-ff4b988b8920d73747e344bd8f47b3c24025fc7c.zip
parse out isbn from unstructured
Diffstat (limited to 'skate')
-rw-r--r--skate/unstructured.go11
-rw-r--r--skate/unstructured_test.go11
2 files changed, 22 insertions, 0 deletions
diff --git a/skate/unstructured.go b/skate/unstructured.go
index 85ef0fe..7fda9d7 100644
--- a/skate/unstructured.go
+++ b/skate/unstructured.go
@@ -47,6 +47,7 @@ func ParseUnstructured(ref *Ref) error {
ref.Biblio.DOI = strings.Replace(ref.Biblio.Url, prefix, "", -1)
}
}
+ // Another DOI pattern.
v = PatDOINoHyphen.FindString(ref.Key)
if v != "" && ref.Biblio.DOI == "" {
ref.Biblio.DOI = v
@@ -61,5 +62,15 @@ func ParseUnstructured(ref *Ref) error {
ref.Biblio.ArxivId = vs[1]
}
}
+ // XXX: ISBN
+ ref.Biblio.Extra.ISBN = ParseIsbn(uns)
+ // Some more examples:
+ // - 2005 Sep;95(9):1545-51
+ // - Pattern Anal. Mach. Intell., 36(2):346-360, 2014. 4, 6, 7"
+ //
+ // There seems to be a number tiny of data issues; e.g. one off dates. Can
+ // we fix them here?
+ // Include: https://images.webofknowledge.com/images/help/WOS/J_abrvjt.html, ...
+
return nil
}
diff --git a/skate/unstructured_test.go b/skate/unstructured_test.go
index 41ff471..92f1d80 100644
--- a/skate/unstructured_test.go
+++ b/skate/unstructured_test.go
@@ -52,3 +52,14 @@ func TestParseUnstructured(t *testing.T) {
}
}
}
+
+func BenchmarkParseUnstructured(b *testing.B) {
+ ref := Ref{
+ Biblio: Biblio{
+ Unstructured: "https://arxiv.org/pdf/0808.3320v3.pdf Hello 10.1111/j.1550-7408.1968.tb02138.x-BIB5",
+ },
+ }
+ for n := 0; n < b.N; n++ {
+ ParseUnstructured(&ref)
+ }
+}