Documentation ¶
Overview ¶
Package gntagger is a command line application that helps to find/curate scientific names interactively. For example if there is a monograph about a genus with hundreds of scientific names, gntagger will find names automatically and then will let the user to verify found names interactively.
Asciicast: https://asciinema.org/a/wNfIt2TfZiyrAwJZKhuq5DkHV
The user interface of the program consists of 2 panels. The left panel contains detected scientific names, with a "current name" located in the middle of the screen and highlighted. The left panel contains the full text, where the "current name" is highlighted and aligned with the "current name" in the left panel.
The program is designed to move though the names quickly. Navigate to the next/previous name in the left panel using Right/Left arrow keys. All names have an empty annotation at the beginning. Pressing Right Arrow key automatically "accepts" found name if the annotation is empty. Other keys allow to annotate the "current name" differently:
* Space: rejects a name with "NotName" annotation
* 'y': re-accepts mistakenly rejected name with "Accepted" annotation
* 'u': marks a name as "Uninomial"
* 'g': marks a name as "Genus"
* 's': marks a name as "Species"
* Ctrl-C: saves curation and exits application
* Ctrl-S: saves curations made so far
The program autosaves results of curation. If the program crashes, or exited the user can continue curation at the last point instead of starting from scratch.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NameStrings ¶ added in v0.3.0
NameStrings composes text to show in terminal gui
func ShowWarningIfPreviousData ¶ added in v0.3.0
func ShowWarningIfPreviousData(text *Text)
ShowWarningIfPreviousData takes *Text pointer. It warns if previously created data exist and backups the old data.
Types ¶
type FileType ¶ added in v0.2.0
type FileType int
FileType describes types created by gntagger during name finding and curation.
type GnTagger ¶ added in v0.3.0
type GnTagger struct { // Bayes flag forces bayes name-finding even when the language of the text // is not supported. Bayes bool // OddsHigh marks a limit after which names are considered 'good'. OddsHigh float64 // OddsLow marks a low limit for 'doubtful' names. OddsHigh is the upper // limit for such names. OddsLow float64 // Express sets if we skip names that were already marked as 'good' // or 'bad' Express bool }
GnTagger keeps configuration parameters of the program
func NewGnTagger ¶ added in v0.3.0
func NewGnTagger() *GnTagger
NewGnTagger creates a new GnTagger object
type Names ¶
type Names struct { // Path to json file with names Path string // Data is a gnfinder output Data output.Output }
Names is an object that keeps output of a name finder and the path where to save this data on disk
func NamesFromJSON ¶
NamesFromJSON creates gntagger's name structure from a finder output
func NewNames ¶ added in v0.2.0
NewNames uses a name finder or existing information to return Names structure generated from a text
func PrepareFilesAndText ¶ added in v0.3.0
PrepareFilesAndText creates files if needed and returns list of names for curation.
func (*Names) GetCurrentName ¶ added in v0.2.0
GetCurrentName returns currently selected name
func (*Names) UpdateAnnotations ¶ added in v0.3.0
func (n *Names) UpdateAnnotations(newAnnot annotation.Annotation, edge int, gnt *GnTagger) error
UpdateAnnotations takes an annotation updates the current name with it. If needed, it propagates annotations further down the 'unseen' list.
type Text ¶
type Text struct { // Raw text, as it was given by a user Raw []byte // Cleaned text after removing non-printable characters and wrapping // according to the width of a user's terminal Processed []rune // Cleaned text in bytes ProcessedBytes []byte // Path to the text file Path string // Files is a map that contains names of the files created by gntagger Files map[FileType]string // TextMeta describes provides metainformation about text: // Checksum, GNtaggerVersion, Timestamp TextMeta // contains filtered or unexported fields }
Text contains text of the input and its metadata
func (*Text) Errors ¶ added in v0.2.1
Errors returns list of errors that happened during execution of the gntagger.
type TextMeta ¶ added in v0.2.0
type TextMeta struct { // Checksum is a hash calculated from the content. Checksum string `json:"text_checksum"` // GNtaggerVersion is the version of gntagger that generated output. GNtaggerVersion string `json:"gntagger_version"` // Timestamp of the last save. Timestamp string `json:"save_timestamp"` }
TextMeta used for creating the content of the MetaFile