wotoTranslate

package
v0.0.0-...-f800b22 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: GPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DoubleQS       = wv.BackSlash + wv.DoubleQ
	DoubleQSP      = DoubleQS + wv.CAMA
	NonEscapeN     = "\\n"
	NonEscapeNV    = NonEscapeN + wv.CAMA
	HttpRm         = "af.httprm"
	E4Value        = "\"e\"" + wv.CAMA + "4" + wv.CAMA
	NullCValue     = wv.NullStr + wv.CAMA
	GenericStr     = wv.CAMA + "\"generic\""
	NullCValueR    = wv.CAMA + wv.NullStr
	NeQ            = "\\n\""
	NullN          = "\n\"" + wv.CAMA + "null"
	DiValue        = "\"di\""
	AkCloseQ       = "}'"
	WrbFr          = "\"wrb.fr\",\"MkEWBc\""
	BoldOpen       = "\\u003cb\\u003e"
	BoldClose      = "\\u003c/b\\u003e"
	MiddleWave     = DoubleQSP + DoubleQS
	WrongNessOpen  = "\\u003cb\\\\u003e\\\\u003ci\\\\u003e"
	WrongNessClose = "\\\\u003c/i\\\\u003e\\\\u003c/b\\\\u003e"
	ThreeE         = wv.DoubleBackSlash + "u003e"
	CeeE           = wv.DoubleBackSlash + "u003c"
	QuetUnicode    = "u0026#39;"
)
View Source
const (
	BIN_FLAG     = "bin"
	BINARY_FLAG  = "binary"
	PV_FLAG      = "pv"
	PRIVATE_FLAG = "private"
)

the flags for the wotoTranslate plugin. please notice that all flags should begin with prefex --, but in the pTools, this prefex will be removed.

Variables

This section is empty.

Functions

func AtrGAuto

func AtrGAuto(to, text string) []string

trGAuto will translate the `text` from "auto" to `to` string and it will return the velue.

func TrGnuTxt

func TrGnuTxt(fr, to, text string) string

func TrHandler

func TrHandler(message *tg.Message, args pTools.Arg)

Types

type GoogleTr

type GoogleTr struct {
}

type Lang

type Lang struct {
	Data *LangData `json:"data"`
}

func DetectLanguage

func DetectLanguage(text string) *Lang

type LangData

type LangData struct {
	Detections []LangDetect `json:"detections"`
}

type LangDetect

type LangDetect struct {
	TheLang    string  `json:"language"`
	Reliable   bool    `json:"isReliable"`
	Confidence float32 `json:"confidence"`
}

type WotoTr

type WotoTr struct {
	UserText       string
	OriginalText   string
	TranslatedText string
	From           string
	To             string
	CorrectedValue string
	HasWrongNess   bool
	WrongFrom      bool
	Road           map[int]bool
}

func Translate

func Translate(lang *Lang, to, text string) *WotoTr

Translate will translate the specified text value tp english.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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