presenter

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CSVHeader

func CSVHeader() []string

CSVHeader produces a CSV header compatible with CSV output of Output's Encode method.

Types

type Output

type Output struct {
	// String1 is the first input string.
	String1 string `json:"string1"`
	// String2 is the second input string.
	String2 string `json:"string2"`
	// Tags1, would contain tagged version of the first string
	// that will show where it differs from the second string.
	Tags1 string `json:"tags1,omitempty"`
	// Tags2, would contain tagged version of the second string
	// that will show where it differs from the first string.
	Tags2 string `json:"tags2,omitempty"`
	// EditDist is the calculated edit distance according to
	// Levenshtein algorithm. In case if Maximum Edit Distance is
	// set it might not show the actual edit distance between two
	// strings.
	EditDist int `json:"editDistance"`
	// Aborted is true if Maximum Edit Distance is provided, and
	// it was exceeded during calculations.
	Aborted bool `json:"aborted,omitempty"`
}

Output is a representation of edit distance calculation results.

func (Output) Encode

func (o Output) Encode(f gnfmt.Format) (string, error)

Encode method produces representation of Output for consumption either by a CLI user, or a WEB client. It supports 3 possible formats: CSV, JSON (pretty), JSON compact.

Jump to

Keyboard shortcuts

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