nihongo

package
v0.0.0-...-719087c Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Translate

func Translate(source, sourceLang, targetLang string) (string, error)

Types

type DictionaryService

type DictionaryService struct {
	// contains filtered or unexported fields
}

func NewDictionaryService

func NewDictionaryService() *DictionaryService

func (*DictionaryService) Lookup

func (ds *DictionaryService) Lookup(word string) (*WordInfo, error)

type Token

type Token struct {
	Features     []string `json:"features"`
	Start        int      `json:"start"`
	End          int      `json:"end"`
	Surface      string   `json:"surface"`
	Translation  string   `json:"translation"`
	PartOfSpeech string   `json:"partOfSpeech"`
}

func Tokenize

func Tokenize(text string) []Token

type WordInfo

type WordInfo struct {
	Definitions   []string `json:"definitions"`
	PartsOfSpeech []string `json:"partsOfSpeech"`
	Notes         []string `json:"notes"`
	Surface       string   `json:"surface"`
}

func (WordInfo) Print

func (w WordInfo) Print()

Jump to

Keyboard shortcuts

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