skkserv

package
v0.0.0-...-59d361e Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	COMMAND_END     = '0'
	COMMAND_REQUEST = '1'
	COMMAND_VERSION = '2'
	COMMAND_HOST    = '3'
)
View Source
const (
	VERSION = "0.1.0"
)

Variables

This section is empty.

Functions

func EucToString

func EucToString(euc []byte) string

func StringToEuc

func StringToEuc(str string) ([]byte, error)

Types

type Config

type Config struct {
	Host    string
	Port    int
	Engines []Engine
	Debug   bool
}

type Database

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

func LoadDatabase

func LoadDatabase(cdbPath string) (db *Database, err error)

Load SKK CDB database. Return error if open failed.

The database must be encoded in EUC-JP.

func (*Database) Search

func (d *Database) Search(query string) (cands []string)

type Engine

type Engine interface {
	Search(query string) (cands []string)
}

type Getter

type Getter func(url string) (resp *http.Response, err error)

type GoogleJapaneseInput

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

GoogleJapaneseInput is a local google japanese input client.

func NewGoogleJapaneseInput

func NewGoogleJapaneseInput() (*GoogleJapaneseInput, error)

NewGoogleJapaneseInput creates google japanese input based translation engine.

func (*GoogleJapaneseInput) Close

func (g *GoogleJapaneseInput) Close()

Close cleanups resources used by the class.

func (*GoogleJapaneseInput) Search

func (g *GoogleJapaneseInput) Search(query string) (cands []string)

Search responds to translation queries.

type GoogleTrans

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

func NewGoogleTrans

func NewGoogleTrans() *GoogleTrans

func (*GoogleTrans) Search

func (g *GoogleTrans) Search(query string) (cands []string)

type Skkserv

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

func New

func New(config Config) *Skkserv

func (*Skkserv) HandleRequest

func (s *Skkserv) HandleRequest(conn net.Conn)

Jump to

Keyboard shortcuts

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