Skip to content

Commit 17231a8

Browse files
derek73claude
andauthored
Simplify _lexicon.py and _reading_index.py (#1430)
* Simplify _reading_index: one table for the pair lists, one category read per reading in the compile MATCHING_LISTS names each matching-only category's list property once; indexed(), MATCHING_ONLY and the compile read it. The compile reads a reading's category once, folds the name branches together, derives GIVEN_NAME_ABBREVIATIONS from the short names it already collects, and writes FAMILIAR and ALTERNATE_SPELLINGS through one helper. choose() reads each category once and selected() its ancestors once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Simplify _lexicon: named property sets, one 2.x refusal, the pair add beside the pair remove _FLAG_PROPS, _UNSTATED and _2X_FIELDS name the property and field lists each written out at two to four sites; _refuse_2x is add() and remove()'s shared refusal. _KIND_FIELDS is derived as the tail of _COMPILED_FIELDS. A familiar or spelling add dispatches to _extend_pairs beside _drop_pairs. _familiar_of takes the pairs it indexes, so its loop no longer shadows a parameter; _compiled_for returns _built's tail; _check_pool checks the one word its caller passes. The default base pool shares index()'s readings; the repr's deltas take each set difference once; _ReadingFiles.languages imports the index reader only where it reads it, and no longer calls cast. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Hold _lexicon's copy of the matching-list table to _reading_index's Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent b21f124 commit 17231a8

3 files changed

Lines changed: 193 additions & 169 deletions

File tree

0 commit comments

Comments
 (0)