📚 Encyclopedia

Flutter & Mobile · updated 2026-10-13

Offline voice dictation with fuzzy matching against a catalog

speech-to-textfuzzy-matchingjaro-winklerlexerflutterofflinelocal-first

The plumb Android app (Flutter, local-first) lets a tradesman say "two three quarter elbows, labor two hours, wax ring" and get priced invoice lines without any AI or network: on-device speech to text, then a small lexer, a dictation parser, and a fuzzy matcher against his own pricebook. AI was kept only as an optional extra (reading receipt photos). The design generalizes to any "speak items from a known catalog" problem: groceries, inventory, parts orders.

Pipeline

  1. Speech: the speech_to_text plugin, auto-restarted after each pause so a long dictation is not cut off, with an optional on-device-only mode. (Verified to initialize on an emulator; accuracy with trade vocabulary on a real phone was still unmeasured.)
  2. Lexer (core/lexer.dart): classifies tokens as quantity, pipe size, unit or word. This is where "two three quarter elbows" (2 x 3/4" elbow) differs from "two inch PVC" (one item, 2" size). A separate nameMode lexes catalog names.
  3. Dictation parser (core/dictation.dart): splits the transcript into items on pauses and commas, "and", numbers, and "a/an"; then rejoins splits when the whole phrase is itself a catalog item ("tub and shower valve", "install a toilet"). Moves a duration ("two hours") onto the per-hour labor item even when it appears elsewhere in the phrase.
  4. Matcher (core/matcher.dart): scores each phrase against every item name and alias.

Scoring

Never guess

Learning from corrections, carefully

When the user fixes an unmatched line, the phrase-to-item mapping is saved (table learned), so the same words match next time. When the user resolves an ambiguous line, nothing is learned on purpose: "copper pipe" should keep asking which size instead of silently becoming whatever was picked last.

Surrounding app decisions

See also

Linked from

Sources: plumb memory (plumb-android-app, plumb-canon), 2026-10-06