package linguistics

import (
	"errors"
	"strings"
)

// --- LanguageDetector Adapters ---

// NullLanguageDetector provides a no-op detector that always fails detection
type NullLanguageDetector struct{}

func (n NullLanguageDetector) DetectLanguage(text string) (string, bool) {
	return "", false
}

// --- SentimentProvider Adapters ---

// RuleBasedSentimentProvider wraps the internal estimateSentimentOptimized as a provider
type RuleBasedSentimentProvider struct{}

func (r RuleBasedSentimentProvider) Score(text string, language string) (float64, error) {
	if strings.TrimSpace(text) == "" {
		return 0, errors.New("empty text")
	}
	return estimateSentimentOptimized(text, language), nil
}
