pub struct SequenceExpr { /* private fields */ }
Implementations§
Source§impl SequenceExpr
impl SequenceExpr
Sourcepub fn any_capitalization_of(word: &'static str) -> Self
pub fn any_capitalization_of(word: &'static str) -> Self
Construct a new sequence with a Word
at the beginning of the operation list.
Sourcepub fn aco(word: &'static str) -> Self
pub fn aco(word: &'static str) -> Self
Shorthand for Self::any_capitalization_of
.
Sourcepub fn word_set(words: &'static [&'static str]) -> Self
pub fn word_set(words: &'static [&'static str]) -> Self
Match any word from the given set of words, case-insensitive.
Sourcepub fn then(self, expr: impl Expr + 'static) -> Self
pub fn then(self, expr: impl Expr + 'static) -> Self
Push an expression to the operation list.
Sourcepub fn then_optional(self, expr: impl Expr + 'static) -> Self
pub fn then_optional(self, expr: impl Expr + 'static) -> Self
Pushes an expression that could move the cursor to the sequence, but does not require it.
Sourcepub fn then_any_of(self, exprs: Vec<Box<dyn Expr>>) -> Self
pub fn then_any_of(self, exprs: Vec<Box<dyn Expr>>) -> Self
Pushes an expression that will match any of the provided expressions.
If more than one of the provided expressions match, this function provides no guarantee
as to which match will end up being used. If you need to get the longest of multiple
matches, use Self::then_longest_of()
instead.
Sourcepub fn then_longest_of(self, exprs: Vec<Box<dyn Expr>>) -> Self
pub fn then_longest_of(self, exprs: Vec<Box<dyn Expr>>) -> Self
Pushes an expression that will match the longest of the provided expressions.
If you don’t need the longest match, prefer using the short-circuiting
Self::then_any_of()
instead.
Sourcepub fn then_seq(self, other: Self) -> Self
pub fn then_seq(self, other: Self) -> Self
Appends the steps in other
onto the end of self
.
This is more efficient than Self::then
because it avoids pointer redirection.
Sourcepub fn then_word_set(self, words: &'static [&'static str]) -> Self
pub fn then_word_set(self, words: &'static [&'static str]) -> Self
Pushes an expression that will match any word from the given set of words, case-insensitive.
Sourcepub fn then_strict(self, kind: TokenKind) -> Self
pub fn then_strict(self, kind: TokenKind) -> Self
Matches any token whose Kind
exactly matches.
Sourcepub fn then_whitespace(self) -> Self
pub fn then_whitespace(self) -> Self
Match against one or more whitespace tokens.
Sourcepub fn t_ws(self) -> Self
pub fn t_ws(self) -> Self
Shorthand for Self::then_whitespace
.
pub fn then_one_or_more(self, expr: impl Expr + 'static) -> Self
Sourcepub fn then_unless(self, condition: impl Expr + 'static) -> Self
pub fn then_unless(self, condition: impl Expr + 'static) -> Self
Create a new condition that will step one token forward if met.
If the condition is not met, the whole expression returns None
.
This can be used to build out exceptions to other rules.
See UnlessStep
for more info.
Sourcepub fn then_anything(self) -> Self
pub fn then_anything(self) -> Self
Match any single token.
See AnyPattern
for more info.
Sourcepub fn t_any(self) -> Self
pub fn t_any(self) -> Self
Match any single token.
Shorthand for Self::then_anything
.
Sourcepub fn then_any_word(self) -> Self
pub fn then_any_word(self) -> Self
Matches any word.
Sourcepub fn then_any_capitalization_of(self, word: &'static str) -> Self
pub fn then_any_capitalization_of(self, word: &'static str) -> Self
Match examples of word
that have any capitalization.
Sourcepub fn t_aco(self, word: &'static str) -> Self
pub fn t_aco(self, word: &'static str) -> Self
Shorthand for Self::then_any_capitalization_of
.
Sourcepub fn then_exact_word(self, word: &'static str) -> Self
pub fn then_exact_word(self, word: &'static str) -> Self
Match examples of word
case-sensitively.
Sourcepub fn then_fixed_phrase(self, phrase: &'static str) -> Self
pub fn then_fixed_phrase(self, phrase: &'static str) -> Self
Match a fixed phrase.
Sourcepub fn then_word_except(self, words: &'static [&'static str]) -> Self
pub fn then_word_except(self, words: &'static [&'static str]) -> Self
Match any word except the ones in words
.
Sourcepub fn then_kind_except<F>(
self,
pred: F,
words: &'static [&'static str],
) -> Self
pub fn then_kind_except<F>( self, pred: F, words: &'static [&'static str], ) -> Self
Match a token of a given kind which is not in the list of words.
Sourcepub fn then_kind_both<F1, F2>(self, pred1: F1, pred2: F2) -> Self
pub fn then_kind_both<F1, F2>(self, pred1: F1, pred2: F2) -> Self
Adds a step matching a token where both token kind predicates return true.
Sourcepub fn then_kind_either<F1, F2>(self, pred1: F1, pred2: F2) -> Self
pub fn then_kind_either<F1, F2>(self, pred1: F1, pred2: F2) -> Self
Adds a step matching a token where either of the two token kind predicates returns true.
Sourcepub fn then_kind_any<F>(self, preds: &'static [F]) -> Self
pub fn then_kind_any<F>(self, preds: &'static [F]) -> Self
Adds a step matching a token where any of the token kind predicates returns true.
Sourcepub fn then_kind_is_but_is_not<F1, F2>(self, pred1: F1, pred2: F2) -> Self
pub fn then_kind_is_but_is_not<F1, F2>(self, pred1: F1, pred2: F2) -> Self
Adds a step matching a token where the first token kind predicate returns true and the second returns false.
Sourcepub fn then_kind_is_but_is_not_except<F1, F2>(
self,
pred1: F1,
pred2: F2,
words: &'static [&'static str],
) -> Self
pub fn then_kind_is_but_is_not_except<F1, F2>( self, pred1: F1, pred2: F2, words: &'static [&'static str], ) -> Self
Adds a step matching a token where the first token kind predicate returns true and the second returns false, and the token is not in the list of words.
Sourcepub fn then_oov(self) -> Self
pub fn then_oov(self) -> Self
Adds a step matching a token where TokenKind::is_oov()
returns true.
Sourcepub fn then_optional_oov(self) -> Self
pub fn then_optional_oov(self) -> Self
Adds an optional step matching a token where TokenKind::is_oov()
returns true.
Sourcepub fn then_one_or_more_oovs(self) -> Self
pub fn then_one_or_more_oovs(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_oov()
returns true.
Sourcepub fn then_anything_but_oov(self) -> Self
pub fn then_anything_but_oov(self) -> Self
Adds a step matching a token where TokenKind::is_oov()
returns false.
Sourcepub fn then_nominal(self) -> Self
pub fn then_nominal(self) -> Self
Adds a step matching a token where TokenKind::is_nominal()
returns true.
Sourcepub fn then_optional_nominal(self) -> Self
pub fn then_optional_nominal(self) -> Self
Adds an optional step matching a token where TokenKind::is_nominal()
returns true.
Sourcepub fn then_one_or_more_nominals(self) -> Self
pub fn then_one_or_more_nominals(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_nominal()
returns true.
Sourcepub fn then_anything_but_nominal(self) -> Self
pub fn then_anything_but_nominal(self) -> Self
Adds a step matching a token where TokenKind::is_nominal()
returns false.
Sourcepub fn then_plural_nominal(self) -> Self
pub fn then_plural_nominal(self) -> Self
Adds a step matching a token where TokenKind::is_plural_nominal()
returns true.
Sourcepub fn then_optional_plural_nominal(self) -> Self
pub fn then_optional_plural_nominal(self) -> Self
Adds an optional step matching a token where TokenKind::is_plural_nominal()
returns true.
Sourcepub fn then_one_or_more_plural_nominals(self) -> Self
pub fn then_one_or_more_plural_nominals(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_plural_nominal()
returns true.
Sourcepub fn then_anything_but_plural_nominal(self) -> Self
pub fn then_anything_but_plural_nominal(self) -> Self
Adds a step matching a token where TokenKind::is_plural_nominal()
returns false.
Sourcepub fn then_non_plural_nominal(self) -> Self
pub fn then_non_plural_nominal(self) -> Self
Adds a step matching a token where TokenKind::is_non_plural_nominal()
returns true.
Sourcepub fn then_optional_non_plural_nominal(self) -> Self
pub fn then_optional_non_plural_nominal(self) -> Self
Adds an optional step matching a token where TokenKind::is_non_plural_nominal()
returns true.
Sourcepub fn then_one_or_more_non_plural_nominals(self) -> Self
pub fn then_one_or_more_non_plural_nominals(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_non_plural_nominal()
returns true.
Sourcepub fn then_anything_but_non_plural_nominal(self) -> Self
pub fn then_anything_but_non_plural_nominal(self) -> Self
Adds a step matching a token where TokenKind::is_non_plural_nominal()
returns false.
Sourcepub fn then_possessive_nominal(self) -> Self
pub fn then_possessive_nominal(self) -> Self
Adds a step matching a token where TokenKind::is_possessive_nominal()
returns true.
Sourcepub fn then_optional_possessive_nominal(self) -> Self
pub fn then_optional_possessive_nominal(self) -> Self
Adds an optional step matching a token where TokenKind::is_possessive_nominal()
returns true.
Sourcepub fn then_one_or_more_possessive_nominals(self) -> Self
pub fn then_one_or_more_possessive_nominals(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_possessive_nominal()
returns true.
Sourcepub fn then_anything_but_possessive_nominal(self) -> Self
pub fn then_anything_but_possessive_nominal(self) -> Self
Adds a step matching a token where TokenKind::is_possessive_nominal()
returns false.
Sourcepub fn then_noun(self) -> Self
pub fn then_noun(self) -> Self
Adds a step matching a token where TokenKind::is_noun()
returns true.
Sourcepub fn then_optional_noun(self) -> Self
pub fn then_optional_noun(self) -> Self
Adds an optional step matching a token where TokenKind::is_noun()
returns true.
Sourcepub fn then_one_or_more_nouns(self) -> Self
pub fn then_one_or_more_nouns(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_noun()
returns true.
Sourcepub fn then_anything_but_noun(self) -> Self
pub fn then_anything_but_noun(self) -> Self
Adds a step matching a token where TokenKind::is_noun()
returns false.
Sourcepub fn then_proper_noun(self) -> Self
pub fn then_proper_noun(self) -> Self
Adds a step matching a token where TokenKind::is_proper_noun()
returns true.
Sourcepub fn then_optional_proper_noun(self) -> Self
pub fn then_optional_proper_noun(self) -> Self
Adds an optional step matching a token where TokenKind::is_proper_noun()
returns true.
Sourcepub fn then_one_or_more_proper_nouns(self) -> Self
pub fn then_one_or_more_proper_nouns(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_proper_noun()
returns true.
Sourcepub fn then_anything_but_proper_noun(self) -> Self
pub fn then_anything_but_proper_noun(self) -> Self
Adds a step matching a token where TokenKind::is_proper_noun()
returns false.
Sourcepub fn then_mass_noun_only(self) -> Self
pub fn then_mass_noun_only(self) -> Self
Adds a step matching a token where TokenKind::is_mass_noun_only()
returns true.
Sourcepub fn then_optional_mass_noun_only(self) -> Self
pub fn then_optional_mass_noun_only(self) -> Self
Adds an optional step matching a token where TokenKind::is_mass_noun_only()
returns true.
Sourcepub fn then_one_or_more_mass_noun_onlys(self) -> Self
pub fn then_one_or_more_mass_noun_onlys(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_mass_noun_only()
returns true.
Sourcepub fn then_anything_but_mass_noun_only(self) -> Self
pub fn then_anything_but_mass_noun_only(self) -> Self
Adds a step matching a token where TokenKind::is_mass_noun_only()
returns false.
Sourcepub fn then_pronoun(self) -> Self
pub fn then_pronoun(self) -> Self
Adds a step matching a token where TokenKind::is_pronoun()
returns true.
Sourcepub fn then_optional_pronoun(self) -> Self
pub fn then_optional_pronoun(self) -> Self
Adds an optional step matching a token where TokenKind::is_pronoun()
returns true.
Sourcepub fn then_one_or_more_pronouns(self) -> Self
pub fn then_one_or_more_pronouns(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_pronoun()
returns true.
Sourcepub fn then_anything_but_pronoun(self) -> Self
pub fn then_anything_but_pronoun(self) -> Self
Adds a step matching a token where TokenKind::is_pronoun()
returns false.
Sourcepub fn then_first_person_singular_pronoun(self) -> Self
pub fn then_first_person_singular_pronoun(self) -> Self
Adds a step matching a token where TokenKind::is_first_person_singular_pronoun()
returns true.
Sourcepub fn then_optional_first_person_singular_pronoun(self) -> Self
pub fn then_optional_first_person_singular_pronoun(self) -> Self
Adds an optional step matching a token where TokenKind::is_first_person_singular_pronoun()
returns true.
Sourcepub fn then_one_or_more_first_person_singular_pronouns(self) -> Self
pub fn then_one_or_more_first_person_singular_pronouns(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_first_person_singular_pronoun()
returns true.
Sourcepub fn then_anything_but_first_person_singular_pronoun(self) -> Self
pub fn then_anything_but_first_person_singular_pronoun(self) -> Self
Adds a step matching a token where TokenKind::is_first_person_singular_pronoun()
returns false.
Sourcepub fn then_first_person_plural_pronoun(self) -> Self
pub fn then_first_person_plural_pronoun(self) -> Self
Adds a step matching a token where TokenKind::is_first_person_plural_pronoun()
returns true.
Sourcepub fn then_optional_first_person_plural_pronoun(self) -> Self
pub fn then_optional_first_person_plural_pronoun(self) -> Self
Adds an optional step matching a token where TokenKind::is_first_person_plural_pronoun()
returns true.
Sourcepub fn then_one_or_more_first_person_plural_pronouns(self) -> Self
pub fn then_one_or_more_first_person_plural_pronouns(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_first_person_plural_pronoun()
returns true.
Sourcepub fn then_anything_but_first_person_plural_pronoun(self) -> Self
pub fn then_anything_but_first_person_plural_pronoun(self) -> Self
Adds a step matching a token where TokenKind::is_first_person_plural_pronoun()
returns false.
Sourcepub fn then_second_person_pronoun(self) -> Self
pub fn then_second_person_pronoun(self) -> Self
Adds a step matching a token where TokenKind::is_second_person_pronoun()
returns true.
Sourcepub fn then_optional_second_person_pronoun(self) -> Self
pub fn then_optional_second_person_pronoun(self) -> Self
Adds an optional step matching a token where TokenKind::is_second_person_pronoun()
returns true.
Sourcepub fn then_one_or_more_second_person_pronouns(self) -> Self
pub fn then_one_or_more_second_person_pronouns(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_second_person_pronoun()
returns true.
Sourcepub fn then_anything_but_second_person_pronoun(self) -> Self
pub fn then_anything_but_second_person_pronoun(self) -> Self
Adds a step matching a token where TokenKind::is_second_person_pronoun()
returns false.
Sourcepub fn then_third_person_pronoun(self) -> Self
pub fn then_third_person_pronoun(self) -> Self
Adds a step matching a token where TokenKind::is_third_person_pronoun()
returns true.
Sourcepub fn then_optional_third_person_pronoun(self) -> Self
pub fn then_optional_third_person_pronoun(self) -> Self
Adds an optional step matching a token where TokenKind::is_third_person_pronoun()
returns true.
Sourcepub fn then_one_or_more_third_person_pronouns(self) -> Self
pub fn then_one_or_more_third_person_pronouns(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_third_person_pronoun()
returns true.
Sourcepub fn then_anything_but_third_person_pronoun(self) -> Self
pub fn then_anything_but_third_person_pronoun(self) -> Self
Adds a step matching a token where TokenKind::is_third_person_pronoun()
returns false.
Sourcepub fn then_third_person_singular_pronoun(self) -> Self
pub fn then_third_person_singular_pronoun(self) -> Self
Adds a step matching a token where TokenKind::is_third_person_singular_pronoun()
returns true.
Sourcepub fn then_optional_third_person_singular_pronoun(self) -> Self
pub fn then_optional_third_person_singular_pronoun(self) -> Self
Adds an optional step matching a token where TokenKind::is_third_person_singular_pronoun()
returns true.
Sourcepub fn then_one_or_more_third_person_singular_pronouns(self) -> Self
pub fn then_one_or_more_third_person_singular_pronouns(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_third_person_singular_pronoun()
returns true.
Sourcepub fn then_anything_but_third_person_singular_pronoun(self) -> Self
pub fn then_anything_but_third_person_singular_pronoun(self) -> Self
Adds a step matching a token where TokenKind::is_third_person_singular_pronoun()
returns false.
Sourcepub fn then_third_person_plural_pronoun(self) -> Self
pub fn then_third_person_plural_pronoun(self) -> Self
Adds a step matching a token where TokenKind::is_third_person_plural_pronoun()
returns true.
Sourcepub fn then_optional_third_person_plural_pronoun(self) -> Self
pub fn then_optional_third_person_plural_pronoun(self) -> Self
Adds an optional step matching a token where TokenKind::is_third_person_plural_pronoun()
returns true.
Sourcepub fn then_one_or_more_third_person_plural_pronouns(self) -> Self
pub fn then_one_or_more_third_person_plural_pronouns(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_third_person_plural_pronoun()
returns true.
Sourcepub fn then_anything_but_third_person_plural_pronoun(self) -> Self
pub fn then_anything_but_third_person_plural_pronoun(self) -> Self
Adds a step matching a token where TokenKind::is_third_person_plural_pronoun()
returns false.
Sourcepub fn then_object_pronoun(self) -> Self
pub fn then_object_pronoun(self) -> Self
Adds a step matching a token where TokenKind::is_object_pronoun()
returns true.
Sourcepub fn then_optional_object_pronoun(self) -> Self
pub fn then_optional_object_pronoun(self) -> Self
Adds an optional step matching a token where TokenKind::is_object_pronoun()
returns true.
Sourcepub fn then_one_or_more_object_pronouns(self) -> Self
pub fn then_one_or_more_object_pronouns(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_object_pronoun()
returns true.
Sourcepub fn then_anything_but_object_pronoun(self) -> Self
pub fn then_anything_but_object_pronoun(self) -> Self
Adds a step matching a token where TokenKind::is_object_pronoun()
returns false.
Sourcepub fn then_verb(self) -> Self
pub fn then_verb(self) -> Self
Adds a step matching a token where TokenKind::is_verb()
returns true.
Sourcepub fn then_optional_verb(self) -> Self
pub fn then_optional_verb(self) -> Self
Adds an optional step matching a token where TokenKind::is_verb()
returns true.
Sourcepub fn then_one_or_more_verbs(self) -> Self
pub fn then_one_or_more_verbs(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_verb()
returns true.
Sourcepub fn then_anything_but_verb(self) -> Self
pub fn then_anything_but_verb(self) -> Self
Adds a step matching a token where TokenKind::is_verb()
returns false.
Sourcepub fn then_auxiliary_verb(self) -> Self
pub fn then_auxiliary_verb(self) -> Self
Adds a step matching a token where TokenKind::is_auxiliary_verb()
returns true.
Sourcepub fn then_optional_auxiliary_verb(self) -> Self
pub fn then_optional_auxiliary_verb(self) -> Self
Adds an optional step matching a token where TokenKind::is_auxiliary_verb()
returns true.
Sourcepub fn then_one_or_more_auxiliary_verbs(self) -> Self
pub fn then_one_or_more_auxiliary_verbs(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_auxiliary_verb()
returns true.
Sourcepub fn then_anything_but_auxiliary_verb(self) -> Self
pub fn then_anything_but_auxiliary_verb(self) -> Self
Adds a step matching a token where TokenKind::is_auxiliary_verb()
returns false.
Sourcepub fn then_linking_verb(self) -> Self
pub fn then_linking_verb(self) -> Self
Adds a step matching a token where TokenKind::is_linking_verb()
returns true.
Sourcepub fn then_optional_linking_verb(self) -> Self
pub fn then_optional_linking_verb(self) -> Self
Adds an optional step matching a token where TokenKind::is_linking_verb()
returns true.
Sourcepub fn then_one_or_more_linking_verbs(self) -> Self
pub fn then_one_or_more_linking_verbs(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_linking_verb()
returns true.
Sourcepub fn then_anything_but_linking_verb(self) -> Self
pub fn then_anything_but_linking_verb(self) -> Self
Adds a step matching a token where TokenKind::is_linking_verb()
returns false.
Sourcepub fn then_adjective(self) -> Self
pub fn then_adjective(self) -> Self
Adds a step matching a token where TokenKind::is_adjective()
returns true.
Sourcepub fn then_optional_adjective(self) -> Self
pub fn then_optional_adjective(self) -> Self
Adds an optional step matching a token where TokenKind::is_adjective()
returns true.
Sourcepub fn then_one_or_more_adjectives(self) -> Self
pub fn then_one_or_more_adjectives(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_adjective()
returns true.
Sourcepub fn then_anything_but_adjective(self) -> Self
pub fn then_anything_but_adjective(self) -> Self
Adds a step matching a token where TokenKind::is_adjective()
returns false.
Sourcepub fn then_positive_adjective(self) -> Self
pub fn then_positive_adjective(self) -> Self
Adds a step matching a token where TokenKind::is_positive_adjective()
returns true.
Sourcepub fn then_optional_positive_adjective(self) -> Self
pub fn then_optional_positive_adjective(self) -> Self
Adds an optional step matching a token where TokenKind::is_positive_adjective()
returns true.
Sourcepub fn then_one_or_more_positive_adjectives(self) -> Self
pub fn then_one_or_more_positive_adjectives(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_positive_adjective()
returns true.
Sourcepub fn then_anything_but_positive_adjective(self) -> Self
pub fn then_anything_but_positive_adjective(self) -> Self
Adds a step matching a token where TokenKind::is_positive_adjective()
returns false.
Sourcepub fn then_comparative_adjective(self) -> Self
pub fn then_comparative_adjective(self) -> Self
Adds a step matching a token where TokenKind::is_comparative_adjective()
returns true.
Sourcepub fn then_optional_comparative_adjective(self) -> Self
pub fn then_optional_comparative_adjective(self) -> Self
Adds an optional step matching a token where TokenKind::is_comparative_adjective()
returns true.
Sourcepub fn then_one_or_more_comparative_adjectives(self) -> Self
pub fn then_one_or_more_comparative_adjectives(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_comparative_adjective()
returns true.
Sourcepub fn then_anything_but_comparative_adjective(self) -> Self
pub fn then_anything_but_comparative_adjective(self) -> Self
Adds a step matching a token where TokenKind::is_comparative_adjective()
returns false.
Sourcepub fn then_superlative_adjective(self) -> Self
pub fn then_superlative_adjective(self) -> Self
Adds a step matching a token where TokenKind::is_superlative_adjective()
returns true.
Sourcepub fn then_optional_superlative_adjective(self) -> Self
pub fn then_optional_superlative_adjective(self) -> Self
Adds an optional step matching a token where TokenKind::is_superlative_adjective()
returns true.
Sourcepub fn then_one_or_more_superlative_adjectives(self) -> Self
pub fn then_one_or_more_superlative_adjectives(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_superlative_adjective()
returns true.
Sourcepub fn then_anything_but_superlative_adjective(self) -> Self
pub fn then_anything_but_superlative_adjective(self) -> Self
Adds a step matching a token where TokenKind::is_superlative_adjective()
returns false.
Sourcepub fn then_adverb(self) -> Self
pub fn then_adverb(self) -> Self
Adds a step matching a token where TokenKind::is_adverb()
returns true.
Sourcepub fn then_optional_adverb(self) -> Self
pub fn then_optional_adverb(self) -> Self
Adds an optional step matching a token where TokenKind::is_adverb()
returns true.
Sourcepub fn then_one_or_more_adverbs(self) -> Self
pub fn then_one_or_more_adverbs(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_adverb()
returns true.
Sourcepub fn then_anything_but_adverb(self) -> Self
pub fn then_anything_but_adverb(self) -> Self
Adds a step matching a token where TokenKind::is_adverb()
returns false.
Sourcepub fn then_determiner(self) -> Self
pub fn then_determiner(self) -> Self
Adds a step matching a token where TokenKind::is_determiner()
returns true.
Sourcepub fn then_optional_determiner(self) -> Self
pub fn then_optional_determiner(self) -> Self
Adds an optional step matching a token where TokenKind::is_determiner()
returns true.
Sourcepub fn then_one_or_more_determiners(self) -> Self
pub fn then_one_or_more_determiners(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_determiner()
returns true.
Sourcepub fn then_anything_but_determiner(self) -> Self
pub fn then_anything_but_determiner(self) -> Self
Adds a step matching a token where TokenKind::is_determiner()
returns false.
Sourcepub fn then_demonstrative_determiner(self) -> Self
pub fn then_demonstrative_determiner(self) -> Self
Adds a step matching a token where TokenKind::is_demonstrative_determiner()
returns true.
Sourcepub fn then_optional_demonstrative_determiner(self) -> Self
pub fn then_optional_demonstrative_determiner(self) -> Self
Adds an optional step matching a token where TokenKind::is_demonstrative_determiner()
returns true.
Sourcepub fn then_one_or_more_demonstrative_determiners(self) -> Self
pub fn then_one_or_more_demonstrative_determiners(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_demonstrative_determiner()
returns true.
Sourcepub fn then_anything_but_demonstrative_determiner(self) -> Self
pub fn then_anything_but_demonstrative_determiner(self) -> Self
Adds a step matching a token where TokenKind::is_demonstrative_determiner()
returns false.
Sourcepub fn then_quantifier(self) -> Self
pub fn then_quantifier(self) -> Self
Adds a step matching a token where TokenKind::is_quantifier()
returns true.
Sourcepub fn then_optional_quantifier(self) -> Self
pub fn then_optional_quantifier(self) -> Self
Adds an optional step matching a token where TokenKind::is_quantifier()
returns true.
Sourcepub fn then_one_or_more_quantifiers(self) -> Self
pub fn then_one_or_more_quantifiers(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_quantifier()
returns true.
Sourcepub fn then_anything_but_quantifier(self) -> Self
pub fn then_anything_but_quantifier(self) -> Self
Adds a step matching a token where TokenKind::is_quantifier()
returns false.
Sourcepub fn then_non_quantifier_determiner(self) -> Self
pub fn then_non_quantifier_determiner(self) -> Self
Adds a step matching a token where TokenKind::is_non_quantifier_determiner()
returns true.
Sourcepub fn then_optional_non_quantifier_determiner(self) -> Self
pub fn then_optional_non_quantifier_determiner(self) -> Self
Adds an optional step matching a token where TokenKind::is_non_quantifier_determiner()
returns true.
Sourcepub fn then_one_or_more_non_quantifier_determiners(self) -> Self
pub fn then_one_or_more_non_quantifier_determiners(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_non_quantifier_determiner()
returns true.
Sourcepub fn then_anything_but_non_quantifier_determiner(self) -> Self
pub fn then_anything_but_non_quantifier_determiner(self) -> Self
Adds a step matching a token where TokenKind::is_non_quantifier_determiner()
returns false.
Sourcepub fn then_indefinite_article(self) -> Self
pub fn then_indefinite_article(self) -> Self
Push an IndefiniteArticle
to the end of the operation list.
Sourcepub fn then_conjunction(self) -> Self
pub fn then_conjunction(self) -> Self
Adds a step matching a token where TokenKind::is_conjunction()
returns true.
Sourcepub fn then_optional_conjunction(self) -> Self
pub fn then_optional_conjunction(self) -> Self
Adds an optional step matching a token where TokenKind::is_conjunction()
returns true.
Sourcepub fn then_one_or_more_conjunctions(self) -> Self
pub fn then_one_or_more_conjunctions(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_conjunction()
returns true.
Sourcepub fn then_anything_but_conjunction(self) -> Self
pub fn then_anything_but_conjunction(self) -> Self
Adds a step matching a token where TokenKind::is_conjunction()
returns false.
Sourcepub fn then_preposition(self) -> Self
pub fn then_preposition(self) -> Self
Adds a step matching a token where TokenKind::is_preposition()
returns true.
Sourcepub fn then_optional_preposition(self) -> Self
pub fn then_optional_preposition(self) -> Self
Adds an optional step matching a token where TokenKind::is_preposition()
returns true.
Sourcepub fn then_one_or_more_prepositions(self) -> Self
pub fn then_one_or_more_prepositions(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_preposition()
returns true.
Sourcepub fn then_anything_but_preposition(self) -> Self
pub fn then_anything_but_preposition(self) -> Self
Adds a step matching a token where TokenKind::is_preposition()
returns false.
Sourcepub fn then_punctuation(self) -> Self
pub fn then_punctuation(self) -> Self
Adds a step matching a token where TokenKind::is_punctuation()
returns true.
Sourcepub fn then_optional_punctuation(self) -> Self
pub fn then_optional_punctuation(self) -> Self
Adds an optional step matching a token where TokenKind::is_punctuation()
returns true.
Sourcepub fn then_one_or_more_punctuations(self) -> Self
pub fn then_one_or_more_punctuations(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_punctuation()
returns true.
Sourcepub fn then_anything_but_punctuation(self) -> Self
pub fn then_anything_but_punctuation(self) -> Self
Adds a step matching a token where TokenKind::is_punctuation()
returns false.
Sourcepub fn then_apostrophe(self) -> Self
pub fn then_apostrophe(self) -> Self
Adds a step matching a token where TokenKind::is_apostrophe()
returns true.
Sourcepub fn then_optional_apostrophe(self) -> Self
pub fn then_optional_apostrophe(self) -> Self
Adds an optional step matching a token where TokenKind::is_apostrophe()
returns true.
Sourcepub fn then_one_or_more_apostrophes(self) -> Self
pub fn then_one_or_more_apostrophes(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_apostrophe()
returns true.
Sourcepub fn then_anything_but_apostrophe(self) -> Self
pub fn then_anything_but_apostrophe(self) -> Self
Adds a step matching a token where TokenKind::is_apostrophe()
returns false.
Sourcepub fn then_comma(self) -> Self
pub fn then_comma(self) -> Self
Adds a step matching a token where TokenKind::is_comma()
returns true.
Sourcepub fn then_optional_comma(self) -> Self
pub fn then_optional_comma(self) -> Self
Adds an optional step matching a token where TokenKind::is_comma()
returns true.
Sourcepub fn then_one_or_more_commas(self) -> Self
pub fn then_one_or_more_commas(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_comma()
returns true.
Sourcepub fn then_anything_but_comma(self) -> Self
pub fn then_anything_but_comma(self) -> Self
Adds a step matching a token where TokenKind::is_comma()
returns false.
Sourcepub fn then_hyphen(self) -> Self
pub fn then_hyphen(self) -> Self
Adds a step matching a token where TokenKind::is_hyphen()
returns true.
Sourcepub fn then_optional_hyphen(self) -> Self
pub fn then_optional_hyphen(self) -> Self
Adds an optional step matching a token where TokenKind::is_hyphen()
returns true.
Sourcepub fn then_one_or_more_hyphens(self) -> Self
pub fn then_one_or_more_hyphens(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_hyphen()
returns true.
Sourcepub fn then_anything_but_hyphen(self) -> Self
pub fn then_anything_but_hyphen(self) -> Self
Adds a step matching a token where TokenKind::is_hyphen()
returns false.
Sourcepub fn then_period(self) -> Self
pub fn then_period(self) -> Self
Adds a step matching a token where TokenKind::is_period()
returns true.
Sourcepub fn then_optional_period(self) -> Self
pub fn then_optional_period(self) -> Self
Adds an optional step matching a token where TokenKind::is_period()
returns true.
Sourcepub fn then_one_or_more_periods(self) -> Self
pub fn then_one_or_more_periods(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_period()
returns true.
Sourcepub fn then_anything_but_period(self) -> Self
pub fn then_anything_but_period(self) -> Self
Adds a step matching a token where TokenKind::is_period()
returns false.
Sourcepub fn then_semicolon(self) -> Self
pub fn then_semicolon(self) -> Self
Adds a step matching a token where TokenKind::is_semicolon()
returns true.
Sourcepub fn then_optional_semicolon(self) -> Self
pub fn then_optional_semicolon(self) -> Self
Adds an optional step matching a token where TokenKind::is_semicolon()
returns true.
Sourcepub fn then_one_or_more_semicolons(self) -> Self
pub fn then_one_or_more_semicolons(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_semicolon()
returns true.
Sourcepub fn then_anything_but_semicolon(self) -> Self
pub fn then_anything_but_semicolon(self) -> Self
Adds a step matching a token where TokenKind::is_semicolon()
returns false.
Sourcepub fn then_number(self) -> Self
pub fn then_number(self) -> Self
Adds a step matching a token where TokenKind::is_number()
returns true.
Sourcepub fn then_optional_number(self) -> Self
pub fn then_optional_number(self) -> Self
Adds an optional step matching a token where TokenKind::is_number()
returns true.
Sourcepub fn then_one_or_more_numbers(self) -> Self
pub fn then_one_or_more_numbers(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_number()
returns true.
Sourcepub fn then_anything_but_number(self) -> Self
pub fn then_anything_but_number(self) -> Self
Adds a step matching a token where TokenKind::is_number()
returns false.
Sourcepub fn then_case_separator(self) -> Self
pub fn then_case_separator(self) -> Self
Adds a step matching a token where TokenKind::is_case_separator()
returns true.
Sourcepub fn then_optional_case_separator(self) -> Self
pub fn then_optional_case_separator(self) -> Self
Adds an optional step matching a token where TokenKind::is_case_separator()
returns true.
Sourcepub fn then_one_or_more_case_separators(self) -> Self
pub fn then_one_or_more_case_separators(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_case_separator()
returns true.
Sourcepub fn then_anything_but_case_separator(self) -> Self
pub fn then_anything_but_case_separator(self) -> Self
Adds a step matching a token where TokenKind::is_case_separator()
returns false.
Sourcepub fn then_likely_homograph(self) -> Self
pub fn then_likely_homograph(self) -> Self
Adds a step matching a token where TokenKind::is_likely_homograph()
returns true.
Sourcepub fn then_optional_likely_homograph(self) -> Self
pub fn then_optional_likely_homograph(self) -> Self
Adds an optional step matching a token where TokenKind::is_likely_homograph()
returns true.
Sourcepub fn then_one_or_more_likely_homographs(self) -> Self
pub fn then_one_or_more_likely_homographs(self) -> Self
Adds a step matching one or more consecutive tokens where TokenKind::is_likely_homograph()
returns true.
Sourcepub fn then_anything_but_likely_homograph(self) -> Self
pub fn then_anything_but_likely_homograph(self) -> Self
Adds a step matching a token where TokenKind::is_likely_homograph()
returns false.
Trait Implementations§
Source§impl Default for SequenceExpr
impl Default for SequenceExpr
Source§fn default() -> SequenceExpr
fn default() -> SequenceExpr
Source§impl Expr for SequenceExpr
impl Expr for SequenceExpr
Auto Trait Implementations§
impl Freeze for SequenceExpr
impl !RefUnwindSafe for SequenceExpr
impl !Send for SequenceExpr
impl !Sync for SequenceExpr
impl Unpin for SequenceExpr
impl !UnwindSafe for SequenceExpr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<E> ExprExt for E
impl<E> ExprExt for E
Source§fn iter_matches<'a>(
&'a self,
tokens: &'a [Token],
source: &'a [char],
) -> Box<dyn Iterator<Item = Span<Token>> + 'a>
fn iter_matches<'a>( &'a self, tokens: &'a [Token], source: &'a [char], ) -> Box<dyn Iterator<Item = Span<Token>> + 'a>
fn iter_matches_in_doc<'a>( &'a self, doc: &'a Document, ) -> Box<dyn Iterator<Item = Span<Token>> + 'a>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<E> OwnedExprExt for Ewhere
E: Expr + 'static,
impl<E> OwnedExprExt for Ewhere
E: Expr + 'static,
Source§fn or(self, other: impl Expr + 'static) -> FirstMatchOf
fn or(self, other: impl Expr + 'static) -> FirstMatchOf
Returns an expression that matches either the current one or the expression contained in other
.
Source§fn or_longest(self, other: impl Expr + 'static) -> LongestMatchOf
fn or_longest(self, other: impl Expr + 'static) -> LongestMatchOf
Returns an expression that matches the longest of the current one or the expression contained in other
.
If you don’t need the longest match, prefer using the short-circuiting [Self::or()
] instead.