tm

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package tm implements Translation Memory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QueryResult

type QueryResult struct {
	SegmentDescriptor
	Similarity int `json:"similarity"`
}

type SegmentDescriptor

type SegmentDescriptor struct {
	BookID     uint64 `json:"book_id,omitempty"`
	FragmentID uint64 `json:"fragment_id,omitempty"`
	Text       string `json:"text"`
}

type SegmentWalkFn

type SegmentWalkFn func(func(SegmentDescriptor)) error

type TranslationMemory

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

func NewTranslationMemory

func NewTranslationMemory(walk SegmentWalkFn) (*TranslationMemory, error)

func (*TranslationMemory) Add

func (*TranslationMemory) Delete

func (m *TranslationMemory) Delete(sd SegmentDescriptor)

func (*TranslationMemory) Query

func (m *TranslationMemory) Query(text string, similarity int, matchAll bool) []QueryResult

Jump to

Keyboard shortcuts

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