feat: add new "adverbial particle" POS
Issues
N/A
Description
This PR adds a new part-of-speech for "adverbial particles". These are the words that accompany the verb in a phrasal verb. Most of them are also prepositions, but not all prepositions can act as adverbial particles and some adverbial particles are not also prepositions. Likewise, many can act as standalone adverbs, but not all of them.
The Penn Treebank has a category for these words, calling them just "particles" and using the symbol RP to denote them, which clearly creates a distinct grouping from the RB adverb and IN preposition.
These words are marked with the pilcrow ¶ in the dictionary. The initial set, which I gleaned from discussing the topic with Google's AI will be:
in, out, up, down, on, off, away, back, around, over, through, by, along, aside, together, apart
It's expected that linters that deal with phrasal verbs will be able to be adapted to use this new POS.
I think it will also be helpful in heuristics for working out the POS of words in linters from the context. For instance I was exploring a possible linter for "in along the lines of", which is not rare but occurs more often as a potential false positive than as a mistake, and one way to decide if it's a legit use is when the "in" is the adverbial particle belonging to a phrasal verb such as "weigh in", "chime in", "sign in", etc.
How Has This Been Tested?
cargo test
AI Disclosure
- [x] I am a human and didn't use any AI.
- [ ] I used LLM features of my editor, but not an agent.
- [ ] I used an AI agent interactively.
- [ ] I am an agent or I got an agent to do the work autonomously.
I didn't use AI for the code changes but did to make sure I had the right idea, to get the terminology, and to decide the set of such words to mark.
Checklist
- [x] I have performed a self-review of my own code
- [ ] I have added tests to cover my changes
- [x] I have considered splitting this into smaller pull requests.