tercul-backend/internal/jobs/linguistics/ports.go
google-labs-jules[bot] 8797cec718 Refactor: In-progress refactoring to fix build.
This commit includes the following changes:
- Refactored all data repositories in `internal/data/sql/` to use a consistent `sql` package and to align with the new `domain` models.
- Fixed the GraphQL structure by moving the server creation logic from `internal/app` to `cmd/api`, which resolved an import cycle.
- Corrected numerous incorrect import paths for packages like `graph`, `linguistics`, `syncjob`, and the legacy `models` package.
- Resolved several package and function redeclaration errors.
- Removed legacy migration code.
2025-09-05 15:11:30 +00:00

20 lines
731 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, error)
}
// 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)
}