Update script for Android added. A few more dictionary fixes added.

This commit is contained in:
Storm Dragon
2026-03-01 23:56:46 -05:00
parent 4b7a1a3dfa
commit eb3be80365
5 changed files with 139 additions and 9 deletions
+1
View File
@@ -1,3 +1,4 @@
alicia=aleesha
bifrost=buyfraust bifrost=buyfraust
cthulhu=kthoolu cthulhu=kthoolu
danestange=dainstanggey danestange=dainstanggey
+1
View File
@@ -6,6 +6,7 @@ disconnects=disconects
douche=doosh* douche=doosh*
espeak=easpeak* espeak=easpeak*
firepit=fiarpit firepit=fiarpit
foliage=foalyage
freenginx=freeenginex freenginx=freeenginex
git=ghit* git=ghit*
github=ghittehub github=ghittehub
+29 -5
View File
@@ -7,17 +7,41 @@ This repository contains pronunciation dictionaries for RHVoice's English voices
- `English/namefix.txt` - Pronunciation corrections for proper names - `English/namefix.txt` - Pronunciation corrections for proper names
- `English/wordfix.txt` - Pronunciation corrections for common words - `English/wordfix.txt` - Pronunciation corrections for common words
## Installation ## Update Scripts
### Automatic Installation ### Linux
Run the installation script: Run the Linux update script:
```bash ```bash
sudo ./install.sh sudo ./update_linux.sh
``` ```
### Manual Installation This copies the `English` directory to `/etc/RHVoice/dicts/`.
### Android
Run the Android update script with your device connected over `adb`:
```bash
./update_android.sh
```
The Android script checks for `adb`, verifies that `com.github.olga_yakovleva.rhvoice.android` is installed, creates the RHVoice dictionary directory if needed, and pushes the dictionary files to:
```text
/sdcard/Android/data/com.github.olga_yakovleva.rhvoice.android/files/dicts/English
```
RHVoice also keeps its config under the same external app files directory, for example:
```text
/sdcard/Android/data/com.github.olga_yakovleva.rhvoice.android/files/RHVoice.conf
```
Android private app data also exists under `/data/user/0/com.github.olga_yakovleva.rhvoice.android`, but that area is not readable over normal `adb` on a non-debuggable Play Store build.
### Manual Linux Installation
Copy the English directory to the RHVoice dictionaries location: Copy the English directory to the RHVoice dictionaries location:
+104
View File
@@ -0,0 +1,104 @@
#!/usr/bin/env bash
# Update RHVoice English pronunciation fixes on Android via adb
set -euo pipefail
packageName="com.github.olga_yakovleva.rhvoice.android"
sourceDir="English"
remoteBaseDir="/sdcard/Android/data/${packageName}/files"
remoteDictDir="${remoteBaseDir}/dicts/English"
adbArgs=()
check_command() {
local commandName="$1"
if ! command -v "$commandName" >/dev/null 2>&1; then
echo "Error: Required command '$commandName' is not installed" >&2
exit 1
fi
}
run_adb() {
adb "${adbArgs[@]}" "$@"
}
select_device() {
local deviceCount
if [[ -n "${ADB_SERIAL:-}" ]]; then
adbArgs=(-s "$ADB_SERIAL")
return
fi
deviceCount="$(adb devices | awk 'NR > 1 && $2 == "device" { count++ } END { print count + 0 }')"
if [[ "$deviceCount" -eq 0 ]]; then
echo "Error: No Android device in 'device' state found" >&2
exit 1
fi
if [[ "$deviceCount" -gt 1 ]]; then
echo "Error: Multiple Android devices detected. Set ADB_SERIAL to choose one." >&2
exit 1
fi
}
check_source_dir() {
if [[ ! -d "$sourceDir" ]]; then
echo "Error: Source directory '$sourceDir' not found" >&2
exit 1
fi
}
check_package() {
if ! run_adb shell pm list packages "$packageName" | tr -d '\r' | grep -Fxq "package:${packageName}"; then
echo "Error: RHVoice package '$packageName' is not installed on the connected device" >&2
exit 1
fi
}
push_dict_files() {
local dictFiles=()
local sourcePath
local fileName
shopt -s nullglob
dictFiles=("$sourceDir"/*.txt)
shopt -u nullglob
if [[ "${#dictFiles[@]}" -eq 0 ]]; then
echo "Error: No dictionary files found in '$sourceDir'" >&2
exit 1
fi
echo "Ensuring RHVoice dictionary directory exists at ${remoteDictDir}..."
run_adb shell mkdir -p "$remoteDictDir"
for sourcePath in "${dictFiles[@]}"; do
fileName="$(basename "$sourcePath")"
echo "Pushing ${sourcePath} to ${remoteDictDir}/${fileName}..."
run_adb push "$sourcePath" "${remoteDictDir}/${fileName}" >/dev/null
done
}
show_remote_dir() {
echo "Remote dictionary files:"
run_adb shell ls -l "$remoteDictDir" | tr -d '\r'
}
main() {
check_command adb
check_source_dir
select_device
check_package
push_dict_files
show_remote_dir
echo "Android update complete!"
echo "RHVoice dictionaries on Android are stored in ${remoteDictDir}."
echo "RHVoice config on Android is stored under ${remoteBaseDir}, for example ${remoteBaseDir}/RHVoice.conf."
echo "You may need to restart RHVoice or apps using it for changes to take effect."
}
main "$@"
+4 -4
View File
@@ -1,8 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Install RHVoice English pronunciation fixes # Update RHVoice English pronunciation fixes on Linux
set -e set -euo pipefail
# Check if running as root # Check if running as root
if [[ $EUID -ne 0 ]]; then if [[ $EUID -ne 0 ]]; then
@@ -24,10 +24,10 @@ fi
mkdir -p "$dictDir" mkdir -p "$dictDir"
# Copy English pronunciation fixes # Copy English pronunciation fixes
echo "Installing English pronunciation fixes to $dictDir..." echo "Updating English pronunciation fixes in $dictDir..."
cp -rv "$sourceDir" "$dictDir/" cp -rv "$sourceDir" "$dictDir/"
echo "Installation complete!" echo "Linux update complete!"
echo "You may need to restart applications using RHVoice for changes to take effect." echo "You may need to restart applications using RHVoice for changes to take effect."
echo "For example:" echo "For example:"
echo "sudo killall speech-dispatcher" echo "sudo killall speech-dispatcher"