Name | bennie JSON |
Version |
0.1.0
JSON |
| download |
home_page | None |
Summary | A Python module for detecting dangling prepositions and other grammatical constructs. |
upload_time | 2025-07-31 03:46:09 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | None |
keywords |
grammar
nlp
english
preposition
linter
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Bennie
*A Python module for detecting dangling prepositions and other grammatical constructs that your English teacher warned you about.*
## Motivation
This module is dedicated to my mom, an English teacher of 30 years, who would always catch me when I'd end a sentence with a preposition. Bennie helps you identify these constructions - not to judge, but to give you the tools to make informed decisions about what you want to end your sentences with.
## What is it?
Bennie is a modular Python package designed to detect various "dangling" grammatical elements in English text. Currently, it focuses on dangling prepositions, but it's built to expand to other constructs like dangling participles and modifiers.
**Note:** We don't judge here! Sometimes ending with a preposition is perfectly fine and more natural. This tool simply helps you identify these patterns so you can decide what to do about them.
## Installation
```bash
# Clone the repository
git clone https://github.com/willwillis/bennie.git
cd bennie
# Install with uv (recommended)
uv sync
# Or install with pip
pip install -e .
```
## Quick Start
```python
from bennie import find_dangling_prepositions
# Test some sentences (with intentional dangling prepositions for irony)
text = "What are you looking at?"
found, sentences = find_dangling_prepositions(text)
if found:
print("Found dangling prepositions in:")
for sentence in sentences:
print(f" - {sentence}")
```
## Examples
Here are some examples of what Bennie can help you identify:
```python
from bennie import find_dangling_prepositions
test_cases = [
"What are you looking at?", # ✓ Dangling preposition detected
"This is what I was talking about.", # ✓ Dangling preposition detected
"Where did you come from?", # ✓ Dangling preposition detected
"She gave the book to him.", # ✗ No dangling preposition
"The house that Jack built.", # ✗ No dangling preposition
]
for text in test_cases:
found, _ = find_dangling_prepositions(text)
status = "🔍 Found" if found else "✅ Clean"
print(f"{status}: {text}")
```
## Testing
Run the test suite to see Bennie in action:
```bash
uv run python run_tests.py
```
## Architecture
Bennie is designed with modularity in mind, making it easy to add new detectors for different grammatical constructs:
```
bennie/
├── __init__.py # Public interface
├── core.py # Shared utilities (spaCy model loading)
└── detectors/
├── __init__.py
├── prepositions.py # Dangling preposition detection
└── (future detectors) # participles.py, modifiers.py, etc.
```
## Future Plans
- **Dangling Participles**: "Walking down the street, the trees looked beautiful."
- **Dangling Modifiers**: "After eating the sandwich, the park was lovely."
- **Split Infinitives**: "To boldly go where no one has gone before."
- **Custom Rules**: Add your own grammatical pet peeves to catch.
## Technical Details
Bennie uses spaCy's `en_core_web_sm` model for natural language processing. The detection algorithm identifies prepositions (POS tag "ADP") that appear at the end of sentences or clauses without a clear object.
## Contributing
Got a grammatical construct you'd like Bennie to help identify? Contributions are welcome! The modular architecture makes it easy to add new detectors without breaking existing functionality.
## A Note on Prescriptivism vs. Descriptivism
While some grammar rules are more guidelines than absolute laws, this tool exists to help you write with intention. Sometimes ending with a preposition is exactly what you want to do - and that's something this tool won't argue with.
---
*"This is the sort of English up with which I will not put."* - Often attributed to Winston Churchill (though he probably never said it)
Remember: Good writing is about clarity and communication, not following every rule you were taught in school. Use Bennie as a guide, not a judge! 🎓
Raw data
{
"_id": null,
"home_page": null,
"name": "bennie",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "grammar, nlp, english, preposition, linter",
"author": null,
"author_email": "Will Willis <will.willis@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/99/48/4c6511ddb2fdbb18a30643fd787f32d00636caaa43bd839fb228bff8b7ba/bennie-0.1.0.tar.gz",
"platform": null,
"description": "# Bennie\n\n*A Python module for detecting dangling prepositions and other grammatical constructs that your English teacher warned you about.*\n\n## Motivation\n\nThis module is dedicated to my mom, an English teacher of 30 years, who would always catch me when I'd end a sentence with a preposition. Bennie helps you identify these constructions - not to judge, but to give you the tools to make informed decisions about what you want to end your sentences with.\n\n## What is it?\n\nBennie is a modular Python package designed to detect various \"dangling\" grammatical elements in English text. Currently, it focuses on dangling prepositions, but it's built to expand to other constructs like dangling participles and modifiers.\n\n**Note:** We don't judge here! Sometimes ending with a preposition is perfectly fine and more natural. This tool simply helps you identify these patterns so you can decide what to do about them.\n\n## Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/willwillis/bennie.git\ncd bennie\n\n# Install with uv (recommended)\nuv sync\n\n# Or install with pip\npip install -e .\n```\n\n## Quick Start\n\n```python\nfrom bennie import find_dangling_prepositions\n\n# Test some sentences (with intentional dangling prepositions for irony)\ntext = \"What are you looking at?\"\nfound, sentences = find_dangling_prepositions(text)\n\nif found:\n print(\"Found dangling prepositions in:\")\n for sentence in sentences:\n print(f\" - {sentence}\")\n```\n\n## Examples\n\nHere are some examples of what Bennie can help you identify:\n\n```python\nfrom bennie import find_dangling_prepositions\n\ntest_cases = [\n \"What are you looking at?\", # \u2713 Dangling preposition detected\n \"This is what I was talking about.\", # \u2713 Dangling preposition detected \n \"Where did you come from?\", # \u2713 Dangling preposition detected\n \"She gave the book to him.\", # \u2717 No dangling preposition\n \"The house that Jack built.\", # \u2717 No dangling preposition\n]\n\nfor text in test_cases:\n found, _ = find_dangling_prepositions(text)\n status = \"\ud83d\udd0d Found\" if found else \"\u2705 Clean\"\n print(f\"{status}: {text}\")\n```\n\n## Testing\n\nRun the test suite to see Bennie in action:\n\n```bash\nuv run python run_tests.py\n```\n\n## Architecture\n\nBennie is designed with modularity in mind, making it easy to add new detectors for different grammatical constructs:\n\n```\nbennie/\n\u251c\u2500\u2500 __init__.py # Public interface\n\u251c\u2500\u2500 core.py # Shared utilities (spaCy model loading)\n\u2514\u2500\u2500 detectors/\n \u251c\u2500\u2500 __init__.py\n \u251c\u2500\u2500 prepositions.py # Dangling preposition detection\n \u2514\u2500\u2500 (future detectors) # participles.py, modifiers.py, etc.\n```\n\n## Future Plans\n\n- **Dangling Participles**: \"Walking down the street, the trees looked beautiful.\"\n- **Dangling Modifiers**: \"After eating the sandwich, the park was lovely.\"\n- **Split Infinitives**: \"To boldly go where no one has gone before.\"\n- **Custom Rules**: Add your own grammatical pet peeves to catch.\n\n## Technical Details\n\nBennie uses spaCy's `en_core_web_sm` model for natural language processing. The detection algorithm identifies prepositions (POS tag \"ADP\") that appear at the end of sentences or clauses without a clear object.\n\n## Contributing\n\nGot a grammatical construct you'd like Bennie to help identify? Contributions are welcome! The modular architecture makes it easy to add new detectors without breaking existing functionality.\n\n## A Note on Prescriptivism vs. Descriptivism\n\nWhile some grammar rules are more guidelines than absolute laws, this tool exists to help you write with intention. Sometimes ending with a preposition is exactly what you want to do - and that's something this tool won't argue with.\n\n---\n\n*\"This is the sort of English up with which I will not put.\"* - Often attributed to Winston Churchill (though he probably never said it)\n\nRemember: Good writing is about clarity and communication, not following every rule you were taught in school. Use Bennie as a guide, not a judge! \ud83c\udf93\n",
"bugtrack_url": null,
"license": null,
"summary": "A Python module for detecting dangling prepositions and other grammatical constructs.",
"version": "0.1.0",
"project_urls": {
"Bug Tracker": "https://github.com/willwillis/bennie/issues",
"Homepage": "https://github.com/willwillis/bennie"
},
"split_keywords": [
"grammar",
" nlp",
" english",
" preposition",
" linter"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "820d3fe2a07ad6d5e27f2a1fc2f7505723d667253613bf2288c89227ceb67873",
"md5": "f11e07860e91443ab22810e250b35091",
"sha256": "bc9d546336370828c128ba7178d47df0daf8f85f2e3441e0cb0c45f495f95730"
},
"downloads": -1,
"filename": "bennie-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f11e07860e91443ab22810e250b35091",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 4615,
"upload_time": "2025-07-31T03:46:08",
"upload_time_iso_8601": "2025-07-31T03:46:08.170719Z",
"url": "https://files.pythonhosted.org/packages/82/0d/3fe2a07ad6d5e27f2a1fc2f7505723d667253613bf2288c89227ceb67873/bennie-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "99484c6511ddb2fdbb18a30643fd787f32d00636caaa43bd839fb228bff8b7ba",
"md5": "77ea5bf1042518c97e47eca4ccd6d7eb",
"sha256": "968ad0b93e87de44abae35c60881939e6c549c82fc0cff8dd596ad3edd47e1d1"
},
"downloads": -1,
"filename": "bennie-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "77ea5bf1042518c97e47eca4ccd6d7eb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 4296,
"upload_time": "2025-07-31T03:46:09",
"upload_time_iso_8601": "2025-07-31T03:46:09.494479Z",
"url": "https://files.pythonhosted.org/packages/99/48/4c6511ddb2fdbb18a30643fd787f32d00636caaa43bd839fb228bff8b7ba/bennie-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-31 03:46:09",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "willwillis",
"github_project": "bennie",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "bennie"
}