Commit a47a2145 authored by Dmitry Mozzherin's avatar Dmitry Mozzherin
Browse files

Fix #67 add authorship of a name to the root of the output

parent eb4d9fa6
Pipeline #81405524 passed with stages
in 5 minutes and 33 seconds
......@@ -2,9 +2,10 @@
## Unreleased
## [v0.9.1]
## [v0.10.0]
- Add [#66]: parsing removes HTML tags as well.
- Add [#67]: field `authorship` of the name for JSON output
- Add [#66]: remove HTML tags during parsing instead of a separate step.
- Add [#61]: handle authors that end with a word "bis".
- Add [#60]: handle correctly deprecated ranks with greek letters.
- Add [#62]: parser breaks on ``Drepanolejeunea (Spruce) (Steph.)``.
......@@ -95,7 +96,7 @@ array of names instead of a stream.
This document follows [changelog guidelines]
[v0.9.1]: https://gitlab.com/gogna/gnparser/compare/v0.9.0...v0.9.1
[v0.10.0]: https://gitlab.com/gogna/gnparser/compare/v0.9.0...v0.10.0
[v0.9.0]: https://gitlab.com/gogna/gnparser/compare/v0.8.0...v0.9.0
[v0.8.0]: https://gitlab.com/gogna/gnparser/compare/v0.7.5...v0.8.0
[v0.7.5]: https://gitlab.com/gogna/gnparser/compare/v0.7.4...v0.7.5
......@@ -107,6 +108,7 @@ This document follows [changelog guidelines]
[v0.6.0]: https://gitlab.com/gogna/gnparser/compare/v0.5.1...v0.6.0
[v0.5.1]: https://gitlab.com/gogna/gnparser/tree/v0.5.1
[#67]: https://gitlab.com/gogna/gnparser/issues/67
[#66]: https://gitlab.com/gogna/gnparser/issues/66
[#65]: https://gitlab.com/gogna/gnparser/issues/65
[#64]: https://gitlab.com/gogna/gnparser/issues/64
......
......@@ -14,6 +14,7 @@ type Output struct {
Verbatim string `json:"verbatim"`
Normalized string `json:"normalized,omitempty"`
CanonicalName *canonical `json:"canonicalName,omitempty"`
Authorship string `json:"authorship,omitempty"`
Details []interface{} `json:"details,omitempty"`
Positions []pos `json:"positions,omitempty"`
Surrogate bool `json:"surrogate"`
......@@ -28,6 +29,7 @@ type Output struct {
func NewOutput(sn *grm.ScientificNameNode) *Output {
var co *canonical
var quality int
var au string
var ws []Warning
var ps []pos
var hybrid bool
......@@ -40,6 +42,11 @@ func NewOutput(sn *grm.ScientificNameNode) *Output {
ps = convertPos(sn.Pos())
hybrid = sn.Hybrid
parsed = true
lastAuthorship := sn.LastAuthorship()
if lastAuthorship != nil {
au = lastAuthorship.Value
}
}
o := Output{
......@@ -57,6 +64,7 @@ func NewOutput(sn *grm.ScientificNameNode) *Output {
Bacteria: sn.Bacteria,
Tail: sn.Tail,
Details: det,
Authorship: au,
ParserVersion: sn.ParserVersion,
}
return &o
......
package output
const Version = "v0.9.0-11-g9cf540b"
const Build = "2019-09-10_16:05:00UTC"
const Version = "v0.9.0-8-geb4d9fa"
const Build = "2019-09-10_16:54:10UTC"
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment