translators

package
v0.0.0-...-2155e2d Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2020 License: BSD-3-Clause Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccentTranslator

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

The AccentTranslator simulates translation into Western European languages.

func (*AccentTranslator) Translate

func (t *AccentTranslator) Translate(ctx context.Context, source nptl.Runes) (nptl.Runes, error)

Translate implements the nptl.Translator.Translate() method.

type Extender

type Extender interface {
	// Extend modifies Runes to be longer.
	Extend(ctx context.Context, source, target []rune) ([]rune, error)
}

An Extender is used to expand pseudo translated Runes to simulate more verbose languages. It may also add markers at the beginning and end to help identify concatenation.

type SimpleExtender

type SimpleExtender struct {
	Prefix          nptl.Runes
	Suffix          nptl.Runes
	Extender        rune
	ExtendFromFront bool
}

SimpleExtender sticks the prefix on the beginning, the suffix on the end, and then inserts the extender rune until the new target is at least 20% longer than the original source Runes.

func (*SimpleExtender) Extend

func (e *SimpleExtender) Extend(ctx context.Context, source, target []rune) ([]rune, error)

Extend implements the Extender.Extend() method.

Jump to

Keyboard shortcuts

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