Poprawilem dystrybucje z dgp. Pewne pliki sa jeszcze niedokonczone.

git-svn-id: svn://atos.wmid.amu.edu.pl/utt@30 e293616e-ec6a-49c2-aa92-f4a8b91c5d16
This commit is contained in:
pawelk 2008-04-22 19:11:12 +00:00
parent b6109b9c36
commit ff0fc991d7
5 changed files with 37 additions and 94 deletions

View File

@ -20,6 +20,7 @@ conf_grp(catfile($usr_home, 'grp.conf'), $sys_home);
conf_gue(catfile($usr_home, 'gue.conf'), $sys_home);
conf_lem(catfile($usr_home, 'lem.conf'), $sys_home);
conf_ser(catfile($usr_home, 'ser.conf'), $sys_home);
conf_dgc(catfile($usr_home, 'dgc.conf'), $sys_home);
print "UTT user configuration created in $usr_home\n";
@ -213,3 +214,23 @@ sub findLocale() {
}
return $best_locale;
}
sub conf_dgc() {
my $dgc_file = shift;
my $utthome = shift;
open(FILE, ">$dgc_file");
print FILE makeConfigHeader();
print FILE "categories=", abs_path("$utthome/lib/utt/cats.dgc"), "\n";
print FILE "grammar=", abs_path("$utthome/lib/utt/gram.dgc"), "\n";
close FILE;
open(FILE, ">$utthome/bin/Makefile.go");
print FILE "\ngram.dgp: ", abs_path("$utthome/lib/utt/gram.dgc"), "\n";
print FILE "\tdgc -c ", abs_path("$utthome/lib/utt/cats.dgc"), " < ", abs_path("$utthome/lib/utt/gram.dgc"), " > gram.dgp\n";
close FILE;
}

View File

@ -1,9 +1,16 @@
/usr/local/bin/aut2fsa
/usr/local/bin/canonize
/usr/local/bin/compiledic
/usr/local/bin/con
/usr/local/bin/cor
/usr/local/bin/dgc
/usr/local/bin/dgp
/usr/local/bin/fla
/usr/local/bin/fsm2aut
/usr/local/bin/go ?
/usr/local/bin/Makefile.go ?
/usr/local/bin/attr.pm
/usr/local/bin/gph
/usr/local/bin/grp
/usr/local/bin/gue
/usr/local/bin/kot
@ -13,6 +20,7 @@
/usr/local/bin/sen-nl
/usr/local/bin/ser
/usr/local/bin/tok
/usr/local/bin/tre.rb
/usr/local/bin/unfla
/usr/local/bin/utt-make-config.pl
/usr/local/bin/ipi.tag2re
@ -20,6 +28,7 @@
/usr/local/etc/utt/con.conf
/usr/local/etc/utt/cor.conf
/usr/local/etc/utt/dgc.conf
/usr/local/etc/utt/fla.conf
/usr/local/etc/utt/grp.conf
/usr/local/etc/utt/gue.conf
@ -44,6 +53,9 @@
/usr/local/lib/utt/ser.l.template
/usr/local/lib/utt/terms.m4
/usr/local/lib/utt/weights.cor
/usr/local/lib/utt/seg.rb
/usr/local/lib/utt/cats.dgc
/usr/local/lib/utt/gram.dgc
/usr/local/share/doc/utt/FAQ
/usr/local/share/doc/utt/COPYRIGHT

View File

@ -1,6 +1,7 @@
SHELL = /bin/sh
LIB_PATH=../../lib
#vpath %.o .
@ -39,5 +40,7 @@ prof: dgp
copy:
ifdef UTT_BIN_DIR
cp dgp dgc canonize $(UTT_BIN_DIR)
cp dgp dgc canonize tre.rb $(UTT_BIN_DIR)/
cp go attr.pm $(UTT_BIN_DIR)/
cp $(LIB_PATH)/*.dgc $(UTT_BIN_DIR)/../lib/utt/
endif

View File

@ -1,93 +0,0 @@
#!/usr/bin/perl
#package: UAM Text Tools
#component: gph
#version: 1.0
#author: Tomasz Obrebski
use strict;
use Getopt::Long;
my @process;
my $help=0;
my $reset;
my $interactive=1;
GetOptions("process|p=s" => \@process,
"help|h" => \$help,
"reset|r=s" => \$reset,
"interactive|i" => \$interactive);
if($help)
{
print <<'END'
Usage: gph [OPTIONS]
Options:
-p tag Process segments with this tag as nodes.
-r tag Start new graph at this tag.
-f filename Input file (NIE DZIALA).
-o filename Output file (NIE DZIALA).
-i Toggle interactive mode (default=on).
END
;
exit 0;
}
$|=1 if $interactive;
my @prev;
my $gph;
my $n=0;
while(<>)
{
chomp;
my $do=0;
my @line = split /\s+/;
if($line[2] eq $reset)
{
$n=0;
@prev = ();
}
for my $p (@process)
{
$do=1 if $line[2] eq $p;
}
if($do)
{
my @preds = ();
shift @prev while @prev+0 && $prev[0]->[1] + $prev[0]->[2] < $line[0];
for my $p (@prev)
{
push(@preds, $p->[0]) if $p->[1] + $p->[2] == $line[0];
}
push @prev, [$n, $line[0], $line[1]];
$gph=' gph:'.$n.':'.join(',',@preds);
$n++;
}
else
{
for my $p (@prev)
{
if($p->[1]+$p->[2] == $line[0])
{
$p->[2] += $line[1];
}
}
$gph='';
}
print $_.$gph."\n";
}