Documentation ¶
Index ¶
- Variables
- type Analyzer
- type Edge
- type Factor
- type Node
- type Op
- type Set
- func (s *Set) Add(item string)
- func (s *Set) Clear()
- func (s *Set) DropRedundantFragment()
- func (s *Set) DropRedundantPrefix()
- func (s *Set) DropRedundantSuffix()
- func (s Set) Infinite() bool
- func (s Set) Items() []string
- func (s Set) Len() int
- func (s Set) LongestCommon() string
- func (s *Set) SetInfinite()
- func (s Set) String() string
Constants ¶
This section is empty.
Variables ¶
var RegexpOpCodeTable = []string{
"",
"NoMatch",
"EmptyMatch",
"Literal",
"CC",
"AnyCharNL",
"AnyChar",
"^",
"$",
"\\A",
"$",
"\\b",
"\\B",
"()",
"*",
"+",
"?",
"RT",
"・",
"|",
}
RegexpOpCodeTable is a set of regexp operations.
Functions ¶
This section is empty.
Types ¶
type Analyzer ¶
type Analyzer struct{}
Analyzer is a regexp necessary factor analyzer.
func (Analyzer) DebugParse ¶
DebugParse parses necessary factors for a given regexp, and writes a it's parse tree in dot format.
type Factor ¶
Factor represents a tuple of necessary factors for a regexp.
func NewFactorAnyChar ¶
func NewFactorAnyChar() Factor
NewFactorAnyChar creates a factor tuple initialized with regexp "any char".
func NewFactorInfinite ¶
func NewFactorInfinite() Factor
NewFactorInfinite creates a factor tuple each factor set is infinite.
func NewFactorLiteral ¶
NewFactorLiteral creates a factor tuple initialized with a given literal.
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set represents a set of necessary factors.
func CrossSet ¶
CrossSet returns a cross set of x and y. e.g. CrossSet {a, bc} and {xy, z} -> {axy, az, bcxy, bcz}
func (*Set) DropRedundantFragment ¶
func (s *Set) DropRedundantFragment()
DropRedundantFragment drops items which contains of other item in this set.
func (*Set) DropRedundantPrefix ¶
func (s *Set) DropRedundantPrefix()
DropRedundantPrefix drops items which has prefix of other item in this set.
func (*Set) DropRedundantSuffix ¶
func (s *Set) DropRedundantSuffix()
DropRedundantSuffix drops items which has suffix of other item in this set.
func (Set) LongestCommon ¶
LongestCommon returns the longest common substring of items in the set.