Skip to content

Linguistic engine: grapheme-aware phonemizer, transitivity-aware grammar, and lyrics loader#12

Merged
recursive-ai-dev merged 2 commits into
mainfrom
codex/implement-production-ready-script
Jan 6, 2026
Merged

Linguistic engine: grapheme-aware phonemizer, transitivity-aware grammar, and lyrics loader#12
recursive-ai-dev merged 2 commits into
mainfrom
codex/implement-production-ready-script

Conversation

@recursive-ai-dev

Copy link
Copy Markdown
Owner

Motivation

  • Remove placeholder and mock logic in the phoneme/grammar pipeline to make linguistic analysis production-grade and deterministic.
  • Improve syllable, stress, and rhyme accuracy by switching to grapheme-aware tokenization and explicit silent-e handling.
  • Ensure generated sentences obey grammatical constraints by making verb transitivity and adverbs lexicon-driven rather than injected as mocks.
  • Source the training/poetic corpus from real assets when available to avoid relying solely on embedded sample text.

Description

  • Implemented a grapheme-aware phonemizer in src/UniversalLinguisticEngine.js by adding vowelTeams, consonantDigraphs, _phonemizePart, _isVowel, and silent-e handling to replace sequential regex-rewrite placeholders.
  • Added deterministic lexicon selection and transitivity-aware VP branching via _selectEntry and updated getFlatGrammar to use Adv entries from the lexicon instead of a hardcoded list.
  • Replaced the placeholder corpus loader in src/App.jsx with a Vite glob-based loader using import.meta.glob('/lyrics/*.txt', { as: 'raw' }), including file load error handling, deduplication, and fallback to the embedded corpus.
  • Documented the implementation rationale and expanded test coverage instructions by updating LOGIC-MAP.md, WE-CHOSE.md, and TESTING.md with logic chains and a non-mock test matrix.

Testing

  • No automated test suites were executed as part of this change; the edits were implemented and committed without running CI tests.
  • TESTING.md was updated with concrete, non-mock test cases for analyze() (e.g., analyze('cake'), analyze('rain'), analyze('shadow')) and generation edge cases for transitive vs intransitive verbs.
  • The corpus loader test cases validate file detection, deduplication, skipping empty lines, and fallback behavior to the embedded corpus when /lyrics/*.txt resolves to nothing.
  • Manual validation through the UI controls is recommended to exercise sentence generation and corpus loading scenarios described in TESTING.md.

Codex Task

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@codacy-production

codacy-production Bot commented Jan 6, 2026

Copy link
Copy Markdown

Codacy's Analysis Summary

0 new issue (≤ 0 issue)
0 new security issue

Review Pull Request in Codacy →

AI Reviewer available: add the codacy-review label to get contextual insights without leaving GitHub.

@recursive-ai-dev
recursive-ai-dev merged commit 6b3d8e3 into main Jan 6, 2026
1 of 5 checks passed
@sonarqubecloud

sonarqubecloud Bot commented Jan 6, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
2 Security Hotspots
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant