Skip to content

Commit

Permalink
New reverse-existence implementation (#1370)
Browse files Browse the repository at this point in the history
* added reverse existence with some basic tests for top1000 words

* added elementary words, docstrings,summary,sources, tests, and linting fixes

* Rename "reverse_existence" checks to "restricted"

Also, factor out word lists into module-level variables, for
access from elsewhere.

* tools: New reverse_existence_check implementation

Searches for all (3+-character) words using a simple regexp, then
walks the `finditer()` of non-overlapping matches, does some
sanity-checking on the candidate string (no digits), and queues
an error unless it appears on the list of permitted words.

* Simplify allowed_word helper

* Format list comprehension comprehensibly

* Switch to CSV for restricted wordlists

* Py3.8 balks at type annotation

* More terse set-conversion code

* Reformat CSV files to one-word-per-line

* chore: crlf -> lf

* refactor: replace csv library with simple read

* style: apply lint

* docs: update error message for restricted.top1000

---------

Co-authored-by: vqle <[email protected]>
Co-authored-by: Nytelife26 <[email protected]>
  • Loading branch information
3 people authored May 14, 2024
1 parent f01742d commit 94a1eea
Show file tree
Hide file tree
Showing 11 changed files with 2,022 additions and 2 deletions.
1 change: 1 addition & 0 deletions proselint/checks/restricted/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Restricted word lists."""
Loading

0 comments on commit 94a1eea

Please sign in to comment.