Add English to Katakana and Romaji conversion support

This commit is contained in:
2025-06-11 22:04:43 +09:00
parent 653425bf34
commit a77a8aa9bd
10 changed files with 378 additions and 11 deletions

81
scripts/setup-mecab.sh Executable file
View File

@ -0,0 +1,81 @@
#!/bin/bash
# MeCab Setup Script for Voice RSS Summary
# This script installs MeCab and IPA dictionary required for English to Katakana conversion
set -e
echo "=== MeCab Setup Script ==="
echo "This script will install MeCab and IPA dictionary for English to Katakana conversion."
echo
# Detect OS
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo "Detected Linux OS"
# Detect distribution
if [ -f /etc/debian_version ]; then
echo "Detected Debian/Ubuntu"
echo "Updating package list..."
sudo apt-get update
echo "Installing MeCab and IPA dictionary..."
sudo apt-get install -y mecab mecab-ipadic-utf8 libmecab-dev
echo "Testing MeCab installation..."
echo "こんにちは Hello" | mecab
elif [ -f /etc/redhat-release ]; then
echo "Detected Red Hat/CentOS/Fedora"
# Check if dnf exists (newer versions)
if command -v dnf &> /dev/null; then
echo "Installing MeCab using dnf..."
sudo dnf install -y mecab mecab-ipadic mecab-devel
else
echo "Installing MeCab using yum..."
sudo yum install -y mecab mecab-ipadic mecab-devel
fi
echo "Testing MeCab installation..."
echo "こんにちは Hello" | mecab
else
echo "Unsupported Linux distribution. Please install MeCab manually."
echo "Required packages: mecab, mecab-ipadic (or mecab-ipadic-utf8), mecab-devel (or libmecab-dev)"
exit 1
fi
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "Detected macOS"
# Check if Homebrew is installed
if ! command -v brew &> /dev/null; then
echo "Homebrew is not installed. Please install Homebrew first:"
echo "https://brew.sh/"
exit 1
fi
echo "Installing MeCab using Homebrew..."
brew install mecab mecab-ipadic
echo "Testing MeCab installation..."
echo "こんにちは Hello" | mecab
else
echo "Unsupported operating system: $OSTYPE"
echo "Please install MeCab manually for your operating system."
exit 1
fi
echo
echo "=== MeCab installation completed successfully! ==="
echo
echo "You can now run the Voice RSS Summary application with English to Katakana conversion support."
echo
echo "To start the application:"
echo " bun install"
echo " bun run build:frontend"
echo " bun run start"
echo