models

package
v0.1.49 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: MIT Imports: 1 Imported by: 41

Documentation

Index

Constants

View Source
const (
	MEDIA       string = "media"
	AUTHORBASED string = "authorbased"
	MULTICHOICE string = "multiplechoice"
	DIALOGUE    string = "dialogue"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregate added in v0.1.10

type Aggregate struct {
	HighestSet string `json:"highestSet"`
	Name       string `json:"name"`
}

type AggregateResult added in v0.1.10

type AggregateResult struct {
	Aggregates []Aggregate `json:"aggregates"`
}

type AggregatedOptions added in v0.1.39

type AggregatedOptions struct {
	Themes []Theme `json:"themes"`
}

type AggregationResult added in v0.1.20

type AggregationResult struct {
	Authors []ESAuthor `json:"authors"`
}

type AnalyzeResult added in v0.1.20

type AnalyzeResult struct {
	// example: text/author=herodotos&book=histories&reference=1.1
	ReferenceLink string `json:"referenceLink"`
	// example: Herodotos
	// required: true
	Author string `json:"author"`
	// example: Histories
	// required: true
	Book string `json:"book"`
	// example: 1.1
	// required: true
	Reference string `json:"reference"`
	Text      Rhema  `json:"text"`
}

type AnalyzeTextRequest added in v0.1.20

type AnalyzeTextRequest struct {
	// example: Ἀθηναῖος
	// required: true
	Rootword string `json:"rootword"`
}

type AnalyzeTextResponse added in v0.1.20

type AnalyzeTextResponse struct {
	// example: Ἀθηναῖος
	// required: true
	Rootword string `json:"rootword"`
	// example: ["Ἀθηναῖος"]
	// required: true
	PartOfSpeech string          `json:"partOfSpeech"`
	Conjugations []Conjugations  `json:"conjugations"`
	Results      []AnalyzeResult `json:"texts"`
}

type AnswerRequest added in v0.1.10

type AnswerRequest struct {
	Theme         string            `json:"theme"`
	Set           string            `json:"set"`
	QuizType      string            `json:"quizType"`
	Segment       string            `json:"segment,omitempty"`
	Comprehensive bool              `json:"comprehensive,omitempty"`
	Answer        string            `json:"answer"`
	Dialogue      []DialogueContent `json:"dialogue,omitempty"`
	QuizWord      string            `json:"quizWord"`
}

type AnswerSection added in v0.1.20

type AnswerSection struct {
	// example: a
	// required: false
	Section string `json:"section"`
	// example: 9.09
	// required: true
	LevenshteinPercentage string `json:"levenshteinPercentage"`
	// example: Such a step would not be condemned either by the gods who received our oaths,
	// required: true
	QuizSentence string `json:"quizSentence"`
	// example: this is an example answer"
	// required: true
	AnswerSentence string `json:"answerSentence"`
}

type AuthorBasedContent added in v0.1.9

type AuthorBasedContent struct {
	Greek               string            `json:"greek"`
	Translation         string            `json:"translation"`
	WordsInText         []string          `json:"wordsInText"`
	HasGrammarQuestions bool              `json:"hasGrammarQuestions"`
	GrammarQuestions    []GrammarQuestion `json:"grammarQuestions,omitempty"`
}

type AuthorBasedResponse added in v0.1.33

type AuthorBasedResponse struct {
	Correct     bool     `json:"correct"`
	QuizWord    string   `json:"quizWord"`
	WordsInText []string `json:"wordsInText,omitempty"`
}

type AuthorbasedQuiz added in v0.1.29

type AuthorbasedQuiz struct {
	QuizType               string                 `json:"quizType"`
	Theme                  string                 `json:"theme"`
	Set                    int                    `json:"set"`
	Segment                string                 `json:"segment,omitempty"`
	Reference              string                 `json:"reference"`
	FullSentence           string                 `json:"fullSentence"`
	Translation            string                 `json:"translation"`
	GrammarQuestionOptions GrammarQuestionOptions `json:"grammarQuestionOptions"`
	Content                []AuthorBasedContent   `json:"content"`
}

type AuthorbasedQuizResponse added in v0.1.31

type AuthorbasedQuizResponse struct {
	FullSentence string             `json:"fullSentence"`
	Translation  string             `json:"translation"`
	Reference    string             `json:"reference"`
	Quiz         QuizResponse       `json:"quiz"`
	GrammarQuiz  []GrammarQuizAdded `json:"grammarQuiz,omitempty"`
}

type Biblos

type Biblos struct {
	Biblos []Meros `json:"biblos"`
}

func UnmarshalBiblos

func UnmarshalBiblos(data []byte) (Biblos, error)

func (*Biblos) Marshal

func (r *Biblos) Marshal() ([]byte, error)

type CheckTextRequest added in v0.1.20

type CheckTextRequest struct {
	Translations []Translations `json:"translations"`
	// example: Herodotos
	// required: true
	Author string `json:"author"`
	// example: Histories
	// required: true
	Book string `json:"book"`
	// example: 1.1
	// required: true
	Reference string `json:"reference"`
}

type CheckTextResponse added in v0.1.20

type CheckTextResponse struct {
	AverageLevenshteinPercentage string          `json:"averageLevenshteinPercentage"`
	Sections                     []AnswerSection `json:"sections"`
	PossibleTypos                []Typo          `json:"possibleTypos"`
}

type ComprehensiveResponse added in v0.1.10

type ComprehensiveResponse struct {
	Correct      bool                `json:"correct"`
	QuizWord     string              `json:"quizWord"`
	FoundInText  AnalyzeTextResponse `json:"foundInText,omitempty"`
	SimilarWords []Meros             `json:"similarWords,omitempty"`
	Progress     struct {
		TimesCorrect    int     `json:"timesCorrect"`
		TimesIncorrect  int     `json:"timesIncorrect"`
		AverageAccuracy float64 `json:"averageAccuracy"`
	} `json:"progress,omitempty"`
}

type Conjugations added in v0.1.25

type Conjugations struct {
	Word string `json:"word"`
	Rule string `json:"rule"`
}

type CreateTextRequest added in v0.1.20

type CreateTextRequest struct {
	// example: Herodotos
	// required: true
	Author string `json:"author"`
	// example: Histories
	// required: true
	Book string `json:"book"`
	// example: 1.1
	// required: true
	Reference string `json:"reference"`
	// example: a
	// required: false
	Section string `json:"section"`
}

type CreationRequest added in v0.1.10

type CreationRequest struct {
	Theme        string   `json:"theme"`
	Set          string   `json:"set"`
	Segment      string   `json:"segment,omitempty"`
	QuizType     string   `json:"quizType"`
	Order        string   `json:"order"`
	ExcludeWords []string `json:"excludeWords"`
}

type DatabaseHealth

type DatabaseHealth struct {
	// example: true
	Healthy bool `json:"healthy"`
	// example: aristoteles
	ClusterName string `json:"clusterName,omitempty"`
	// example: aristoteles-es-worker-0
	ServerName string `json:"serverName,omitempty"`
	// example: 8.8.0
	ServerVersion string `json:"serverVersion,omitempty"`
}

type Declension

type Declension struct {
	Name        string              `json:"name"`
	Type        string              `json:"type,omitempty"`
	Dialect     string              `json:"dialect"`
	Declensions []DeclensionElement `json:"declensions"`
}

type DeclensionConfig

type DeclensionConfig struct {
	Declensions []Declension
}

type DeclensionElement

type DeclensionElement struct {
	Declension string   `json:"declension"`
	RuleName   string   `json:"ruleName"`
	SearchTerm []string `json:"searchTerm"`
}

type DeclensionTranslationResults

type DeclensionTranslationResults struct {
	Results []Result `json:"results"`
}

func (*DeclensionTranslationResults) RemoveIndex

func (r *DeclensionTranslationResults) RemoveIndex(index int)

type Dialogue added in v0.1.8

type Dialogue struct {
	Introduction string `json:"introduction"`
	Speakers     []struct {
		Name        string `json:"name"`
		Shorthand   string `json:"shorthand"`
		Translation string `json:"translation"`
	} `json:"speakers"`
	Section       string `json:"section"`
	LinkToPerseus string `json:"linkToPerseus"`
}

type DialogueAnswer added in v0.1.10

type DialogueAnswer struct {
	Percentage   float64              `json:"percentage"`
	Input        []DialogueContent    `json:"input"`
	Answer       []DialogueContent    `json:"answer"`
	InWrongPlace []DialogueCorrection `json:"wronglyPlaced"`
}

type DialogueContent added in v0.1.8

type DialogueContent struct {
	Translation string `json:"translation"`
	Greek       string `json:"greek,omitempty"`
	Place       int    `json:"place,omitempty"`
	Speaker     string `json:"speaker,omitempty"`
}

type DialogueCorrection added in v0.1.10

type DialogueCorrection struct {
	Translation  string `json:"translation"`
	Greek        string `json:"greek,omitempty"`
	Place        int    `json:"place,omitempty"`
	Speaker      string `json:"speaker,omitempty"`
	CorrectPlace int    `json:"correctPlace,omitempty"`
}

type DialogueQuiz added in v0.1.8

type DialogueQuiz struct {
	QuizMetadata struct {
		Language string `json:"language"`
	} `json:"quizMetadata"`
	Theme     string            `json:"theme,omitempty"`
	QuizType  string            `json:"quizType"`
	Set       int               `json:"set,omitempty"`
	Segment   string            `json:"segment,omitempty"`
	Reference string            `json:"reference,omitempty"`
	Dialogue  Dialogue          `json:"dialogue,omitempty"`
	Content   []DialogueContent `json:"content"`
}

type ESAuthor added in v0.1.20

type ESAuthor struct {
	Key   string   `json:"key"`
	Books []ESBook `json:"books"`
}

type ESBook added in v0.1.20

type ESBook struct {
	Key        string      `json:"key"`
	References []Reference `json:"references"`
}

type ElasticErrorMessage

type ElasticErrorMessage struct {
	ElasticError string `json:"elasticError"`
}

swagger:model

type ElasticSearchError

type ElasticSearchError struct {
	ErrorModel
	Message ElasticErrorMessage `json:"errorModel"`
}

swagger:model

func (*ElasticSearchError) Error

func (m *ElasticSearchError) Error() string

type ErrorModel

type ErrorModel struct {
	// required: true
	// example: 94374b4f-3dda-4ffb-b33b-2cb6ba092b84
	UniqueCode string `json:"uniqueCode"`
}

swagger:model ErrorModel is the base model used for handling errors

type ExtendedResponse added in v0.1.13

type ExtendedResponse struct {
	Hits []Hit `json:"hits,omitempty"`
}

type FoundRules

type FoundRules struct {
	Rules []Rule `json:"rules"`
}

type GrammarQuestion added in v0.1.42

type GrammarQuestion struct {
	CorrectAnswer    string `json:"correctAnswer"`
	TypeOfWord       string `json:"typeOfWord"`
	WordInText       string `json:"wordInText"`
	ExtraInformation string `json:"extraInformation"`
}

type GrammarQuestionOptions added in v0.1.42

type GrammarQuestionOptions struct {
	Nouns []string `json:"nouns"`
	Verbs []string `json:"verbs"`
	Misc  []string `json:"misc"`
}

type GrammarQuizAdded added in v0.1.44

type GrammarQuizAdded struct {
	CorrectAnswer    string    `json:"correctAnswer"`
	WordInText       string    `json:"wordInText"`
	ExtraInformation string    `json:"extraInformation"`
	Options          []Options `json:"options,omitempty"`
}

type Health

type Health struct {
	// example: true
	Healthy bool `json:"healthy"`
	// example: 2023-06-07 15:02:11.678766777 +0000 UTC m=+5090.268683461
	Time     string         `json:"time"`
	Version  string         `json:"version,omitempty"`
	Database DatabaseHealth `json:"databaseHealth,omitempty"`
	Memory   Memory         `json:"memory,omitempty"`
}

func UnmarshalHealth

func UnmarshalHealth(data []byte) (Health, error)

func (*Health) Marshal

func (r *Health) Marshal() ([]byte, error)

type Hit added in v0.1.13

type Hit struct {
	Hit         Meros                `json:"hit"`
	FoundInText *AnalyzeTextResponse `json:"foundInText,omitempty"`
}

type Logos

type Logos struct {
	Logos []Word `json:"logos"`
}

swagger:model

func UnmarshalLogos

func UnmarshalLogos(data []byte) (Logos, error)

func (*Logos) Marshal

func (r *Logos) Marshal() ([]byte, error)

type MediaContent added in v0.1.9

type MediaContent struct {
	Translation string `json:"translation"`
	Greek       string `json:"greek,omitempty"`
	ImageURL    string `json:"imageURL,omitempty"`
	AudioFile   string `json:"audioFile,omitempty"`
}

type MediaQuiz added in v0.1.9

type MediaQuiz struct {
	QuizMetadata struct {
		Language string `json:"language"`
	} `json:"quizMetadata"`
	QuizType string         `json:"quizType"`
	Set      int            `json:"set,omitempty"`
	Theme    string         `json:"theme,omitempty"`
	Segment  string         `json:"segment,omitempty"`
	Content  []MediaContent `json:"content"`
	Progress struct {
		TimesCorrect    int     `json:"timesCorrect"`
		TimesIncorrect  int     `json:"timesIncorrect"`
		AverageAccuracy float64 `json:"averageAccuracy"`
	} `json:"progress,omitempty"`
}

type Memory

type Memory struct {
	Free       uint64 `json:"free,omitempty"`
	Alloc      uint64 `json:"alloc,omitempty"`
	TotalAlloc uint64 `json:"totalAlloc,omitempty"`
	Sys        uint64 `json:"sys,omitempty"`
	Unit       string `json:"unit,omitempty"`
}

type Meros

type Meros struct {
	// example: ὄνος
	// required: true
	Greek string `json:"greek"`
	// example: an ass
	// required: true
	English string `json:"english"`
	// example: ezel
	// required: false
	Dutch string `json:"dutch,omitempty"`
	// required: false
	LinkedWord string `json:"linkedWord,omitempty"`
	// required: false
	Original string `json:"original,omitempty"`
}

func UnmarshalMeros

func UnmarshalMeros(data []byte) (Meros, error)

func (*Meros) Marshal

func (r *Meros) Marshal() ([]byte, error)

type MethodError

type MethodError struct {
	ErrorModel
	Messages []MethodMessages `json:"errorModel"`
}

swagger:model

type MethodMessages

type MethodMessages struct {
	// example: GET
	Methods string `json:"allowedMethods"`
	// example: Method DELETE not allowed at this endpoint
	Message string `json:"methodError"`
}

MethodMessages messages used in method error swagger:model

type MultipleChoiceContent added in v0.1.29

type MultipleChoiceContent struct {
	Translation     string  `json:"translation"`
	TimesCorrect    int     `json:"timesCorrect,omitempty"`
	TimesIncorrect  int     `json:"timesIncorrect,omitempty"`
	AverageAccuracy float64 `json:"averageAccuracy,omitempty"`
	Greek           string  `json:"greek,omitempty"`
}

type MultipleChoiceQuiz added in v0.1.29

type MultipleChoiceQuiz struct {
	QuizMetadata struct {
		Language string `json:"language"`
	} `json:"quizMetadata"`
	QuizType string                  `json:"quizType"`
	Theme    string                  `json:"theme,omitempty"`
	Set      int                     `json:"set,omitempty"`
	Content  []MultipleChoiceContent `json:"content"`
	Progress struct {
		TimesCorrect    int     `json:"timesCorrect"`
		TimesIncorrect  int     `json:"timesIncorrect"`
		AverageAccuracy float64 `json:"averageAccuracy"`
	} `json:"progress,omitempty"`
}

type NotFoundError

type NotFoundError struct {
	ErrorModel
	Message NotFoundMessage `json:"errorModel"`
}

swagger:model

func (*NotFoundError) Error

func (m *NotFoundError) Error() string

type NotFoundMessage

type NotFoundMessage struct {
	// example: query for obscura
	Type string `json:"type"`
	// example: produced 0 results
	Reason string `json:"reason"`
}

swagger:model

type Options added in v0.1.10

type Options struct {
	Option   string `json:"quizWord"`
	AudioUrl string `json:"audioUrl,omitempty"`
	ImageUrl string `json:"imageUrl,omitempty"`
}

type QuizAttempt added in v0.1.10

type QuizAttempt struct {
	Correct  bool
	Set      string
	Theme    string
	QuizType string
}

type QuizResponse

type QuizResponse struct {
	QuizItem      string    `json:"quizItem"`
	NumberOfItems int       `json:"numberOfItems"`
	Options       []Options `json:"options,omitempty"`
}

type Reference added in v0.1.20

type Reference struct {
	Key      string    `json:"key"`
	Sections []Section `json:"sections"`
}

type Result

type Result struct {
	// example: ἔβαλλε
	// required: true
	Word string `json:"word"`
	// example: 3th sing - impf - ind - act
	// required: true
	Rule string `json:"rule"`
	// example: βαλλω
	// required: true
	RootWord string `json:"rootWord"`
	// example: [throw, to throw]
	// required: true
	Translation []string `json:"translations"`
}

type ResultModel

type ResultModel struct {
	// example: pong
	// required: true
	Result string `json:"result"`
}

swagger:model

type Rhema

type Rhema struct {
	Greek        string   `json:"greek"`
	Translations []string `json:"translations"`
	Section      string   `json:"section"`
}

type Rule

type Rule struct {
	Rule        string   `json:"rule,omitempty"`
	SearchTerms []string `json:"searchTerm,omitempty"`
	Type        string   `json:"type,omitempty"`
}

type Section added in v0.1.20

type Section struct {
	Key string `json:"key"`
}

type Segment added in v0.1.39

type Segment struct {
	Name   string  `json:"name"`
	MaxSet float64 `json:"maxSet"`
}

type SolonCreationRequest

type SolonCreationRequest struct {
	// example: api
	// required: true
	Role string `json:"roles"`
	// example: [grammar dictionary]
	// required: true
	Access []string `json:"access"`
	// example: dionysios-544c584d7f-6sp6x
	// required: true
	PodName string `json:"podName"`
	// example: dionysios
	// required: true
	Username string `json:"username"`
}

swagger:model

func UnmarshalSolonCreationRequest

func UnmarshalSolonCreationRequest(data []byte) (SolonCreationRequest, error)

func (*SolonCreationRequest) Marshal

func (r *SolonCreationRequest) Marshal() ([]byte, error)

type SolonResponse

type SolonResponse struct {
	// example: true
	// required: true
	UserCreated bool `json:"userCreated"`
	// example: true
	// required: true
	SecretCreated bool `json:"secretCreated"`
}

swagger:model

func (*SolonResponse) Marshal

func (r *SolonResponse) Marshal() ([]byte, error)

type Text added in v0.1.20

type Text struct {
	Author          string  `json:"author"`
	Book            string  `json:"book"`
	Type            string  `json:"type"`
	Reference       string  `json:"reference"`
	PerseusTextLink string  `json:"perseusTextLink"`
	Rhemai          []Rhema `json:"rhemai"`
}

type Theme added in v0.1.39

type Theme struct {
	Name     string    `json:"name"`
	Segments []Segment `json:"segments"`
}

type TokenResponse

type TokenResponse struct {
	// example: s.1283745jdf83r3
	// required: true
	Token string `json:"token"`
}

swagger:model

func (*TokenResponse) Marshal

func (r *TokenResponse) Marshal() ([]byte, error)

type Translations added in v0.1.20

type Translations struct {
	// example: a
	// required: false
	Section string `json:"section"`
	// example: this is an example sentence
	// required: true
	Translation string `json:"translation"`
}

type Typo added in v0.1.20

type Typo struct {
	Source   string `json:"source"`
	Provided string `json:"provided"`
}

type ValidationError

type ValidationError struct {
	ErrorModel
	Messages []ValidationMessages `json:"errorModel"`
}

swagger:model ValidationError validation errors occur when data is malformed

type ValidationMessages

type ValidationMessages struct {
	// example: word
	Field string `json:"validationField"`
	// example: cannot be empty
	Message string `json:"validationMessage"`
}

swagger:model ValidationMessages messages used in validation error

type Word

type Word struct {
	// example: aristophanes
	// required: true
	Method string `json:"method"`
	// example: frogs
	// required: true
	Category string `json:"category"`
	// example: ὄνος
	// required: true
	Greek string `json:"greek"`
	// example: donkey
	// required: true
	Translation string `json:"translation"`
	// example: 1
	// required: true
	Chapter int64 `json:"chapter"`
}

swagger:model

func UnmarshalWord

func UnmarshalWord(data []byte) (Word, error)

func (*Word) Marshal

func (r *Word) Marshal() ([]byte, error)

Jump to

Keyboard shortcuts

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