gotdict

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package gotdict parses GOTDict (https://github.com/wjdp/gotdict).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Def

type Def struct {
	// Title is the main title of the definition (it may contain spaces) (i.e. Tyrion Lannister).
	Title string
	// Terms are other forms of the title which should be recognized.
	Terms []string
	// Type is the record type. Currently, not many entries have one.
	Type Type
	// Images contains referenced image files.
	Images map[string][]byte
	// Definition contains the Markdown definition.
	Definition string
}

Def represents a definition.

type Dict

type Dict []*Def

Dict represents the Dict.

func Parse

func Parse(defdir, imgdir string, imgref bool) (Dict, error)

Parse parses the Dict. If imgdir is an empty string, images are removed. If imgref is true, image paths are set to the full filepath rather than reading the images to memory.

type Type

type Type string

Type is a Dict record type.

const (
	// TypeUnknown is used for definitions without a type set (i.e. before types were used).
	TypeUnknown Type = ""
	// TypeCharacter is a character (e.g. Jon, Tyrion).
	TypeCharacter Type = "character"
	// TypeHouse is a house (e.g. Lannister, Stark).
	TypeHouse Type = "house"
	// TypeEvent is an event in time.
	TypeEvent Type = "event"
	// TypeCity is a city.
	TypeCity Type = "city"
	// TypeLocation is a location (e.g. King's Landing).
	TypeLocation Type = "location"
	// TypeRiver is a river.
	TypeRiver Type = "river"
	// TypeShip is a ship.
	TypeShip Type = "ship"
	// TypeWord is an uncommon or ASOIAF-specific word.
	TypeWord Type = "word"
)

Jump to

Keyboard shortcuts

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