jisho

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JLPTLevel

type JLPTLevel string
const (
	N5 JLPTLevel = "N5"
	N4 JLPTLevel = "N4"
	N3 JLPTLevel = "N3"
	N2 JLPTLevel = "N2"
	N1 JLPTLevel = "N1"
)

type Jisho

type Jisho struct {
	BaseScrapeUri             string
	BaseApiUri                string
	StrokeOrderDiagramBaseUri string
}

func NewJisho

func NewJisho() *Jisho

func (*Jisho) SearchForKanji

func (j *Jisho) SearchForKanji(kanji string) (*Kanji, error)

func (*Jisho) SearchKeyword

func (j *Jisho) SearchKeyword(kw string) (*SearchResp, error)

type Kanji

type Kanji struct {
	Rune               rune
	TaughtIn           string
	JLPT               JLPTLevel
	NewspaperFreqRank  int
	StrokeCount        int
	Meaning            string
	Kunyomi            []string
	KunyomiExamples    []*ReadingExample
	Onyomi             []string
	OnyomiExamples     []*ReadingExample
	Radical            *Radical
	Parts              []string
	StrokeOrderDiagram string
	JishoUri           string
	// contains filtered or unexported fields
}

type KanjiNotFound

type KanjiNotFound struct {
	Arg string
}

func (*KanjiNotFound) Error

func (e *KanjiNotFound) Error() string

type Radical

type Radical struct {
	Meaning string
	Symbol  string
}

type ReadingExample

type ReadingExample struct {
	Example string
	Reading string
	Meaning string
}

type SearchResp

type SearchResp struct {
	Meta struct {
		Status int `json:"status"`
	} `json:"meta"`
	Data []struct {
		Slug     string   `json:"slug"`
		IsCommon bool     `json:"is_common"`
		Tags     []string `json:"tags"`
		Jlpt     []string `json:"jlpt"`
		Japanese []struct {
			Word    string `json:"word"`
			Reading string `json:"reading"`
		} `json:"japanese"`
		Senses []struct {
			EnglishDefinitions []string `json:"english_definitions"`
			PartsOfSpeech      []string `json:"parts_of_speech"`
			Links              []string `json:"links"`
			Tags               []string `json:"tags"`
			Restrictions       []string `json:"restrictions"`
			SeeAlso            []string `json:"see_also"`
			Antonyms           []string `json:"antonyms"`
			Source             []string `json:"source"`
			Info               []string `json:"info"`
		} `json:"senses"`
		Attribution struct {
			Jmdict   bool `json:"jmdict"`
			Jmnedict bool `json:"jmnedict"`
			Dbpedia  bool `json:"dbpedia"`
		} `json:"attribution"`
	} `json:"data"`
}

type Sentence

type Sentence struct {
}

Jump to

Keyboard shortcuts

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