harper icon indicating copy to clipboard operation
harper copied to clipboard

feat: preposition tool for `harper-cli`

Open hippietrail opened this issue 6 months ago • 0 comments

Issues

Supersedes #3339 Resolves #3337

Description

Adds a prepositions command to harper-cli for scanning text to find prepositional collocations. This dev tool helps analyze how words are used with prepositions by finding patterns like "preposition + word" (e.g., "based on") or "word + preposition" (e.g., "rely on").

Handy for:

  • Finding the most common prepositions used with a certain word
  • Checking if suspected wrong preposition errors occur

Features:

  • Match comma-separated list of prepositions or use P to match any preposition
  • Match comma-separated list of words (handy for inflections), or any word
  • Supports files, directories, stdin input, and text string on the command line.
  • Color-coded output for easy scanning

Also tidied up the use/mod section at the top of harper-cli/src/main.rs

Demo

image

How Has This Been Tested?

Manually tested with various preposition and word combinations on single files and directories.

Checklist

  • [x] I have performed a self-review of my own code
  • [ ] I have added tests to cover my changes (dev tool, manual testing sufficient)
  • [ ] I have considered splitting this into smaller pull requests

hippietrail avatar May 14 '26 02:05 hippietrail