Task architecture

Offline Thai Word-Segmentation Translation Test

Test preprocessing, line breaking, tokenization, literal spans, translation, long text, editing, and recovery with Thai fixtures.

Review status: Fact and editorial QA complete; owner review pending · 2026-10-05 · Fact IDs: ARCH-01, BENCHMARK-01

Direct answer

Thai text review needs more than a screenshot showing readable glyphs. A product may need word selection, line wrapping, search, and editing, and those operations do not all use the same boundary rules. Android ICU BreakIterator exposes distinct word, line, sentence, and character iterators; the word iterator and line iterator have different purposes. Unicode UAX #29 describes text boundaries and UAX #14 line breaking. These standards and APIs provide a method to test segmentation, not proof that an app's chosen component handles every Thai fixture as a user expects. ARCH-01 and BENCHMARK-01 support testing a pinned workflow; they do not certify Cove Thai translation. Keep four layers separate in the test record: the original Thai source string, the UI's word and line boundaries, any preprocessing or normalization, and the model's internal tokenization if observable. A word boundary used for a double-tap selection is not necessarily a legal line break. Neither is automatically the same as model tokens. Do not insert spaces into a source text just to make a test corpus easier to count, because that changes the fixture and can change search, cursor movement, and model input. Build a corpus with fluent-reviewed Thai phrases in natural writing, including cases with no spaces between words, spaces between clauses, Thai marks, Latin names, numbers, punctuation, emoji if relevant, and long runs that wrap at several widths. The reviewer should annotate expected selections and acceptable line-break positions for each UI context. Include a source phrase with a known exact character sequence to detect accidental normalization. Store encoding and rendering conditions, but keep private user text out of logs and screenshots. Run separate tests for selecting a word, selecting a sentence, moving the cursor, copying a span, searching exact text, and laying out a paragraph. Use the platform's appropriate iterator or the component under review, record the API and locale supplied to it, and inspect returned offsets against the original string. Then verify a user edit and undo path. If a translation result is displayed, compare source preservation and output layout without treating fluent appearance as translation correctness. Version preprocessing explicitly. If whitespace, punctuation, or combining marks are normalized, record the exact transform and preserve the original source. Compare UI display, selection offsets, clipboard output, and any request sent to the model. A bug can appear only after converting indices between UTF-16 code units, code points, and user-perceived characters. Use examples where one visible unit can comprise more than one code point, and check that selection never cuts a mark away from its base character. Test fallback and recovery. An unavailable locale-specific boundary iterator, malformed text, empty input, and very long input should not crash the task or silently rewrite the phrase. If a segmentation library uses a fallback locale or version, expose that fact in the test record. Keep a user-correction path where a person can adjust a boundary or select a larger span. Do not assume that a correction to UI segmentation should modify text sent to the model unless the user explicitly confirms the edited input. The report needs Android/API level, library and locale version, source fixture revision, display width, font and component, boundary type, selection operation, returned offsets, and failures. Preserve screenshots plus the original string and expected annotations. The scope is a text interaction and line-layout test. It cannot establish Thai language-model support, offline availability, accuracy, or quality for translation. If the product has no validated Thai task route, keep capability status unknown while still fixing UI boundary behavior.

A Thai reader selects a phrase to review a draft

A reader sees a long Thai sentence in an offline-translation screen and double-taps a word to edit a source span before retrying. The same text wraps on a narrow screen and includes a Latin model identifier, so word selection, line breaking, and preserved source characters all matter.

Decision

Test word, line, cursor, copy, and model-input boundaries separately with a reviewed fixture and a fixed UI width.

Expected outcome

The report identifies whether text interaction preserves the original sequence without claiming Thai translation support.

Evidence to collect

The claim becomes reviewable only when the following evidence is attached to the same artifact and test run:

  • Thai text and layout corpus
  • Tokenizer and preprocessing identity
  • Translation, correction, and failure outcomes

Task quality needs a versioned corpus and acceptance rules. Fluent sample output is not an accuracy result.

Implementation workflow

  1. Freeze reviewed Thai fixtures. Create synthetic phrases with natural spacing, marks, punctuation, Latin spans, numbers, long lines, and expected selection offsets reviewed by a fluent reader.
  2. Choose and record each boundary rule. Record whether the UI uses word, line, sentence, or character iteration, plus Android version, library, locale, and exact text component under test.
  3. Test selection, wrapping, and cursor movement. At several fixed widths, compare visible wraps and selected spans with annotations; test double tap, drag handles, copy, search, edit, and undo.
  4. Check offsets against source characters. Compare returned offsets with the immutable source string and verify combining marks, punctuation, and multi-code-unit characters remain attached to their original bases in the same fixture.
  5. Verify normalization and recovery paths. Inspect any transform before model handoff, test empty and malformed input, and confirm a user can correct boundaries without silent source rewriting.

Keep each transition observable. A failure should identify the stage, artifact, runtime, and recovery action without logging private user content.

Acceptance criteria

  • Word selection, line breaking, sentence selection, and model tokenization are represented as distinct concepts and results.
  • Selection offsets and copied text preserve the reviewed source sequence, including marks, punctuation, and mixed-script spans.
  • The report makes no Thai capability, offline availability, or translation-accuracy claim without a separate artifact evaluation.

Decision table

DimensionChoice or evidenceHow to interpret it
Word boundaryUse a word iterator for selection or whole-word searchDefines candidate word spans; it does not determine line wrapping or model tokens.
Line-break boundaryUse line layout rules for wrappingDetermines legal display breaks and may differ from word-selection boundaries.
Model tokenizerRecord only when the runtime exposes itAn internal model unit is not a UI word and should not be substituted for user-facing segmentation.

Failure patterns to prevent

  • Inserting spaces as ground truth
  • Testing romanized Thai only

Also prevent silent fallback, unpinned artifacts, missing cancellation, and conclusions that combine unlike configurations. Store unsuccessful runs alongside successful ones.

Minimum reproducibility record

LayerRecord
DeviceManufacturer, model, chipset, RAM class, operating-system build
SoftwareApplication version and git commit
ModelFamily, variant, revision, format, file length, hash, quantization
RuntimeName, revision, requested backend, observed backend evidence
WorkloadFixture revision, input hash, prompt hash, output policy
OutcomeCompleted, failed, cancelled, fallback, and privacy-safe diagnostics

Release checklist

  • ☐ The primary query is answered without an unsupported number.
  • ☐ Every artifact and runtime is pinned.
  • ☐ The representative task and failure policy are explicit.
  • ☐ Lifecycle, cancellation, cleanup, and fallback are tested.
  • ☐ User-content and network boundaries are documented.
  • ☐ Result wording applies only to the recorded configuration.
  • ☐ The page links to raw method or evidence when results are added.

Sources and related evidence

Chinese deployment and troubleshooting content is organized in the .奇连 AI 端侧专题.

Frequently asked questions

Are Thai word boundaries the same as line-break positions?

No. Android ICU exposes distinct word and line iterators, and Unicode defines separate boundary procedures; test the intended UI operation and component.

Should test fixtures insert spaces between every Thai word?

Not as a default. Added spaces alter the original fixture. Preserve natural text and annotate expected selections and wrapping positions with a fluent reviewer before testing.

Does passing Thai segmentation tests prove the model can translate Thai?

No. The tests cover text interaction and layout. Model support, offline readiness, and translation quality require separate evaluation for the exact artifact and direction.