output

package
v0.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSimpleOutput

func NewSimpleOutput(sn *grammar.ScientificNameNode) *simple

Types

type Output

type Output struct {
	Parsed        bool          `json:"parsed"`
	Quality       int           `json:"quality"`
	Warnings      []Warning     `json:"qualityWarnings,omitempty"`
	Verbatim      string        `json:"verbatim"`
	Normalized    string        `json:"normalized,omitempty"`
	CanonicalName *canonical    `json:"canonicalName,omitempty"`
	Details       []interface{} `json:"details,omitempty"`
	Positions     []pos         `json:"positions,omitempty"`
	Surrogate     bool          `json:"surrogate"`
	Virus         bool          `json:"virus"`
	Hybrid        bool          `json:"hybrid"`
	Bacteria      bool          `json:"bacteria"`
	Tail          string        `json:"unparsedTail,omitempty"`
	NameStringID  string        `json:"nameStringId"`
	ParserVersion string        `json:"parserVersion"`
}

func FromJSON

func FromJSON(data []byte) (Output, error)

FromJSON converts JSON representation of Outout to Output object.

func NewOutput

func NewOutput(sn *grm.ScientificNameNode) *Output

func (*Output) ToJSON

func (o *Output) ToJSON(pretty bool) ([]byte, error)

ToJSON converts Output to JSON representation.

type Warning

type Warning struct {
	Quality int
	Message string
}

func (*Warning) MarshalJSON

func (w *Warning) MarshalJSON() ([]byte, error)

func (*Warning) UnmarshalJSON

func (w *Warning) UnmarshalJSON(bs []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL