- Refactored monolithic
sentence_generation.pyinto apgp/package (types,parser,web,cli). - Removed hardcoded default lexicon seeds —
lexicon.jsonis now the sole source of vocabulary. - Fixed POS-guessing mutation bug:
_guess_posno longer permanently writes inferred tags into the lexicon, preventing state pollution across requests. - Fixed unused return values in recursive-descent parse methods (
_parse_npreturn signature simplified). - Added
token_tagsfield to/api/parseresponse — each token carries its word, POS, human-readable label, and aguessedflag. - Added
/api/healthendpoint returning server status and lexicon size. - Added input length validation (max 500 characters).
- Security headers added to all responses:
X-Content-Type-Options,X-Frame-Options,Referrer-Policy. - Internal server errors no longer leak exception details to API clients; full traces go to the server log.
- Added structured logging via Python's
loggingmodule throughout thepgp/package. - Flask app now uses an app-factory pattern (
create_app()), decoupling it from module-level state. - Expanded
lexicon.jsonfrom ~50 to ~150 entries across all POS categories. - Pinned all dependency version constraints in
requirements.txt. - UI: token chips with per-POS color coding and part-of-speech labels.
- UI: parse history panel — last 8 parses with one-click restore.
- UI: loading spinner on the Parse button during in-flight requests.
- UI: copy-to-clipboard buttons on diagram text blocks.
- UI: placeholder graphics in diagram boxes before first parse.
- UI: heuristically guessed tokens marked with a
?badge and explanatory note.
- Added click-to-expand modal for diagram images with smooth animations.
- Added image hover effects and keyboard navigation (Escape to close).
- Added mobile-friendly fullscreen diagram viewing.
- Added support for adverbs in clauses.
- Added support for prepositional phrases in noun and sentence contexts.
- Added support for compound clauses joined by
andandor. - Added external JSON lexicon loading from
lexicon.json. - Added Flask frontend and parse API endpoint.
- Added server-side PNG rendering for original and reduced diagrams.
- Added project documentation and versioned release notes.