Documentation
¶
Overview ¶
Package detect decides which tool to jump to for a piece of text: it takes a sample, runs the registry's Detectors and applies the threshold and the tie rule. The heuristics live in each tool's Detect.
Index ¶
Constants ¶
View Source
const ( SampleBytes = 64 << 10 // sample size Threshold = 0.5 // minimum score to jump TieGap = 0.1 // gap below which the user is asked )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Outcome ¶
type Outcome struct {
// Best is the chosen tool; nil when nothing beats Threshold or when
// there is a tie.
Best *registry.Scored
// Candidates are the tools above Threshold, highest first. On a tie,
// only those within TieGap of the first one.
Candidates []registry.Scored
Ambiguous bool
}
Outcome is the detection result.
Click to show internal directories.
Click to hide internal directories.