Documentation
¶
Overview ¶
Package repeats finds capabilities and rules that may repeat each other across areas, for a session to judge. It only finds candidates: it makes no judgment, and it works over plain values, so it reads no session, store or record.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Capability ¶
Capability is a capability's name and the area that holds it.
type CapabilityGroup ¶
type CapabilityGroup struct {
Capabilities []Capability `json:"capabilities"`
Evidence []string `json:"evidence"`
}
CapabilityGroup is capabilities in at least two areas that may be one promise, with the evidence that joined them.
func CapabilityGroups ¶
func CapabilityGroups(caps []Capability, pairs []SuffixPair, groups []RuleGroup) []CapabilityGroup
CapabilityGroups groups capabilities, in different areas, that share a suffix pair or a rule repeat. Each group carries its evidence: the rename, or the headings of the repeated rules.
type Input ¶
type Input struct {
Capabilities []Capability
Renamed []Rename
Rules []Rule
}
Input is what the finders read.
type Rename ¶
Rename is a name the walk gave a capability because another area held the wanted one first: Area wanted From and was given To.
type Result ¶
type Result struct {
Pairs []SuffixPair `json:"pairs"`
Rules []RuleGroup `json:"rules"`
Capabilities []CapabilityGroup `json:"capabilities"`
}
Result is every candidate found.
type Rule ¶
type Rule struct {
ID string `json:"id"`
Capability string `json:"capability"`
Area string `json:"area"`
Kind string `json:"kind"`
Heading string `json:"heading"`
Body string `json:"body"`
}
Rule is one entry of a capability's rules, decisions or questions.
type RuleGroup ¶
RuleGroup is rules in at least two areas that repeat each other, exactly or nearly. Exact is true when every rule has the same Normal form.
func RuleGroups ¶
RuleGroups groups rules that repeat each other across areas, exactly (the same kind and the same Normal) or nearly (word overlap of at least 45 percent, each rule indexed by its rarest four words). A group whose rules all sit in one area is never returned.
type SuffixPair ¶
type SuffixPair struct {
Original Capability `json:"original"`
Renamed Capability `json:"renamed"`
Reason string `json:"reason"`
}
SuffixPair is a capability the walk renamed, with the capability of another area that kept the original name.
func SuffixPairs ¶
func SuffixPairs(caps []Capability, renamed []Rename) []SuffixPair
SuffixPairs pairs each renamed capability with the capability of another area that holds the original name. The walk's Renamed list is the source; the name pattern (walk, walk-2) only pairs a renamed name with its original.