transmemory

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2020 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Results

type Results struct {
	Words []dicttypes.Word
}

Encapsulates search recults

type Searcher

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

Encapsulates translation memory searcher

func NewSearcher

func NewSearcher(ctx context.Context, database *sql.DB) (*Searcher, error)

Initialize SQL statement

func (*Searcher) DatabaseInitialized added in v0.0.15

func (searcher *Searcher) DatabaseInitialized() bool

Returns the word senses with English approximate or Pinyin exact match

func (*Searcher) Search

func (searcher *Searcher) Search(ctx context.Context,
	query string,
	domain string,
	wdict map[string]dicttypes.Word) (*Results, error)

Searches the translation memory for approximate matches. Parameters

ctx Request context
query The search query
domain The domain to restrict the query to (optional)
wdict The full dictionary

Retuns

A slice of approximate results

Jump to

Keyboard shortcuts

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