aboutsummaryrefslogtreecommitdiffstats
path: root/skate
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2021-05-24 22:02:16 +0200
committerMartin Czygan <martin.czygan@gmail.com>2021-05-24 22:02:16 +0200
commitc0090028f26cefb7f609c2ad07a8dc6a253c7cf9 (patch)
tree48082239f7556d82479e6276bb397b1ed2fdd747 /skate
parent04ff0119114873d3631e2b9b7b12eab66964e4a2 (diff)
downloadrefcat-c0090028f26cefb7f609c2ad07a8dc6a253c7cf9.tar.gz
refcat-c0090028f26cefb7f609c2ad07a8dc6a253c7cf9.zip
fix container title extraction
Diffstat (limited to 'skate')
-rw-r--r--skate/map.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/skate/map.go b/skate/map.go
index 737c9af..0c55eed 100644
--- a/skate/map.go
+++ b/skate/map.go
@@ -24,9 +24,11 @@ type TitleDoc struct {
Title string `json:"title"`
}
-// ContainerTitleDoc is a document with a title.
+// ContainerTitleDoc is a document with a container title.
type ContainerTitleDoc struct {
- ContainerTitle string `json:"container_title"`
+ Biblio struct {
+ ContainerTitle string `json:"container_title"`
+ } `json:"biblio"`
}
// PartialDoc for docs, that do not have DOI or title. E.g. we found 49701699
@@ -204,7 +206,7 @@ func MapperContainerTitle(p []byte) ([][]byte, error) {
if err := json.Unmarshal(p, &doc); err != nil {
return nil, err
} else {
- key = []byte(wsReplacer.Replace(strings.TrimSpace(doc.ContainerTitle)))
+ key = []byte(wsReplacer.Replace(strings.TrimSpace(doc.Biblio.ContainerTitle)))
}
return [][]byte{key, p}, nil
}