engine

package
v0.0.0-...-7e22817 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package engine implements translation support for the translation engine so that the need for translating text can be achieved by creating specific translation engine.

Source code and other details for the project are available at GitHub:

https://github.com/archervanderwaal/jadetrans

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine interface {
	Query() (res string, err error)
}

Engine Represents a translation engine.

type YoudaoEngine

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

YoudaoEngine contains some parameters that you want to use youdao Translation Service.

func NewYoudaoEngine

func NewYoudaoEngine(query, from, to, voice string, conf *config.Config) *YoudaoEngine

NewYoudaoEngine create a translation engine for you based on youdao Translation Service.

func (*YoudaoEngine) Query

func (e *YoudaoEngine) Query() (res string, err error)

Query returns the translation results without errors.

Jump to

Keyboard shortcuts

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