diff options
author | Martin Czygan <martin.czygan@gmail.com> | 2021-05-05 15:55:39 +0200 |
---|---|---|
committer | Martin Czygan <martin.czygan@gmail.com> | 2021-05-05 15:55:39 +0200 |
commit | 634b7b7d910ddb20c5af0722de41ef5ccded7358 (patch) | |
tree | d83f5fb36dc4c98035511059202fc51dc676ee54 /skate/schema.go | |
parent | a380bffa5fb0cf20ee84ede6fa590bf38e3675f8 (diff) | |
parent | 134752c2a160986c13d6c2b9428cb2720ed382d0 (diff) | |
download | refcat-634b7b7d910ddb20c5af0722de41ef5ccded7358.tar.gz refcat-634b7b7d910ddb20c5af0722de41ef5ccded7358.zip |
Merge branch 'master' of git.archive.org:martin/cgraph
* 'master' of git.archive.org:martin/cgraph: (24 commits)
update notes
make: run go mod tidy after build
add test for ParseUnstructured
remove stub file
tweaks; move parsing out of command
skate-map: a bit more help output
update docs
set: some tweaks
update README
update deps
start overview docs
update README
update docs
map is a reference type
fix a typo
implement a few flags as mapper middleware
update ignore files
update deps
rename skate-ref-to-release to skate-conv
update README
...
Diffstat (limited to 'skate/schema.go')
-rw-r--r-- | skate/schema.go | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/skate/schema.go b/skate/schema.go index d58d1e8..9f3af45 100644 --- a/skate/schema.go +++ b/skate/schema.go @@ -65,7 +65,7 @@ func RefToRelease(ref *Ref) (*Release, error) { return &release, nil } -// parseIsbn tries to find and validate ISBN from unstrucuted data. +// parseIsbn tries to find and validate ISBN from unstructured data. func parseIsbn(s string) []string { // ISBN: 10: 0137822693, pp: 373 // Robotec, E. (1996). Scorbot ER VII, User's Manual, Eshed Robotec, @@ -80,7 +80,7 @@ func parseIsbn(s string) []string { u []rune z string ) - valid := setPool.Get().(*set.Set) + valid := setPool.Get().(set.Set) valid.Clear() defer setPool.Put(valid) for _, v := range append(candidates10, candidates13...) { @@ -112,24 +112,26 @@ func parseIsbn(s string) []string { return valid.Slice() } +type Biblio struct { + ArxivId string `json:"arxiv_id,omitempty"` + ContainerName string `json:"container_name,omitempty"` + ContribRawNames []string `json:"contrib_raw_names,omitempty"` + DOI string `json:"doi,omitempty"` + Issue string `json:"issue,omitempty"` + PMCID string `json:"pmcid,omitempty"` + PMID string `json:"pmid,omitempty"` + Pages string `json:"pages,omitempty"` + Publisher string `json:"publisher,omitempty"` + Title string `json:"title,omitempty"` + Unstructured string `json:"unstructured,omitempty"` + Url string `json:"url,omitempty"` + Volume string `json:"volume,omitempty"` + Year int64 `json:"year,omitempty"` +} + // Ref is a reference document, can be very partial. type Ref struct { - Biblio struct { - ArxivId string `json:"arxiv_id,omitempty"` - ContainerName string `json:"container_name,omitempty"` - ContribRawNames []string `json:"contrib_raw_names,omitempty"` - DOI string `json:"doi,omitempty"` - Issue string `json:"issue,omitempty"` - PMCID string `json:"pmcid,omitempty"` - PMID string `json:"pmid,omitempty"` - Pages string `json:"pages,omitempty"` - Publisher string `json:"publisher,omitempty"` - Title string `json:"title,omitempty"` - Unstructured string `json:"unstructured,omitempty"` - Url string `json:"url,omitempty"` - Volume string `json:"volume,omitempty"` - Year int64 `json:"year,omitempty"` - } `json:"biblio"` + Biblio Biblio `json:"biblio"` Index int64 `json:"index,omitempty"` Key string `json:"key,omitempty"` RefSource string `json:"ref_source,omitempty"` |