Back to corpus
research noteexperiment writeup candidatescore 24

NKO-2.4 COMPLETE — NKoPrediction: Predictive Text Engine

**Task:** NKO-2.4 — Build NKoPrediction — predictive text engine in Swift with CoreML stub **Status:** ✅ COMPLETE **Date:** 2026-02-19 **Wave:** 2 (FINAL TASK)

Full HTML reader

Read the full artifact

Open in new tab

Extracted abstract or opening context

**Task:** NKO-2.4 — Build NKoPrediction — predictive text engine in Swift with CoreML stub **Status:** ✅ COMPLETE **Date:** 2026-02-19 **Wave:** 2 (FINAL TASK) NKoPrediction is the unified predictive text engine that powers the N'Ko keyboard. It orchestrates 6 sub-engines into a single latency-budgeted pipeline that produces context-aware, morphology-informed, culturally-sensitive word and phrase predictions for Manding languages in N'Ko script. 1. **FrequencyPredictor** — Prefix match against 40+ lexicon entries + n-gram continuation 2. **ContextEngine** — Topic detection (8 categories) + Manding SOV grammar analysis → boost scores 3. **MorphologyExpander** — Root extraction via NKoMorphology → suffix expansion candidates 4. **PhoneticFallback** — IPA Levenshtein similarity via NKoPhonetics (when <3 candidates) 5. **CoreML** — Neural inference (when model loaded; stub no-ops for now) 6. **Merge & Rank** — Deduplicate, apply context boosts, filter by minScore, return top-K | File | Lines | Role | |------|-------|------| | `NKoPrediction.swift` | 415 | Main engine orchestrator, pipeline, merge/rank | | `FrequencyPredictor.swift` | 312 | Lexicon (40+ entries), n-gram seeding, prefix/next-word prediction | | `ContextEngine.swift` | 289 | Topic detection (8 categories), grammar analysis (SOV), contextual boosts | | `SmartCompose.swift` | 317 | Full-phrase completions: greetings, blessings, proverbs, welfare chains, responses | | `CoreMLSlot.swift` | 159 | `NKoLanguageModelProvider` protocol + `CoreMLStub` no-op + `CoreMLStatus` | | `PredictionResult.swift` | 301 | `PredictionCandidate`, `PredictionRequest/Response`, enums (TopicCategory, GrammarExpectation, ComposeIntent, ComposeSuggestion) | | `NGramModel.swift` | 246 | Thread-safe n-gram model (bi/trigram), backoff, prefix search, vocabulary tracking | | **Total source** | **2,039** | | | `PredictionTests.swift` | 358 | 43 tests across 7 test classes | | Dependency | How Used | |-----------|----------| | **NKoMorphology** | `analyzeWord()` → root extraction; `listSuffixes()` → morpheme expansion candidates | | **NKoPhonetics** | `toIPA()` → phonetic representation; Levenshtein similarity for phonetic fallback |

Promotion decision

What has to happen next

Attach run IDs, datasets, metrics, and reproduction commands.

Why this is not always a full paper yet

Corpus pages are public-safe readers for discovered workspace artifacts. They are not automatically final papers. A corpus item becomes a polished paper only after the editable source, evidence checkpoints, references, figures, render path, and release status are attached through the paper schema.