Expand description
Pattern
s are one of the more powerful ways to query text inside Harper, especially for beginners. They are a simplified abstraction over Expr
.
Through the ExprLinter
trait, they make it much easier to
build Harper rules.
See the page about SequenceExpr
for a concrete example of their use.
Structs§
- AnyPattern
- Matches any single token.
- Implies
Quantity - This struct does two things.
- Indefinite
Article - Inflection
OfBe - Matches any inflection of the verb “be”:
am
,is
,are
,was
,were
,be
,been
,being
. - Invert
- A struct that matches any pattern except the one provided.
- Modal
Verb - Nominal
Phrase - UPOSSet
- Whitespace
Pattern - Within
Edit Distance - Matches single words within a certain edit distance of a given word.
- Word
- Matches a predefined word.
- WordSet
- A
super::Pattern
that matches against any of a set of provided words. For small sets of short words, it doesn’t allocate.
Traits§
- DocPattern
- Pattern
- Pattern
Ext - Single
Token Pattern - A simpler version of the
Pattern
trait that only matches a single token.