Documentation
¶
Overview ¶
Package report provides functionality for generating reports and formatted output from text conversion operations
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Analyser ¶
type Analyser struct {
// contains filtered or unexported fields
}
Analyser provides functionality to analyse text changes and generate statistics
func NewAnalyser ¶
NewAnalyser creates a new text change analyser
func (*Analyser) AnalyseChanges ¶
func (a *Analyser) AnalyseChanges(original, converted string) ChangeStats
AnalyseChanges compares original and converted text to generate detailed statistics
type ChangeStats ¶
type ChangeStats struct {
TotalWords int
SpellingChanges int
UnitConversions int
QuoteChanges int
ChangedWords []WordChange
ChangedUnits []UnitChange
}
ChangeStats represents statistics about changes made during conversion
type FileResult ¶
type FileResult struct {
FilePath string
Original string
Converted string
Stats ChangeStats
HasChanges bool
Error error
}
FileResult represents the result of processing a single file
type OutputFormat ¶
type OutputFormat string
OutputFormat represents the different output formats available
const ( OutputDiff OutputFormat = "diff" OutputText OutputFormat = "text" OutputMarkdown OutputFormat = "markdown" OutputStats OutputFormat = "stats" )
type ReportOptions ¶
type ReportOptions struct {
ShowDiff bool
ShowText bool
ShowMarkdown bool
ShowStats bool
ExitOnChange bool
Width int
}
ReportOptions configures the report generation
func DefaultOptions ¶
func DefaultOptions() ReportOptions
DefaultOptions returns sensible default options for report generation
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
Reporter handles the generation and formatting of conversion reports
func NewReporter ¶
func NewReporter(options ReportOptions) (*Reporter, error)
NewReporter creates a new Reporter with the given options
func (*Reporter) GenerateMultiFileReport ¶
func (r *Reporter) GenerateMultiFileReport(results []FileResult) (string, error)
GenerateMultiFileReport creates a comprehensive report from multiple file conversion results
func (*Reporter) GenerateReport ¶
func (r *Reporter) GenerateReport(original, converted string, stats ChangeStats) (string, error)
GenerateReport creates a comprehensive report from the conversion results
func (*Reporter) HasChanges ¶
HasChanges returns true if any changes were detected
func (*Reporter) ShouldExitWithError ¶
ShouldExitWithError returns true if the tool should exit with code 1
type UnitChange ¶
UnitChange represents a single unit conversion
type WordChange ¶
WordChange represents a single spelling change