diff options
Diffstat (limited to 'skate')
-rw-r--r-- | skate/cmd/skate-map/main.go | 4 | ||||
-rw-r--r-- | skate/map.go | 20 |
2 files changed, 12 insertions, 12 deletions
diff --git a/skate/cmd/skate-map/main.go b/skate/cmd/skate-map/main.go index 132d4ab..572ecec 100644 --- a/skate/cmd/skate-map/main.go +++ b/skate/cmd/skate-map/main.go @@ -74,8 +74,8 @@ func main() { "ty": skate.MapperTitleNysiis, "ts": skate.MapperTitleSandcrawler, "ru": skate.MapperURLFromRef, - "cti": skate.MapperContainerTitle, - "cts": skate.MapperContainerTitleSandcrawler, + "cni": skate.MapperContainerName, + "cns": skate.MapperContainerNameSandcrawler, } if *logFile != "" { f, err := os.OpenFile(*logFile, os.O_CREATE|os.O_APPEND, 0644) diff --git a/skate/map.go b/skate/map.go index 0c55eed..a72ad89 100644 --- a/skate/map.go +++ b/skate/map.go @@ -24,10 +24,10 @@ type TitleDoc struct { Title string `json:"title"` } -// ContainerTitleDoc is a document with a container title. -type ContainerTitleDoc struct { +// ContainerNameDoc is a document with a container title. +type ContainerNameDoc struct { Biblio struct { - ContainerTitle string `json:"container_title"` + ContainerName string `json:"container_title"` } `json:"biblio"` } @@ -197,23 +197,23 @@ func MapperTitleSandcrawler(p []byte) (fields [][]byte, err error) { return fields, nil } -// MapperContainerTitle extracts (container_title, doc). -func MapperContainerTitle(p []byte) ([][]byte, error) { +// MapperContainerName extracts (container_title, doc). +func MapperContainerName(p []byte) ([][]byte, error) { var ( - doc ContainerTitleDoc + doc ContainerNameDoc key []byte ) if err := json.Unmarshal(p, &doc); err != nil { return nil, err } else { - key = []byte(wsReplacer.Replace(strings.TrimSpace(doc.Biblio.ContainerTitle))) + key = []byte(wsReplacer.Replace(strings.TrimSpace(doc.Biblio.ContainerName))) } return [][]byte{key, p}, nil } -// MapperContainerTitleSandcrawler extracts (container_title, doc). -func MapperContainerTitleSandcrawler(p []byte) (fields [][]byte, err error) { - if fields, err = MapperContainerTitle(p); err != nil { +// MapperContainerNameSandcrawler extracts (container_title, doc). +func MapperContainerNameSandcrawler(p []byte) (fields [][]byte, err error) { + if fields, err = MapperContainerName(p); err != nil { return nil, err } key := string(fields[0]) |