source: trunk/dports/textproc/extractopinion/files/patch-extract.sh.diff @ 90494

Last change on this file since 90494 was 90494, checked in by hum@…, 6 years ago

extractopinion: update to 1.2; fix dependencies; add patch-lib_tsv.pm.diff to use juman6 and knp3 instead of juman and knp.

File size: 1.4 KB
  • extract.sh

    old new  
    2020export EXOPLIB=$dir/lib
    2121export EXOPDIC=$dir/dic
    2222
     23cmd=`basename $0`
     24
     25usage() {
     26  echo "Usage: $cmd [options] file_name [topic_str]"
     27  echo "Options: -h, --help            Show this message"
     28  echo "         -d, --dictionary DIR  Specify the dictionary directory"
     29  echo "         -m, --model      BASE Specify the base path of model files"
     30  echo "         -t, --tmpdir     DIR  Specify the temporary directory"
     31  exit -1
     32}
     33
     34while test -n "$1"; do
     35    case "$1" in
     36        -h|--help)       usage ;;
     37        -d|--dictionary) dictionary="$2"; shift 2 ;;
     38        -m|--model)      model="$2";      shift 2 ;;
     39        -t|--tmpdir)     TMPDIR="$2";     shift 2 ;;
     40        *)               file_name="$1"; topic_str="$2";  break ;;
     41    esac
     42done
     43
    2344tmp=${TMPDIR:-.}
    2445tsvfile=$tmp/extract.$$.tsv
     46euc_file=$tmp/extract.$$.euc
    2547
    2648#nkf -e -W --fb-skip < $1 > $1.euc
    2749# $B;XDjJ8;z%3!<%I$O4D6-$K$h$C$FI=5-$,0c$&$?$a(Biconv -l$B$G3NG'(B
    28 iconv -c -f UTF-8 -t EUC-JP < $1 > $1.euc
    29 perl -I $EXOPLIB $EXOPLIB/in2tsv.pl $1.euc $2 > $tsvfile
     50iconv -c -f UTF-8 -t EUC-JP < $file_name > $euc_file
     51perl -I $EXOPLIB $EXOPLIB/in2tsv.pl $euc_file $topic_str > $tsvfile
    3052$dir/_extract.sh $model $tsvfile | perl -I $EXOPLIB $EXOPLIB/tsv2out.pl
    3153
    3254rm -f $tsvfile
Note: See TracBrowser for help on using the repository browser.