From ed88581eacda0dff9ecfc634c4da6afbdc0ddd54 Mon Sep 17 00:00:00 2001 From: De'vID Date: Wed, 22 Jun 2022 22:28:00 +0000 Subject: [PATCH 1/4] Fix number-forming element parsing by putting commpounds first. --- .../KlingonContentProvider.java | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/org/tlhInganHol/android/klingonassistant/KlingonContentProvider.java b/app/src/main/java/org/tlhInganHol/android/klingonassistant/KlingonContentProvider.java index 83f2a180..fcd21cfc 100644 --- a/app/src/main/java/org/tlhInganHol/android/klingonassistant/KlingonContentProvider.java +++ b/app/src/main/java/org/tlhInganHol/android/klingonassistant/KlingonContentProvider.java @@ -2075,18 +2075,22 @@ public static class ComplexWord { }; static String[] numberModifierString = { "", - "maH", - "vatlh", - "SaD", "SanID", // 1000 (thousand) - "netlh", - "bIp", - "'uy'", // 1 000 000 (million) - "maH'uy'", "vatlhbIp", - "vatlh'uy'", "SaDbIp", "SanIDbIp", - "Saghan", // 1 000 000 000 (billion) - "maHSaghan", - "vatlhSaghan", "bIp'uy'", - "SaDSaghan", "SanIDSaghan" // 1 000 000 000 000 (trillion) + + // Since matching is greedy, compound number-forming elements have to come first. + "maH'uy'", "vatlhbIp", // 10 000 000 + "vatlh'uy'", "SaDbIp", "SanIDbIp", // 100 000 000 + "maHSaghan", // 10 000 000 000 + "vatlhSaghan", "bIp'uy'", // 100 000 000 000 + "SaDSaghan", "SanIDSaghan", // 1 000 000 000 000 + + // Basic number-forming elements. + "maH", // 10 + "vatlh", // 100 + "SaD", "SanID", // 1000 + "netlh", // 10 000 + "bIp", // 100 000 + "'uy'", // 1 000 000 + "Saghan", // 1 000 000 000 }; int mNumberDigit; int mNumberModifier; From ae8dc54848fd5dae6142797ff5926cab199aa800 Mon Sep 17 00:00:00 2001 From: De'vID Date: Wed, 22 Jun 2022 14:20:27 +0200 Subject: [PATCH 2/4] Remove QUERY_ALL_PACKAGES permission to be compliant with updated policy. --- app/src/main/AndroidManifest.xml | 2 +- .../klingonassistant/EntryActivity.java | 26 +++++++++---------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 10cb00e7..1aa44b93 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -26,8 +26,8 @@ - + diff --git a/app/src/main/java/org/tlhInganHol/android/klingonassistant/EntryActivity.java b/app/src/main/java/org/tlhInganHol/android/klingonassistant/EntryActivity.java index d33680fa..43904c90 100644 --- a/app/src/main/java/org/tlhInganHol/android/klingonassistant/EntryActivity.java +++ b/app/src/main/java/org/tlhInganHol/android/klingonassistant/EntryActivity.java @@ -90,15 +90,9 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // TTS: - // Initialize text-to-speech. This is an asynchronous operation. - // The OnInitListener (second argument) is called after initialization completes. // Log.d(TAG, "Initialising TTS"); clearTTS(); - mTts = - new TextToSpeech( - this, - this, // TextToSpeech.OnInitListener - "org.tlhInganHol.android.klingonttsengine"); + mTts = initTTS(); setDrawerContentView(R.layout.entry_swipe); @@ -183,18 +177,22 @@ protected void onResume() { super.onResume(); // TTS: - // Initialize text-to-speech. This is an asynchronous operation. - // The OnInitListener (second argument) is called after initialization completes. // This is needed in onResume because we send the user to the Google Play Store to // install the TTS engine if it isn't already installed, so the status of the TTS // engine may change when this app resumes. // Log.d(TAG, "Initialising TTS"); clearTTS(); - mTts = - new TextToSpeech( - this, - this, // TextToSpeech.OnInitListener - "org.tlhInganHol.android.klingonttsengine"); // Requires API 14. + mTts = initTTS(); + } + + private TextToSpeech initTTS() { + // TTS: + // Initialize text-to-speech. This is an asynchronous operation. + // The OnInitListener (second argument) is called after initialization completes. + return new TextToSpeech( + this, + this, // TextToSpeech.OnInitListener + "org.tlhInganHol.android.klingonttsengine"); // Requires API 14. } private void clearTTS() { From 6b02acfd8cb7af1eadba1373c1835c01da761ee8 Mon Sep 17 00:00:00 2001 From: De'vID Date: Wed, 22 Jun 2022 14:41:52 +0200 Subject: [PATCH 3/4] Turn off suggestions in search bar. --- app/src/main/res/xml/searchable.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/res/xml/searchable.xml b/app/src/main/res/xml/searchable.xml index cc3c2dea..e4b48a53 100644 --- a/app/src/main/res/xml/searchable.xml +++ b/app/src/main/res/xml/searchable.xml @@ -25,6 +25,7 @@ Date: Wed, 22 Jun 2022 14:50:12 +0200 Subject: [PATCH 4/4] version 2022.06.22b (567) --- CHANGELOG | 1 + app/build.gradle | 4 ++-- .../android/klingonassistant/KlingonContentDatabase.java | 2 +- data | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 58c3ed28..5d621844 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ CHANGELOG +2022-06-22: Remove QUERY_ALL_PACKAGES permission. Turn off suggestions in search bar. Add parsing of compound number-forming elements. 2021-11-09: Add {Qa} to two-letter verb shortlist. New vocabulary from {QelIS boqHarmey}. 2021-10-08: Fix bug with parsing 4-letter complex words containing 2-letter verbs. 2021-10-05: Add ability to suppress display of notes in non-English language. diff --git a/app/build.gradle b/app/build.gradle index 0eef212d..1e97806e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,8 +12,8 @@ android { // We are targeting only Marshmallow and above. minSdkVersion 23 targetSdkVersion 30 - versionCode 565 - versionName "2021.11.09a" + versionCode 567 + versionName "2022.06.22b" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { diff --git a/app/src/main/java/org/tlhInganHol/android/klingonassistant/KlingonContentDatabase.java b/app/src/main/java/org/tlhInganHol/android/klingonassistant/KlingonContentDatabase.java index b2d01f51..5a6b7b9e 100644 --- a/app/src/main/java/org/tlhInganHol/android/klingonassistant/KlingonContentDatabase.java +++ b/app/src/main/java/org/tlhInganHol/android/klingonassistant/KlingonContentDatabase.java @@ -193,7 +193,7 @@ public class KlingonContentDatabase { // This should be kept in sync with the version number in the data/VERSION // file used to generate the database which is bundled into the app. - private static final int BUNDLED_DATABASE_VERSION = 202111090; + private static final int BUNDLED_DATABASE_VERSION = 202206221; // Metadata about the installed database, and the updated database, if any. public static final String KEY_INSTALLED_DATABASE_VERSION = "installed_database_version"; diff --git a/data b/data index c9007083..f4baf752 160000 --- a/data +++ b/data @@ -1 +1 @@ -Subproject commit c900708399454f80f952b533d85bb2abb20d721e +Subproject commit f4baf7527a8c96bfbde6181d42e55ab17fc9f9af