Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTatoebaSentenceAlreadyExists = errors.New("tatoebaSentence already exists")
View Source
var ErrTranslationAlreadyExists = errors.New("custsomtranslation already exists")
View Source
var ErrTranslationNotFound = errors.New("translation not found")
Functions ¶
This section is empty.
Types ¶
type TatoebaClient ¶
type TatoebaClient interface { FindSentencePairs(ctx context.Context, param TatoebaSentenceSearchCondition) (*TatoebaSentencePairSearchResult, error) FindSentenceBySentenceNumber(ctx context.Context, sentenceNumber int) (TatoebaSentence, error) ImportSentences(ctx context.Context, reader io.Reader) error ImportLinks(ctx context.Context, reader io.Reader) error }
type TatoebaSentence ¶
type TatoebaSentence interface { GetSentenceNumber() int GetLang2() appD.Lang2 GetText() string GetAuthor() string GetUpdatedAt() time.Time }
func NewTatoebaSentence ¶
type TatoebaSentencePair ¶
type TatoebaSentencePair interface { GetSrc() TatoebaSentence GetDst() TatoebaSentence }
func NewTatoebaSentencePair ¶
func NewTatoebaSentencePair(src, dst TatoebaSentence) (TatoebaSentencePair, error)
type TatoebaSentencePairSearchResult ¶
type TatoebaSentencePairSearchResult struct { TotalCount int64 Results []TatoebaSentencePair }
type TatoebaSentenceSearchCondition ¶
type TatoebaSentenceSearchCondition interface { GetPageNo() int GetPageSize() int GetKeyword() string IsRandom() bool }
func NewTatoebaSentenceSearchCondition ¶
func NewTatoebaSentenceSearchCondition(pageNo, pageSize int, keyword string, random bool) (TatoebaSentenceSearchCondition, error)
type TranslationAddParameter ¶
type TranslationAddParameter interface { GetText() string GetPos() domain.WordPos GetLang2() appD.Lang2 GetTranslated() string }
type TranslationUpdateParameter ¶
type TranslationUpdateParameter interface {
GetTranslated() string
}
func NewTransaltionUpdateParameter ¶
func NewTransaltionUpdateParameter(translated string) (TranslationUpdateParameter, error)
type TranslatorClient ¶
type TranslatorClient interface { DictionaryLookup(ctx context.Context, fromLang, toLang appD.Lang2, text string) ([]domain.Translation, error) DictionaryLookupWithPos(ctx context.Context, fromLang, toLang appD.Lang2, text string, pos domain.WordPos) (domain.Translation, error) FindTranslationsByFirstLetter(ctx context.Context, lang2 appD.Lang2, firstLetter string) ([]domain.Translation, error) FindTranslationByTextAndPos(ctx context.Context, lang2 appD.Lang2, text string, pos domain.WordPos) (domain.Translation, error) FindTranslationsByText(ctx context.Context, lang2 appD.Lang2, text string) ([]domain.Translation, error) AddTranslation(ctx context.Context, param TranslationAddParameter) error UpdateTranslation(ctx context.Context, lang2 appD.Lang2, text string, pos domain.WordPos, param TranslationUpdateParameter) error RemoveTranslation(ctx context.Context, lang2 appD.Lang2, text string, pos domain.WordPos) error }
Click to show internal directories.
Click to hide internal directories.