tercul-backend/linguistics/ports.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

22 lines
750 B
Go

package linguistics
// LanguageDetector defines a provider that can detect the language of a text
type LanguageDetector interface {
// DetectLanguage returns a BCP-47 or ISO-like code and whether detection was confident
DetectLanguage(text string) (string, bool)
}
// SentimentProvider defines a provider that scores sentiment in [-1, 1]
type SentimentProvider interface {
// Score returns sentiment for the text (optionally using language)
Score(text string, language string) (float64, error)
}
// KeywordProvider defines a provider that extracts keywords from text
type KeywordProvider interface {
// Extract returns a list of keywords with relevance in [0,1]
Extract(text string, language string) ([]Keyword, error)
}