Somewhat fancy voice command recognition software
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

language_updater.sh 779B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. blatherdir=~/.config/blather
  3. sentences=$blatherdir/sentences.corpus
  4. sourcefile=$blatherdir/commands.conf
  5. langdir=$blatherdir/language
  6. tempfile=$blatherdir/url.txt
  7. lmtoolurl=http://www.speech.cs.cmu.edu/cgi-bin/tools/lmtool/run
  8. cd $blatherdir
  9. sed -f - $sourcefile > $sentences <<EOFcommands
  10. /^$/d
  11. /^#/d
  12. s/\:.*$//
  13. EOFcommands
  14. # upload corpus file, find the resulting dictionary file url
  15. curl -L -F corpus=@"$sentences" -F formtype=simple $lmtoolurl \
  16. |grep -A 1 "base name" |grep http \
  17. | sed -e 's/^.*\="//' | sed -e 's/\.tgz.*$//' | sed -e 's/TAR//' > $tempfile
  18. # download the .dic and .lm files
  19. curl -C - -O $(cat $tempfile).dic
  20. curl -C - -O $(cat $tempfile).lm
  21. # mv em to the right name/place
  22. mv *.dic $langdir/dic
  23. mv *.lm $langdir/lm
  24. rm $tempfile