瀏覽代碼

patched language_updater.sh to generate corpus from command file

Jezra 11 年之前
父節點
當前提交
40b219723f
共有 1 個文件被更改,包括 9 次插入2 次删除
  1. 9
    2
      language_updater.sh

+ 9
- 2
language_updater.sh 查看文件

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

Loading…
取消
儲存