- 母語
- Zaitun
- 來自
- 泉州府晉江縣城東門
|
1#
发表于 2010-4-19 14:07
一段粤語辨音練習脚本
- #!/bin/bash
- prefix="http://humanum.arts.cuhk.edu.hk/Lexis/lexi-can/sound/"
- suffix=".wav"
- if [ -z $2 ]
- then
- echo Usage: compare reading1 reading2
- exit
- fi
- if [ ! -e ${1}${suffix} ]
- then
- wget ${prefix}${1}${suffix} &> /dev/null
- if [ $? -gt 0 ]
- then
- echo "No such sound as ${1}."
- exit
- fi
- fi
- if [ ! -e ${2}${suffix} ]
- then
- wget ${prefix}${2}${suffix} &> /dev/null
- if [ $? -gt 0 ]
- then
- echo "No such sound as ${2}."
- exit
- fi
- fi
- R=$RANDOM
- let R%=2
- if [ "$R" == 1 ]
- then
- answer="${1} ${2}"
- play ${1}${suffix} ${2}${suffix} &> /dev/null
- else
- answer="${2} ${1}"
- play ${2}${suffix} ${1}${suffix} &> /dev/null
- fi
- echo -n "Input guess:"
- read -e guess
- if [ "$guess" == "$answer" ]
- then
- echo -e "\e[00;32mCorrect!\e[00m"
- else
- echo -e "\e[00;31mIncorrect!\e[00m"
- fi
复制代码 [ 本帖最後由 28554010 於 2010-4-19 15:17 編輯 ] |
Lín tio̍h huán-hué; in-ūi thian-kok kūn lah. |
|