Conversation
📱 Preview buildsSigned release builds of
Or open https://182910cb-alkitab-pr.yukuku.workers.dev on an Android device. These share their application IDs and signature with the Play Store builds, so installing one replaces the corresponding installed app (data is kept). This comment tracks the latest build for this PR; earlier builds keep their own URLs. |
…ble version Letter search fails Indonesian both ways: kasih cannot find mengasihi because the prefix swallows the k, and berkat returns every berkata. Smart search widens each plain query word to its word family and matches whole words. A word the version never uses has its affixes peeled until a listed form is reached, and anything unknown still falls back to the letter search. +word and quoted phrases keep their exact meaning. The word families are part of the version's own data, like xrefs and footnotes: a lexicon section in yes files and <prefix>_lexicon_bt.bt for the internal version, one Bintex format read by LexiconSection. Forms are abbreviated: ~ stands for the root and < for the root rewritten by a prefix table stored alongside (k -> ng), so kasih me<i is mengasihi. The .yet format gains lexicon_prefix and lexicon lines, which YetToYes2 and YetToInternal carry over. An Indonesian version without a lexicon gets rules-only families derived on the device. Diagnostics are visible in the app while the prototype is evaluated: a panel above the results explains how each word was resolved and which forms were searched, compares with the letter search (new and dropped verses, with filters), and reports timings; result rows are badged NEW or DROPPED with the forms that matched. The Search Lab holds the switches and word-list mode, plans any query with both the built-in lexicon and rules only, and runs a self-check. The search tips describe the syntax actually in effect. On Terjemahan Baru: sembuhkan sakit goes from 6 to 48 verses, beriman from 14 to 225, and berkat from 3,059 to 279. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xk4Y839XNeb9v1wkQDpQWm
yukuku
force-pushed
the
claude/search-tips-communication-lj6181
branch
from
September 23, 2026 03:59
a6e56fa to
f164385
Compare
Each form in the lexicon section is now a sequence of tokens: 0 is the root as is, 1 is the root rewritten by the prefix table, 2 is a literal followed by an autostring, 3 to 5 are reserved, and n >= 6 is entry n - 6 of a table of text pieces. Only pieces used at least twice go in the table; the rest are literals. No separator characters are needed, and any text can sit between roots (me, root, "-", root, kan). The .yet keeps the readable ~ and < notation, now tab-separated, and the converters encode it into tokens. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xk4Y839XNeb9v1wkQDpQWm
…them A .yet lexicon line is now the root and its forms spelled out, with no notation and no prefix table. LexiconCompiler, used by the section writer, finds rewrite rules for both ends of roots in the data, adopting one at a time whichever makes the output smallest, then splits each form into root tokens and text and shares the text runs used more than once. The section format is version 1 (nothing has shipped): start rules, end rules, pieces, then families. Token 3 is the root with its end rewritten by the end rules, so English changes such as love to loving or carry to carried fit the same scheme as Indonesian nasal prefixes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xk4Y839XNeb9v1wkQDpQWm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Search matches letters, and for Indonesian that fails in both directions:
kasihcan't findmengasihi, because the prefix swallows the k.berkatreturns everyberkata.This prototype widens each plain query word to its whole word family and matches whole words. On Terjemahan Baru, in verses:
sembuhkan sakitberimanberkatWord lists live in the Bible version
The word families are part of the version's own data, like xrefs and footnotes.
Where they're stored
.yesfile, as a newlexiconsection.{prefix}_lexicon_bt.bt.LexiconSection(AlkitabYes2).Version.loadLexicon()exposes them, implemented byYes2ReaderandInternalReader.How forms are encoded (data format version 1)
The section holds start rules, end rules, a pieces table, then the families. Each form is a sequence of tokens, with no separator characters:
Any text can sit between roots:
mereka-rekakanisme, root,-, root,kan.End rules cover English spelling changes (
love→loving,carry→carried) the same way start rules cover Indonesian nasal prefixes.For TB (2,942 families, 15,373 forms) that is 78 KiB as the internal file, or 49 KB inside the
.yesafter Snappy.The spec is in
docs/binary-formats.md..yetand the converters.yetgainslexiconlines: the root, then every form spelled out, tab-separated. No notation, no rule table.LexiconCompiler, called by the section writer, decides the encoding. It adopts rewrite rules one at a time, each time the one that makes the output smallest, then splits every form into root tokens and text. Text runs used at least twice become shared pieces, and the rest are literals.t → "",s → y,k → g,p → mwithmenas a shared piece, not the textbookk → ng. The file is the same size as with the hand-written table.YetFileInput,YetToYes2andYetToInternalcarry the families over and print what the compiler chose.CopyProprietaryAssetsTasknow packages*_lexicon_bt.bt.Related PRs
in-tb.yet: yukuku/alkitab-sources#3An Indonesian version without a lexicon gets rules-only families derived on the device.
How a query term is resolved
Checked in this order:
sembuhkan→sembuh.+wordand quoted phrases are unchanged.Diagnostics (visible to the user, on by default in the prototype)
Panel above the results
Result rows
NEW/DROPPEDbadges, plus avia …line naming the forms that matched.Search Lab (search menu)
Also: two experimental settings (Smart search (Indonesian), Smart search diagnostics), and rewritten search tips (EN/ID).
Testing
./gradlew testPlainDebugUnitTest testPlainReleaseUnitTest :AlkitabYes2:testDebugUnitTest assemblePlainDebug: all 1,738 tests passing.AlkitabYes2tests, including 11 inLexiconSectionTest: rule matching at both ends, the rules found for Indonesian and English samples, text between roots, pieces vs literals, reserved tokens, round trips.TerjemahanBaruSmartSearchTestchecks the table above against the real TB.yet. It also checks that the generatedin-tb.yessection andtb_lexicon_bt.btdecode to the same families. It needsALKITAB_TB_YET(plus optionallyALKITAB_TB_YES/ALKITAB_PROPRIETARY_DIR) and is skipped otherwise; locally it passes 9/9.in-tb.yet. Every regeneratedtb_*internal file is byte-identical to the one in the proprietary overlay, apart from the new lexicon file.SmartSearchSnapshotTestrenders the panel and Lab in EN/ID toAlkitab/build/snapshots/smart-search/.Open question
The TB word list keeps
kasihanas its own family, sokasihdrops 145 verses, mostly belas kasihan. The Dropped filter shows them.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xk4Y839XNeb9v1wkQDpQWm