summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xlanguage_updater.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/language_updater.sh b/language_updater.sh
index 211793e..383e140 100755
--- a/language_updater.sh
+++ b/language_updater.sh
@@ -1,15 +1,22 @@
 #!/bin/bash
 
 blatherdir=~/.config/blather
-sourcefile=$blatherdir/sentences.corpus
+sentences=$blatherdir/sentences.corpus
+sourcefile=$blatherdir/commands
 langdir=$blatherdir/language
 tempfile=$blatherdir/url.txt
 lmtoolurl=http://www.speech.cs.cmu.edu/cgi-bin/tools/lmtool/run
 
 cd $blatherdir
 
+sed -f - $sourcefile > $sentences <<EOFcommands
+  /^$/d
+  /^#/d
+  s/\:.*$//
+EOFcommands
+
 # upload corpus file, find the resulting dictionary file url
-curl -L -F corpus=@"$sourcefile" -F formtype=simple $lmtoolurl \
+curl -L -F corpus=@"$sentences" -F formtype=simple $lmtoolurl \
   |grep -A 1 "base name" |grep http \
   | sed -e 's/^.*\="//' | sed -e 's/\.tgz.*$//' | sed -e 's/TAR//' > $tempfile