Merge pull request #314 from MycroftAI/issue/dont-compile-pocketsphinx
Issue/dont compile pocketsphinxpull/316/head
commit
036b4fc226
21
dev_setup.sh
21
dev_setup.sh
|
@ -50,24 +50,9 @@ pip install -r requirements.txt
|
|||
CORES=$(nproc)
|
||||
echo Building with $CORES cores.
|
||||
|
||||
# clone pocketsphinx-python at HEAD (fix to a constant version later)
|
||||
if [ ! -d ${TOP}/pocketsphinx-python ]; then
|
||||
# build sphinxbase and pocketsphinx if we haven't already
|
||||
git clone --recursive https://github.com/cmusphinx/pocketsphinx-python
|
||||
cd ${TOP}/pocketsphinx-python/sphinxbase
|
||||
./autogen.sh
|
||||
./configure
|
||||
make -j$CORES
|
||||
cd ${TOP}/pocketsphinx-python/pocketsphinx
|
||||
./autogen.sh
|
||||
./configure
|
||||
make -j$CORES
|
||||
fi
|
||||
|
||||
# build and install pocketsphinx python bindings
|
||||
cd ${TOP}/pocketsphinx-python
|
||||
python setup.py install
|
||||
|
||||
#build and install pocketsphinx
|
||||
#cd ${TOP}
|
||||
#${TOP}/scripts/install-pocketsphinx.sh -q
|
||||
#build and install mimic
|
||||
cd ${TOP}
|
||||
${TOP}/scripts/install-mimic.sh
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
import time
|
||||
|
||||
import os
|
||||
from pocketsphinx.pocketsphinx import Decoder
|
||||
from pocketsphinx import Decoder
|
||||
import tempfile
|
||||
|
||||
__author__ = 'seanfitz, jdorleans'
|
||||
|
|
|
@ -33,3 +33,4 @@ pyjokes==0.5.0
|
|||
psutil==4.1.0
|
||||
pep8==1.7.0
|
||||
multi_key_dict==2.0.3
|
||||
pocketsphinx==0.1.0
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
#!/usr/bin/env bash
|
||||
# exit on any error
|
||||
set -Ee
|
||||
|
||||
#TOP="."
|
||||
|
||||
|
||||
function enable_local {
|
||||
sed -i -- 's/from pocketsphinx.pocketsphinx import Decoder/from pocketsphinx import Decoder/g' mycroft/client/speech/local_recognizer.py
|
||||
}
|
||||
|
||||
function disable_local {
|
||||
sed -i -- 's/from pocketsphinx import Decoder/from pocketsphinx.pocketsphinx import Decoder/g' mycroft/client/speech/local_recognizer.py
|
||||
|
||||
}
|
||||
function install_pocketsphinx {
|
||||
# clone pocketsphinx-python at HEAD (fix to a constant version later)
|
||||
if [ ! -d ${TOP}/pocketsphinx-python ]; then
|
||||
# build sphinxbase and pocketsphinx if we haven't already
|
||||
git clone --recursive https://github.com/cmusphinx/pocketsphinx-python
|
||||
pushd ./pocketsphinx-python/sphinxbase
|
||||
./autogen.sh
|
||||
./configure
|
||||
make -j$CORES
|
||||
popd
|
||||
pushd ./pocketsphinx-python/pocketsphinx
|
||||
./autogen.sh
|
||||
./configure
|
||||
make -j$CORES
|
||||
popd
|
||||
fi
|
||||
|
||||
# build and install pocketsphinx python bindings
|
||||
cd ${TOP}/pocketsphinx-python
|
||||
python setup.py install
|
||||
|
||||
}
|
||||
|
||||
if [ "$1" = "-q" ]; then
|
||||
enable_local
|
||||
install_pocketsphinx
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "This script will checkout, compile, and install pocketsphinx locally if the debian package python-pocketsphinx is not available"
|
||||
|
||||
PS3='Please enter your choice: '
|
||||
options=("Enable local checkout, compile and install" "Disable local checkout and exit" "Do nothing and quit")
|
||||
select opt in "${options[@]}"
|
||||
do
|
||||
case $opt in
|
||||
"Enable local checkout, compile and install")
|
||||
echo "you chose choice 1"
|
||||
enable_local
|
||||
install_pocketsphinx
|
||||
;;
|
||||
"Disable local checkout and exit")
|
||||
echo "you chose choice 2"
|
||||
disable_local
|
||||
exit 0
|
||||
;;
|
||||
"Do nothing and quit")
|
||||
echo "you chose choice 3"
|
||||
exit 0
|
||||
;;
|
||||
*) echo invalid option;;
|
||||
esac
|
||||
done
|
||||
|
Loading…
Reference in New Issue