diff options
author | Bryan Newbold <bnewbold@archive.org> | 2021-07-25 13:01:38 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2021-07-25 13:01:38 -0700 |
commit | a2cae69110df162b12b4a4aad33785fa35f6e5e8 (patch) | |
tree | 2284bf293f04914c781884f03aaadfd7446ddeda /skate | |
parent | e038bfb6be24994ae9972d08f85c1cb1506a06b4 (diff) | |
download | refcat-a2cae69110df162b12b4a4aad33785fa35f6e5e8.tar.gz refcat-a2cae69110df162b12b4a4aad33785fa35f6e5e8.zip |
schema: switch from '.name' to '.raw_name' for un-parsed CSL name field
Diffstat (limited to 'skate')
-rw-r--r-- | skate/reduce.go | 4 | ||||
-rw-r--r-- | skate/schema.go | 4 | ||||
-rw-r--r-- | skate/schema_test.go | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/skate/reduce.go b/skate/reduce.go index 4cd604a..361d7ba 100644 --- a/skate/reduce.go +++ b/skate/reduce.go @@ -576,8 +576,8 @@ func matchedRefsExtend(matched []*BiblioRef, refs []*Ref, stats *statsAugment) [ isbn string issued *CSLDate ) - for _, name := range r.Biblio.ContribRawNames { - authors = append(authors, CSLAuthor{Name: name}) + for _, raw_name := range r.Biblio.ContribRawNames { + authors = append(authors, CSLAuthor{RawName: raw_name}) } if len(r.Biblio.Extra.ISBN) > 0 { isbn = r.Biblio.Extra.ISBN[0] diff --git a/skate/schema.go b/skate/schema.go index 50f52d6..f36815f 100644 --- a/skate/schema.go +++ b/skate/schema.go @@ -481,12 +481,12 @@ type CSLDate struct { // family element. Institutional names may be delivered in the same way, but it // is preferred to set them instead as a literal element. // -// We include Name, for holding unparsed name, which is not a literal. +// We include RawName, for holding unparsed name, which is not a literal. type CSLAuthor struct { Family string `json:"family,omitempty"` Given string `json:"given,omitempty"` Literal string `json:"literal,omitempty"` - Name string `json:"name,omitempty"` + RawName string `json:"raw_name,omitempty"` } func (b *BiblioRef) Reset() { diff --git a/skate/schema_test.go b/skate/schema_test.go index 4489bed..59b1f58 100644 --- a/skate/schema_test.go +++ b/skate/schema_test.go @@ -221,11 +221,11 @@ func TestLinkHash(t *testing.T) { }{ { bref: BiblioRef{}, - linkHash: "7cae9fc61f167bc26cc3839f15457fe87b2be4e1", + linkHash: "8b8c3f74dd1472aa8869ee3a58295b70c7064aa8", }, { bref: BiblioRef{SourceReleaseIdent: "123"}, - linkHash: "a0969f96c14cb42d298117e1927bd409873173a2", + linkHash: "23d0f9e279ec533f46a6b220f7a5758ec0c9d9af", }, { bref: BiblioRef{ |