tercul-backend/internal/enrich/registry.go
Damir Mukimov 4957117cb6 Initial commit: Tercul Go project with comprehensive architecture
- Core Go application with GraphQL API using gqlgen
- Comprehensive data models for literary works, authors, translations
- Repository pattern with caching layer
- Authentication and authorization system
- Linguistics analysis capabilities with multiple adapters
- Vector search integration with Weaviate
- Docker containerization support
- Python data migration and analysis scripts
- Clean architecture with proper separation of concerns
- Production-ready configuration and middleware
- Proper .gitignore excluding vendor/, database files, and build artifacts
2025-08-13 07:42:32 +02:00

55 lines
1.0 KiB
Go

package enrich
// Registry holds all the text analysis services
type Registry struct {
Lang *LanguageDetector
Tok *Tokenizer
Pos *POSTagger
Lem *Lemmatizer
Phon *PhoneticEncoder
Key *KeywordExtractor
Poet *PoeticAnalyzer
}
// DefaultRegistry creates a new Registry with default implementations
func DefaultRegistry() *Registry {
return &Registry{
Lang: NewLanguageDetector(),
Tok: NewTokenizer(),
Pos: NewPOSTagger(),
Lem: NewLemmatizer(),
Phon: NewPhoneticEncoder(),
Key: NewKeywordExtractor(),
Poet: NewPoeticAnalyzer(),
}
}
// Text represents a text to be analyzed
type Text struct {
ID uint
Body string
}
// Token represents a token in a text
type Token struct {
Text string
Position int
Offset int
Length int
}
// Keyword represents a keyword extracted from a text
type Keyword struct {
Text string
Relevance float64
}
// PoeticMetrics represents metrics from poetic analysis
type PoeticMetrics struct {
RhymeScheme string
MeterType string
StanzaCount int
LineCount int
Structure string
}