Skip to content

Conversation

@86xsk
Copy link
Contributor

@86xsk 86xsk commented Jan 9, 2026

Description

The primary focus of this PR is to add the option to annotate chunks in harper-cli annotate. With the -i/--isolate-english option, this should make it easier to visualize/debug the IsolateEnglish parser.

  • Renames annotate_tokens to annotate.
  • Refactors annotate to support more general annotations, rather than being limited to just tokens.
  • Adds Chunks as an annotation option to harper-cli annotate.
  • Adds SingleInputTrait::load_with_parser() to allow overriding an input's choice of parser. (This is used here to tack on IsolateEnglish to the input's parser selection.)
  • Adds -i/--isolate-english option to harper-cli annotate.
  • Produces/displays more descriptive titles for annotate reports.

Demo

chunks chunks_isolate_english

How Has This Been Tested?

  • Manual testing of harper-cli annotate.

Checklist

  • I have performed a self-review of my own code
  • I have added tests to cover my changes

86xsk added 6 commits January 8, 2026 18:30
Rename `annotate_tokens` -> `annotate`.
Implement `RandomColorIter` to make color generation code more reusable.
Also display a more descriptive for `Annotate` reports.
@hippietrail
Copy link
Collaborator

This looks really nice - and useful!

elijah-potter
elijah-potter previously approved these changes Jan 12, 2026
Copy link
Collaborator

@elijah-potter elijah-potter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @hippietrail said, this looks great! Good work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants