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
44 lines
968 B
Go
44 lines
968 B
Go
package linguistics
|
|
|
|
// AnalysisResult contains the results of linguistic analysis
|
|
type AnalysisResult struct {
|
|
// Basic text statistics
|
|
WordCount int
|
|
SentenceCount int
|
|
ParagraphCount int
|
|
AvgWordLength float64
|
|
AvgSentenceLength float64
|
|
|
|
// Readability metrics
|
|
ReadabilityScore float64
|
|
ReadabilityMethod string
|
|
|
|
// Linguistic features
|
|
PartOfSpeechCounts map[string]int
|
|
Entities []Entity
|
|
Keywords []Keyword
|
|
|
|
// Semantic analysis
|
|
Sentiment float64 // -1.0 to 1.0 (negative to positive)
|
|
Topics []Topic
|
|
}
|
|
|
|
// Entity represents a named entity found in text
|
|
type Entity struct {
|
|
Text string
|
|
Type string // person, location, organization, etc.
|
|
Count int
|
|
}
|
|
|
|
// Keyword represents an important keyword in the text
|
|
type Keyword struct {
|
|
Text string
|
|
Relevance float64 // 0.0 to 1.0
|
|
}
|
|
|
|
// Topic represents a topic identified in the text
|
|
type Topic struct {
|
|
Name string
|
|
Relevance float64 // 0.0 to 1.0
|
|
}
|