Changeset 3748bd1 for app


Ignore:
Timestamp:
05/09/08 10:38:46 (16 years ago)
Author:
obrebski <obrebski@…>
Branches:
master, help
Children:
6ac84d8
Parents:
9b57c4d
git-author:
obrebski <obrebski@…> (05/09/08 10:38:46)
git-committer:
obrebski <obrebski@…> (05/09/08 10:38:46)
Message:

1) dgp nie wysypuje sie na nieznanych kategoriach
2) dodane i uzupelnione konfigi

git-svn-id: svn://atos.wmid.amu.edu.pl/utt@49 e293616e-ec6a-49c2-aa92-f4a8b91c5d16

Location:
app
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • app/conf/dgc.conf

    radb4c8d r3748bd1  
    1313categories = PATH_PREFIX/share/utt/cats.dgc 
    1414grammar = PATH_PREFIX/share/utt/gram.dgc 
     15outputfile = PATH_PREFIX/share/utt/gram.dgp 
  • app/src/dgp/cmdline_dgp.ggo

    rdf77b87 r3748bd1  
    33 
    44option  "grammar"       g       "Grammar file" 
    5                                 string typestr="filename" default="dgp.dgp" 
     5                                string no typestr="filename" 
    66 
    77option  "long"          l       "Long output" 
  • app/src/dgp/dgc

    radb4c8d r3748bd1  
    3838                next unless length; 
    3939                my ($name, $value) = split(/\s*=\s*/, $_, 2); 
    40                 if(($name eq "catfile")or($name eq "c")){ 
     40                if(($name eq "categories")or($name eq "c")){ 
    4141                        $catfile=$value; 
    4242                } 
    43                 elsif(($name eq "dicfile")or($name eq "d")){ 
     43                elsif(($name eq "dictionary")or($name eq "d")){ 
    4444                        $dicfile=$value; 
    4545                } 
    46                 elsif(($name eq "gramfile")or($name eq "g")){ 
     46                elsif(($name eq "grammar")or($name eq "g")){ 
    4747                        $gramfile=$value; 
    4848                } 
     
    6161 
    6262GetOptions("help|h" => \$help, 
    63            "catfile|c=s" => \$catfile, 
    64            "dicfile|d=s" => \$dicfile, 
    65            "gramfile|g=s" => \$gramfile, 
     63           "categories|c=s" => \$catfile, 
     64           "dictionary|d=s" => \$dicfile, 
     65           "grammar|g=s" => \$gramfile, 
    6666           "outputfile|o=s" => \$outputfile); 
     67 
     68my $homedir = $ENV{'HOME'}; 
     69$catfile =~ s/~/$homedir/; 
     70$dicfile =~ s/~/$homedir/; 
     71$gramfile =~ s/~/$homedir/; 
     72$outputfile =~ s/~/$homedir/; 
     73 
    6774 
    6875if($help) 
     
    7279 
    7380Options: 
    74    --catfile -c filename        List of syntactic categories. 
    75    --dicfile -d filename        Dictionary. 
    76    --gramfile -g filename       List of grammar rules. 
    77    --outputfile -o filename     Output filename. 
     81   --categories -c filename     List of syntactic categories. 
     82   --dictionary -d filename     Dictionary. 
     83   --grammar -g filename        List of grammar rules. 
     84   --outputfile -o filename     Output file name. 
    7885   --help -h                    Help. 
    7986END 
  • app/src/dgp/grammar.hh

    r0214596 r3748bd1  
    1818  //  enum CONSTR { SGL, OBL, LEFT, RIGHT, INIT, NONINIT, FIN, NONFIN }; 
    1919 
    20   Grammar() : types_sz(0), cats_sz(0) { } ; 
     20  Grammar() : types_sz(0), cats_sz(0) {} ; 
    2121   
    2222  int types_sz; 
  • app/src/dgp/main.cc

    rdf77b87 r3748bd1  
    2020int segcount=0; 
    2121char seg_mnode[MAXSEGMENTS]; 
     22char grammarfile[255]; 
     23 
    2224 
    2325Grammar grammar; 
     
    4143  process_common_options(&args,argv[0]); 
    4244 
    43 //   if(args.help_given) cmdline_parser_print_help (); 
     45  if(!args.grammar_given) 
     46    fprintf(stderr,"dgp: no grammar given\n"); 
    4447 
    45 //   if(args.input_given) 
    46 //     if(!(inputf=fopen(args.input_arg,"r"))) 
    47 //       fprintf(stderr,"dgp: input file not found: %s.\n", args.input_arg), exit(1); 
     48  expand_path(args.grammar_arg,grammarfile); 
    4849 
    49 //   if(args.output_given) 
    50 //     if(!(outputf=fopen(args.output_arg,"w"))) 
    51 //       fprintf(stderr,"dgp: cannot open output file: %s.\n", args.output_arg), exit(1); 
    52  
    53   if(!(grammarf=fopen(args.grammar_arg,"r"))) 
    54     fprintf(stderr,"dgp: grammar file not found: %s.\n", args.grammar_arg), exit(1); 
     50  if(!(grammarf=fopen(grammarfile,"r"))) 
     51    fprintf(stderr,"dgp: grammar file not found: %s.\n", grammarfile), exit(1); 
    5552 
    5653  if(args.debug_given) debug=true; 
  • app/src/dgp/mgraph.cc

    r28e9ae0 r3748bd1  
    2323  if(*cat) ++cat; 
    2424   
    25   Cat::add(cat); 
    26   nodes[n].cat=cat; 
     25//  Cat::add(cat); 
     26  if(Cat::index(cat)>0) 
     27    nodes[n].cat=cat; 
     28  else 
     29    nodes[n].cat="NULL"; 
    2730   
    2831  nodes[n].pred.clear(); 
  • app/src/gph/gph

    r19dfa5c r3748bd1  
    8080 
    8181Options: 
    82    -p tag               Process segments with this tag as nodes. 
    83    -r tag               Start new graph at this tag. 
    84    -f filename          Input file. 
    85    -o filename          Output file. 
    86    -i                   Toggle interactive mode (default=off). 
     82   --process=TYPE -p TYPE    Process segments of type TYPE. 
     83   --reset=TYPE -r TYPE      Start new graph at tags of type TYPE. 
     84   --inputfile=FILE -f FILE  Input file. 
     85   --outputfile=FILE -o FILE Output file. 
     86   --interactive -i          Toggle interactive mode (default=off). 
    8787END 
    8888; 
Note: See TracChangeset for help on using the changeset viewer.