sequence

Learn about the sequence extension point.

Name
Type
Description

tokens

[]NLPToken

A list of tokens with associated NLP metadata.

ignorecase

bool

Makes all matches case-insensitive.

While most extension points focus on writing style, sequence aims to support grammar-focused rules.

extends: sequence

# `%[4]s` is like `%s`, but specifically refers to the
# 4th token in our sequence.
message: |
  The infinitive '%[4]s' after 'be' requires 'to'.
  Did you mean '%[2]s %[3]s *to* %[4]s'?"
tokens:
  - tag: MD
  - pattern: be
  - tag: JJ
  # The `|` notation means that we'll accept `VB`
  # or `VBN` in position 4.
  - tag: VB|VBN

Every sequence-based rule is required to have at least one pattern (such as pattern: be, shown above). This becomes the “anchor” of the sequence: we find all instances of the first pattern and then check that the left- and right-hand sides of the sequence match.

Each entry in a sequence is known as an NLPToken and has the following structure:

sequence-based are sentence-scoped. See prose/taggingarrow-up-right for a full list of supported part-of-speech tags.

spelling script