mirror of
https://github.com/SamyRai/tercul-backend.git
synced 2025-12-27 05:11:34 +00:00
- 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
22 lines
750 B
Go
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)
|
|
}
|
|
|
|
|