Skip to content

Commit 94a1eea

Browse files
ferdnycvqle23Nytelife26
authored
New reverse-existence implementation (#1370)
* 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 <vqle@umich.edu> Co-authored-by: Nytelife26 <xtylerjrx@gmail.com>
1 parent f01742d commit 94a1eea

File tree

11 files changed

+2022
-2
lines changed

11 files changed

+2022
-2
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Restricted word lists."""

0 commit comments

Comments
 (0)