Morphemes
In Turkish, bilmediysen means “if you did not know.” One word. How do you make sense of it?
bilmediysen = “if you did not know”
Person ending. Says who did not know.
Split into its pieces, the word stops being a wall of letters: a root, then negation, past tense, a buffer letter, the conditional, and the person. Each piece is small and learnable on its own. Most resources hand you the finished word, or a table of endings to memorize, and skip the part where it is built.
I wanted an app that breaks grammar down like this, into small pieces that make the whole understandable. After a successful prototype, I expanded it to more languages.
01 /Expanding to six languages
Not every language stacks suffixes. Italian inflects and agrees, so the same sentence-level idea shows up as a dependency tree: who governs whom, and which words must match.
Dependency parse
L'ho fatta parlare in italiano.
Past participle
Agrees in gender with the clitic. The structural head of the clause.
- ITItalianAgreement clusters, fusional morphology
- DEGermanCase governance, verb-bracket structures
- RURussianSix-case system, aspect pairs
- TRTurkishAgglutinative X-Ray, suffix decomposition
- ESSpanishAgreement clusters, ser/estar distinction
- JAJapaneseVerb and adjective conjugation, honorific register
02 /Structural-First Analysis
Earlier versions asked an LLM to identify grammar. Output was fluent and hallucinatory. I rebuilt the engine in December 2025.
Analyst
spaCy parses via Universal Dependencies, with Stanza as an automatic fallback. Lemmatization, POS tags, and dependency arcs are extracted deterministically. No model hallucination at this layer.
Strategist
Language-specific post-processing. Turkish, German, Russian, Italian, and Spanish each get rules for how they actually build meaning. A one-size-fits-all engine is a mistake.
Tutor
Only after structure is known does the AI explain it in natural language, teaching from a structure that is already on the page.
03 /Built out from there
- Interactive SVG dependency tree. Click a word for POS, lemma, case, tense, relation.
- Rule-based grammar error detection and CEFR difficulty scoring (A1–C2), both computed from the parsed structure.
- Sentence similarity via pgvector and sentence-transformers against the user's own history.
- Learn section: CEFR-organized grammar curriculum, A1–C2.
- A dual spaced-repetition system for vocabulary and grammar concepts, wrapped in streaks and achievements.
- Teacher suite: classes, live real-time quizzes, AI-graded writing prompts, a gradebook, and a per-student grammar readiness heat map.
- Sentence Remix: past tense, negative, plural, formal, passive, each re-parsed and diff-highlighted against the original.
- Paragraph mode, error-trend analytics, and AI study plans tracked against live mastery data.
04 /Making the AI fast and dependable
Eight generative services run through one Python LLM service with structured JSON outputs, OpenRouter as the primary provider and OpenAI as fallback. The engineering is in everything around the model call.
- 9s → 4s
- full analysis
- 300–500ms
- tree on screen
- 3 tiers
- of caching
Parallel inference
Sequential parse plus LLM took nine seconds. Parsing, the LLM explanation, and the embedding now run concurrently with asyncio.gather over executor futures, about four seconds wall-clock. If the LLM fails, the tree still returns.
Two-phase streaming
A separate NLP-only endpoint puts the dependency tree on screen in 300–500ms while the pedagogy panel fills in behind a skeleton.
Cache before you call
Analyses cache in Redis for 24 hours under SHA-256 keys. Conjugation paradigms are generated once and persisted in Postgres and Redis, so exploring a common verb assembles sentences without calling a model at all.
Rules where rules win
CEFR difficulty is scored from engineered features like tree depth, subordination, and morphological complexity. Quizzes are generated by rules behind a quality gate, and the LLM is only a fallback. Only raw sentence text is sent to providers, never account data.