Somewhat fancy voice command recognition software
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

language_updater.sh 841B

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