From ff0fc991d727551b858d38e744ef5e936f54278a Mon Sep 17 00:00:00 2001 From: pawelk Date: Tue, 22 Apr 2008 19:11:12 +0000 Subject: [PATCH] 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 --- app/dist/common/utt_make_config.pl | 21 +++++++ app/dist/struktura.txt | 12 ++++ app/src/dgp/Makefile | 5 +- app/src/dgp/gph | 93 ------------------------------ app/src/dgp/{Seg.rb => seg.rb} | 0 5 files changed, 37 insertions(+), 94 deletions(-) delete mode 100755 app/src/dgp/gph rename app/src/dgp/{Seg.rb => seg.rb} (100%) diff --git a/app/dist/common/utt_make_config.pl b/app/dist/common/utt_make_config.pl index 49657d2..9cc4788 100644 --- a/app/dist/common/utt_make_config.pl +++ b/app/dist/common/utt_make_config.pl @@ -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; + +} + diff --git a/app/dist/struktura.txt b/app/dist/struktura.txt index b97689a..07cc593 100644 --- a/app/dist/struktura.txt +++ b/app/dist/struktura.txt @@ -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 diff --git a/app/src/dgp/Makefile b/app/src/dgp/Makefile index 5231750..996f383 100644 --- a/app/src/dgp/Makefile +++ b/app/src/dgp/Makefile @@ -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 diff --git a/app/src/dgp/gph b/app/src/dgp/gph deleted file mode 100755 index f49d1f8..0000000 --- a/app/src/dgp/gph +++ /dev/null @@ -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"; -} diff --git a/app/src/dgp/Seg.rb b/app/src/dgp/seg.rb similarity index 100% rename from app/src/dgp/Seg.rb rename to app/src/dgp/seg.rb