Versions in this module Expand all Collapse all v0 v0.1.2 Feb 18, 2024retracted v0.1.0 Feb 15, 2024 Changes in this version + var ErrClosed = errors.New("pool closed") + var ErrLexicalShortlistMissing = errors.New("lexical shortlist is required") + var ErrModelMissing = errors.New("model is required") + var ErrVocabularyMissing = errors.New("vocabulary is required") + func DefaultBergamotOptions() map[string]any + type Config struct + BergamotOptions map[string]any + CacheSize uint + WASMCache wazero.CompilationCache + WASMUseContext bool + func (cfg Config) Validate() error + type FilesBundle struct + LexicalShortlist io.Reader + Model io.Reader + Vocabulary io.Reader + type Pool struct + func NewPool(ctx context.Context, cfg PoolConfig) (*Pool, error) + func (p *Pool) Close(ctx context.Context) error + func (p *Pool) Translate(ctx context.Context, request TranslationRequest) (string, error) + func (p *Pool) TranslateMultiple(ctx context.Context, requests ...TranslationRequest) ([]string, error) + type PoolConfig struct + PoolSize uint + func (cfg PoolConfig) Validate() error + type TranslationOptions struct + HTML bool + type TranslationRequest struct + Options TranslationOptions + Text string + type Translator struct + func New(ctx context.Context, cfg Config) (*Translator, error) + func (t *Translator) Close(ctx context.Context) error + func (t *Translator) Translate(ctx context.Context, request TranslationRequest) (string, error) + func (t *Translator) TranslateMultiple(ctx context.Context, requests ...TranslationRequest) ([]string, error)