simplytranslate

package
v0.0.0-...-ab80a50 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Response

type Response struct {
	DefinitionsByCategory map[string][]struct {
		Definition    string              `json:"definition,omitempty"`
		Dictionary    string              `json:"dictionary,omitempty"`
		UseInSentence string              `json:"use-in-sentence,omitempty"`
		Synonyms      map[string][]string `json:"synonyms,omitempty"`
		Informal      string              `json:"informal,omitempty"`
	} `json:"definitions"`
	TranslatedText    string `json:"translated-text"`
	SingleTranslation map[string]map[string]struct {
		Words     []string `json:"words,omitempty"`
		Frequency string   `json:"frequency,omitempty"`
	} `json:"translations,omitempty"`
}

func (Response) PrettyPrint

func (r Response) PrettyPrint() string

func (Response) ShortTranslatedText

func (r Response) ShortTranslatedText() string

type SimplyTranslate

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

func New

func New() SimplyTranslate

func (SimplyTranslate) TextToSpeech

func (b SimplyTranslate) TextToSpeech(text, lang string) ([]byte, error)

func (SimplyTranslate) Translate

func (b SimplyTranslate) Translate(text, source, target, engine string) (utils.BackendResponse, error)

Jump to

Keyboard shortcuts

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