transmemory

package
v0.0.181 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Overview

Package for translation memory search

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 interface {

	// Search for phrases similar to the given query, optionally with a particular domain
	// 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
	Search(ctx context.Context, query string, domain string, includeSubstrings bool, wdict map[string]*dicttypes.Word) (*Results, error)
}

Searcher finds similar phrases

func NewFSSearcher added in v0.0.151

func NewFSSearcher(client dictionary.FsClient, corpus string, generation int, revIndex dictionary.ReverseIndex) (Searcher, error)

NewFSSearcher initializes a Searcher implementation based on Firestore queries

type TMIndexDomain added in v0.0.149

type TMIndexDomain struct {
	Ch     string `firestore:"ch"`
	Word   string `firestore:"word"`
	Domain string `firestore:"domain"`
}

TMIndexDomain holds characters for a term with domain

type TMIndexUnigram added in v0.0.148

type TMIndexUnigram struct {
	Ch   string `firestore:"ch"`
	Word string `firestore:"word"`
}

TMIndexUnigram holds characters for a term, used as an index for translation memory

Jump to

Keyboard shortcuts

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