Skip to content

More ngrams#1138

Merged
sspanak merged 4 commits into
masterfrom
more-ngrams
Jun 1, 2026
Merged

More ngrams#1138
sspanak merged 4 commits into
masterfrom
more-ngrams

Conversation

@sspanak
Copy link
Copy Markdown
Owner

@sspanak sspanak commented Jun 1, 2026

Part of #851

@sspanak sspanak requested a review from Copilot June 1, 2026 17:25
@sspanak sspanak self-assigned this Jun 1, 2026
@sspanak sspanak added the enhancement New feature or request label Jun 1, 2026
@sspanak sspanak changed the base branch from master to clipboard-swipe-commands June 1, 2026 17:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds explicit ngramFile configuration to language definitions (rather than deriving the filename from dictionaryFile), enabling next-word prediction support per language as part of issue #851. It also tweaks soft-key behavior (new edit-text icon/command for RF3, fixing SoftKeyNumberSwipeable to use a new COLLECTION_SWIPE command collection) and changes the MindReader seeding flow to handle languages without spaces between words via a new setTokens() method. The UsageStatsScreen truncation now also resets the per-language ngrams revision so factory n-grams are re-imported.

Changes:

  • Replace derived ngram file paths with an explicit ngramFile: property on every language YAML; wire it through gradle parsing and validation.
  • Add MindReaderContext.setTokens() for pre-tokenized seeding (non-space languages) and refactor MindReader.seed() accordingly; drop the unused return value from setContext().
  • Introduce COLLECTION_SWIPE command set (including cut/copy/paste), new ic_fn_edit_text icon, and use the edit-text command's icon in SoftKeyRF3.

Reviewed changes

Copilot reviewed 45 out of 49 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
CONTRIBUTING.md Documents the new optional ngramFile property.
app/build.gradle, app/build-dictionaries.gradle, app/build-ngrams.gradle, app/validate-languages.gradle Pass ngramsInputDir through gradle helpers; parse and validate the new ngramFile key.
app/languages/definitions/*.yml Add ngramFile: entry for each language.
app/src/main/java/io/github/sspanak/tt9/languages/LanguageDefinition.java Parse ngramFile and use it for getNgramsFile().
app/src/main/java/io/github/sspanak/tt9/ime/mindreader/MindReaderContext.java Add tokenized flag and setTokens(); tokenize() now skips re-tokenizing pre-set tokens.
app/src/main/java/io/github/sspanak/tt9/ime/mindreader/MindReader.java Use setTokens() for languages without spaces during factory n-gram seeding; remove unused return from setContext().
app/src/main/java/io/github/sspanak/tt9/preferences/screens/UsageStatsScreen.java Reset factory ngrams revision after truncating MindReader tables.
app/src/main/java/io/github/sspanak/tt9/commands/CommandCollection.java Add COLLECTION_SWIPE with cut/copy/paste in addition to hotkeys.
app/src/main/java/io/github/sspanak/tt9/commands/CmdEditText.java Use the new edit-text icon.
app/src/main/java/io/github/sspanak/tt9/ui/main/keys/SoftKeyRF3.java Show the edit-text icon (instead of cut) as the central icon.
app/src/main/java/io/github/sspanak/tt9/ui/main/keys/SoftKeyNumberSwipeable.java Look up swipe commands from COLLECTION_SWIPE instead of hotkeys.
app/src/main/res/drawable/ic_fn_edit_text.xml New edit-text vector drawable.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 45 out of 49 changed files in this pull request and generated no new comments.

@sspanak sspanak force-pushed the clipboard-swipe-commands branch from 2c58e05 to 9729373 Compare June 1, 2026 17:58
Base automatically changed from clipboard-swipe-commands to master June 1, 2026 17:59
@sspanak sspanak merged commit 458cbcf into master Jun 1, 2026
2 checks passed
@sspanak sspanak deleted the more-ngrams branch June 1, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants