fix: ngramX generates n-grams per line, not across entire corpus

Previously ngramX.bin accumulated all words from the whole file into a
flat array, producing candidates that crossed line boundaries. With a
corpus of "roses are red\nviolets are blue", it generated "red violets"
and "are red violets" - mixing lines that represent separate phrases.

Fixes ngramX.c to process each line independently so n-grams stay
within a single line, matching the expected behavior for song lyrics,
book passages, and similar per-line corpora.
This commit is contained in:
Justin Bollinger
2026-03-19 15:02:42 -04:00
parent ee1b861f4a
commit e354f3e57e