Skip to content

Commit

Permalink
Merge pull request #126 from dlyongemallo/master
Browse files Browse the repository at this point in the history
version 2022.06.22b
  • Loading branch information
De7vID authored Jun 22, 2022
2 parents deb6dd9 + 40cecbd commit e5f2c58
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 31 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<!-- Needed in API 30 to query the TTS. -->
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
<queries>
<package android:name="org.tlhInganHol.android.klingonttsengine" />
<intent>
<action android:name="android.intent.action.TTS_SERVICE" />
</intent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/xml/searchable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<searchable xmlns:android="http://schemas.android.com/apk/res/android"
android:label="@string/search_label"
android:hint="@string/search_hint"
android:inputType="textNoSuggestions"
android:searchSettingsDescription="@string/settings_description"
android:searchSuggestAuthority="org.tlhInganHol.android.klingonassistant.KlingonContentProvider"
android:searchSuggestIntentAction="android.intent.action.VIEW"
Expand Down
2 changes: 1 addition & 1 deletion data

0 comments on commit e5f2c58

Please sign in to comment.