Documentation ¶
Index ¶
- func TTS(text string, voice Voice) (string, error)
- func Translate(text string, source Language, target Language, opt TranslateOptions) (string, error)
- type Dict
- type DictItem
- type Gender
- type ItemPos
- type Language
- type PhoneticSign
- type Pitch
- type PosMeaning
- type Speed
- type TranslateOptions
- type TranslateResponse
- type Voice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DictItem ¶
type DictItem struct { Entry string SubEntry string MatchType string HanjaEntry string PhoneticSigns []PhoneticSign Pos []ItemPos Source string URL string MURL string }
DictItem is an entry in a Dict structure
type Language ¶
type Language int32
Language defines supported languages by Papago
const ( Korean Language = iota English Japanese Chinese TraditionalChinese Spanish French German Russian Portuguese Italian Vietnamese Thai Indonesian Hindi )
Languages supported by Papago
func ParseLanguageCode ¶
ParseLanguageCode returns the corresponding Language for a given code
func SupportedLanguages ¶
func SupportedLanguages() []Language
SupportedLanguages returns the languages supported by Papago
func (Language) FemaleVoice ¶
FemaleVoice returns the name of the female voice for that Language
type PhoneticSign ¶
PhoneticSign describes the phonetic sign in a DictItem
type PosMeaning ¶
type PosMeaning struct {
Meaning string
}
PosMeaning describes the pos meaning in a DictItem
type TranslateOptions ¶
type TranslateOptions struct { // Dict controls wether to request the dictionary Dict bool // DictDisplay sets the maximum amount of entries in the dictionary DictDisplay int // Instant requests instant translation Instant bool // Paging request Paging bool // Source is the language code for the source language Source string // Target is the language code for the target language Target string // Honorific requests honorific translation (from en to ko only) Honorific bool // Text is the string to be translated from the source to the target language Text string }
TranslateOptions defines the options for the Translate function
func (TranslateOptions) String ¶
func (opt TranslateOptions) String() string
Click to show internal directories.
Click to hide internal directories.