Documentation ¶
Overview ¶
lemma is like model package. It contains structure for jisho and wadoku packages and also can compose results from them.
Index ¶
- func AccentDirectionStrings() []string
- func Enrich(lemmas []*Lemma, pitchedLemmas []*PitchedLemma)
- type AccentDirection
- func (i AccentDirection) IsAAccentDirection() bool
- func (i AccentDirection) MarshalGQL(w io.Writer)
- func (i AccentDirection) MarshalText() ([]byte, error)
- func (i AccentDirection) String() string
- func (i *AccentDirection) UnmarshalGQL(value interface{}) error
- func (i *AccentDirection) UnmarshalText(text []byte) error
- type Audio
- type Furigana
- type FuriganaChar
- type Lemma
- type PitchShape
- type PitchedLemma
- type ProjectedLemma
- type Word
- type WordSense
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccentDirectionStrings ¶
func AccentDirectionStrings() []string
AccentDirectionStrings returns a slice of all String values of the enum
func Enrich ¶
func Enrich(lemmas []*Lemma, pitchedLemmas []*PitchedLemma)
Enrich add pitch infromation from pitches to lemmas. Modifies lemmas, if you need: make copy.
Types ¶
type AccentDirection ¶
type AccentDirection int
const ( AccentDirectionUp AccentDirection = iota AccentDirectionRight AccentDirectionDown AccentDirectionLeft )
func AccentDirectionString ¶
func AccentDirectionString(s string) (AccentDirection, error)
AccentDirectionString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func AccentDirectionValues ¶
func AccentDirectionValues() []AccentDirection
AccentDirectionValues returns all values of the enum
func (AccentDirection) IsAAccentDirection ¶
func (i AccentDirection) IsAAccentDirection() bool
IsAAccentDirection returns "true" if the value is listed in the enum definition. "false" otherwise
func (AccentDirection) MarshalGQL ¶
func (i AccentDirection) MarshalGQL(w io.Writer)
MarshalGQL implements the graphql.Marshaler interface for AccentDirection
func (AccentDirection) MarshalText ¶
func (i AccentDirection) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshaler interface for AccentDirection
func (AccentDirection) String ¶
func (i AccentDirection) String() string
func (*AccentDirection) UnmarshalGQL ¶
func (i *AccentDirection) UnmarshalGQL(value interface{}) error
UnmarshalGQL implements the graphql.Unmarshaler interface for AccentDirection
func (*AccentDirection) UnmarshalText ¶
func (i *AccentDirection) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface for AccentDirection
type Audio ¶
type Audio struct { // MediaType is one of the specified audo media types by iana: // https://www.iana.org/assignments/media-types/media-types.xhtml#audio MediaType string `json:"Format,omitempty"` Source string `json:"Source,omitempty"` }
type Furigana ¶
type Furigana []FuriganaChar
type FuriganaChar ¶
type PitchShape ¶
type PitchShape struct { Hiragana string `json:"Hiragana,omitempty"` Directions []AccentDirection `json:"Directions,omitempty"` }
type PitchedLemma ¶
type PitchedLemma struct { Slug string Hiragana string PitchShapes []PitchShape }
PitchedLemma is data that we extract from wadoku dictionary.
type ProjectedLemma ¶
type ProjectedLemma struct { Slug Word `json:"Slug,omitempty"` Tags []string `json:"Tags,omitempty"` Forms []Word `json:"Forms,omitempty"` Definitions []string `json:"Definitions,omitempty"` PartsOfSpeech []string `json:"PartsOfSpeech,omitempty"` SenseTags []string `json:"SenseTags,omitempty"` Audio []Audio `json:"Audio,omitempty"` }
ProjectedLemma is more specific variant of Lemma. This structure include only one meaning.
type Word ¶
type Word struct { Word string `json:"Word,omitempty"` Hiragana string `json:"Hiragana,omitempty"` Furigana Furigana `json:"Furigana,omitempty"` // PitchShapes is encoded pitch for moras // TODO: implement normalization: left direction is prefered, // so we say generally say that (a|)(b) should be written as (a)(|b) or // (AccentDirectionUD1 AccentDirectionRight)-(AccentDirectionUD2 should be substitute by // (AccentDirectionUD1)-(AccentDirectionUD2 AccentDirectionLeft) PitchShapes []PitchShape `json:"Pitches,omitempty"` }