add¶
Interactively add words to chords.csv. Useful for one-off
additions (a name, a domain term, a missing inflection) without
re-running the full chordgen gen pipeline.
Usage¶
Words from WORDS and --words-file are combined and processed
in order.
Behaviour¶
For each input word chordgen add does the following:
- Skip if already known. If the word already appears in
chords.csv(as awordrow or any non-emptyalt1/alt2/alt3), prints a notice and moves on. - Auto-detect category. Closed-class words (modal /
demonstrative / number / pronoun / contraction) are looked up
in the same retag table the SUBTLEX pipeline uses; everything
else falls through to
pattern.en's POS tagger and is mapped to verb / noun / adjective / adverb. Anything else becomes the empty category (no alts). - Override the category. Shows a numbered menu with the auto-detected choice marked. Press Enter to accept, or type a number to override.
- Show collision-free chord options. Scores the word against
the configured keyboard, drops any chord that collides with a
chord already in
chords.csv(sorted-key comparison) or is shorter thangen.min_chord_length, and lists the top ten ranked by ascending score. - Pick or type a chord. Type a number, press Enter to accept
the top option, or type a custom chord. Custom chords are
validated through the same scorer the assigner uses (first
letter must match, every key must be on the keyboard,
collisions blocked, length floor enforced). The buffer is
coloured red while it's invalid and green the moment
it becomes a valid choice — and the reason it's invalid (e.g.
(first letter must match …),(collides with an existing chord)) is shown live next to the buffer. Submit with Enter. - Generate alts. Runs
AltGeneratorwith the chosen category. Any alt slot whose generated form collides with an existing word is dropped (the row is still appended). - Append and flush. Writes the new row with the chord
pinned and
frequencyleft empty, so futurechordgen genruns treat it as a user-pinned reserved row and won't reassign it. The CSV is rewritten atomically after every accepted word — Ctrl+C mid-batch keeps the words already accepted.
Example¶
$ chordgen add banana
Category for 'banana' (auto: noun):
[1] (none)
[2] verb
[3] noun *
[4] adjective
[5] adverb
[6] pronoun
[7] demonstrative
[8] modal
[9] number
[10] contraction
Pick category [Enter to accept auto]:
Chord options for 'banana':
[1] ba score=12
[2] bn score=15
[3] bna score=18
...
Pick a number, type a custom chord, or Enter to accept the top option.
Chord:
+ banana -> ba (alt1=bananas, alt2=, alt3=)
Added 1 word
Tips¶
- Pair with
--words-fileto import a list you've been collecting — one word per line works. - The CSV is rewritten in place; back up
chords.csvfirst if you're nervous (or just commit it to a dotfiles repo). - To rebalance your whole CSV after adding a lot of words, run
chordgen gen. Reserved rows survive the rebalance so the added chords stay put.