model

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 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 BaseResult added in v0.0.4

type BaseResult struct {
	Query        string
	Prompt       string
	IsEN         bool
	IsPhrase     bool
	Output       string
	Found        bool
	IsLongText   bool
	MachineTrans string
	History      chan int `json:"-"`
}

type Cache

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

type CollinsItem

type CollinsItem struct {
	Additional   string     `json:"a"`
	MajorTrans   string     `json:"maj"`
	ExampleLists [][]string `json:"eg"`
}

type DaemonResponse

type DaemonResponse struct {
	R     *Result
	Error string

	Base *BaseResult
}

func (*DaemonResponse) GetResult added in v0.0.4

func (dr *DaemonResponse) GetResult() *Result

type Result

type Result struct {
	*BaseResult `json:"-"`

	Keyword    string                `json:"k"`
	Pronounce  map[string]string     `json:"pron"`
	Paraphrase []string              `json:"para"`
	Examples   map[string][][]string `json:"eg"`
	Collins    struct {
		Star              int    `json:"star"`
		ViaRank           string `json:"rank"`
		AdditionalPattern string `json:"pat"`

		Items []*CollinsItem `json:"li"`
	} `json:"co"`
}

func (*Result) Initialize

func (r *Result) Initialize()

func (*Result) ToDaemonResponse added in v0.0.4

func (r *Result) ToDaemonResponse() *DaemonResponse

type RunInfo added in v0.0.6

type RunInfo struct {
	StartTime int64
	PID       int
	Port      string
	ExeName   string
	ExePath   string
	Version   string

	OS *pkg.OSInfo
	// contains filtered or unexported fields
}

func (*RunInfo) GetOSInfo added in v0.0.10

func (r *RunInfo) GetOSInfo() *pkg.OSInfo

func (*RunInfo) GetTermSize added in v0.0.6

func (r *RunInfo) GetTermSize() (int, int, error)

func (*RunInfo) IsServer added in v0.0.6

func (r *RunInfo) IsServer() bool

func (*RunInfo) SaveToFile added in v0.0.6

func (r *RunInfo) SaveToFile(path string) (err error)

func (*RunInfo) SetOSInfo added in v0.0.10

func (r *RunInfo) SetOSInfo()

func (*RunInfo) SetPort added in v0.0.6

func (r *RunInfo) SetPort(v string)

func (*RunInfo) SetServer added in v0.0.6

func (r *RunInfo) SetServer(v bool)

type TCPQuery added in v0.0.4

type TCPQuery struct {
	Action string
	B      *BaseResult
}

func (*TCPQuery) GetResult added in v0.0.4

func (q *TCPQuery) GetResult() *Result

type Word

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳