diff --git a/app/Makefile b/app/Makefile index 58675dd..bc83743 100644 --- a/app/Makefile +++ b/app/Makefile @@ -54,6 +54,8 @@ dirs: .PHONY: components components: + cd $(SRC_DIR)/lib && make; cd $(CUR_DIR) + @for cmp in $(COMPONENTS); do\ cd $(SRC_DIR)/$$cmp && make && make copy; cd $(CUR_DIR); \ done diff --git a/app/TODO b/app/TODO index 7271464..3e41a41 100644 --- a/app/TODO +++ b/app/TODO @@ -1,6 +1,28 @@ -* wyprowadzic grp-pre i grp-post z grp do aux? -* zamienic kota na lepszego (Kubis) -* + +* gue SIE NIE KOMPILUJE !!! + +* zamienic kota na lepszego (Kubis) [TO] + +* uniezaleznic mar od attr.pm (ew. wcielic attr.pm) [TO] + +* mar nie obsluguje plikow konfiguracyjnych [JW] + +* compiledic - plik tymczasowe [PK] + +* ser i grp - parametr tags (zeby bral wskazany program tag2re) [TO] + +* lista zaleznosci dla komend system w perlu [PK] + +* polaczyc sen'y [TO] + +* poprawic utt_make_conf (wykrywanie slownikow) [PK] + +* generowanie i sprawdzanie zaleznosci dla tarballa [PK] + +* przygotowanie dystrybujcji slownikow [PK] + + +STARE 1. DONE. Makefile do gph (install). 2. (zrobione dla ser?) Nazwy pmdb2re -> pmdb.tag2re (grp, ser). diff --git a/app/dist/tarball/INSTALL b/app/dist/tarball/INSTALL index 2d46c52..a873a5a 100644 --- a/app/dist/tarball/INSTALL +++ b/app/dist/tarball/INSTALL @@ -1,4 +1,6 @@ Here you can find some information about how to install utt. You should just unpack archive and then -execute create_utt_conf.pl and remove it. +execute +bin/utt_make_config.pl + diff --git a/app/dist/tarball/README b/app/dist/tarball/README index 2f7f453..16e05e2 100644 --- a/app/dist/tarball/README +++ b/app/dist/tarball/README @@ -3,4 +3,4 @@ This directory contains Makefile, which allows to create tar.gz archive. To create archive, just write: make -Warning: you need define variable _UTT_DIST_DIR. +Warning: you need define variable UTT_DIST_DIR. diff --git a/app/src/compiledic/aut2fsa b/app/src/compiledic/aut2fsa deleted file mode 100755 index bd7a6d5..0000000 Binary files a/app/src/compiledic/aut2fsa and /dev/null differ diff --git a/app/src/compiledic/compiledic b/app/src/compiledic/compiledic index a48196d..26e72a2 100755 --- a/app/src/compiledic/compiledic +++ b/app/src/compiledic/compiledic @@ -1,19 +1,33 @@ #! /usr/bin/env perl +#package: UAM Text Tools +#component: compiledic +#version: 1.0 +#author: Tomasz Obrebski + +use strict; +use locale; +use File::HomeDir; +use File::Basename; +use File::Temp; +use Getopt::Long; + +my $systemconfigfile=''; +my $userconfigfile=home()."/.utt/compiledic.conf"; + +Getopt::Long::Configure('no_ignore_case_always'); + $symfile='~/.utt/pl/pl_PL.iso-8859-2.sym'; $symfilenoext = $symfile; $symfilenoext =~ s/\.sym$//; $labfile = $symfilenoext . '.lab'; $sclfile = $symfilenoext . '.scl'; -use locale; -#use strict; - ################################################## $linesPerFile = 20000; if (@ARGV < 1) { - print "usage: prep_user_dict.pl dictionary_file\n"; + print "usage: ", basename($0), " dictionary_file\n"; exit; } diff --git a/app/src/gph/gph b/app/src/gph/gph index b602ac7..91611b7 100755 --- a/app/src/gph/gph +++ b/app/src/gph/gph @@ -1,5 +1,11 @@ #!/usr/bin/perl +#package: UAM Text Tools +#component: gph +#version: 1.0 +#author: Tomasz Obrebski + +use strict; use Getopt::Long; my @process; diff --git a/app/src/grp/grp b/app/src/grp/grp index 97c136d..3480d83 100755 --- a/app/src/grp/grp +++ b/app/src/grp/grp @@ -1,16 +1,20 @@ #!/usr/bin/perl #package: UAM Text Tools -#component name: gre -#author: Tomasz Obrębski +#component name: grp +#version: 1.0 +#author: Tomasz Obrebski use strict; use Getopt::Long; +use File::HomeDir; -my $LIB_DIR="/usr/local/lib/utt"; # katalog zawierajacy terms.m4 +# katalog zawierajacy terms.m4 +my $LIB_DIR="/usr/local/lib/utt"; my $systemconfigfile="/usr/local/etc/utt/grp.conf"; -my $userconfigfile="$ENV{'HOME'}/.utt/grp.conf"; +#my $userconfigfile="$ENV{'HOME'}/.utt/grp.conf"; +my $userconfigfile=home()."/.utt/grp.conf"; Getopt::Long::Configure('no_ignore_case_always'); diff --git a/app/src/kon/kon b/app/src/kon/kon index 34f7c3e..9c13871 100755 --- a/app/src/kon/kon +++ b/app/src/kon/kon @@ -1,31 +1,39 @@ -#!/usr/bin/perl -w -use strict; -use Getopt::Long; -use locale; - -Getopt::Long::Configure('no_ignore_case_always'); - -my $l='30c'; -my $r='30c'; -my $trim=0; -my $white=0; -my $bon='[0-9]+ [0-9]+ BOM .*'; -my $eon='[0-9]+ [0-9]+ EOM .*'; -my $bod='['; -my $eod=']'; -my $column=0; -my $ignore=0; -my $help=0; - -my $systemconfigfile='/usr/local/etc/utt/kon.conf'; -my $userconfigfile="$ENV{'HOME'}/.utt/kon.conf"; - -#read configuration files########################### -my $file; -foreach $file ($systemconfigfile, $userconfigfile){ - if(open(CONFIG, $file)){ - while () { - chomp; +#!/usr/bin/perl -w + +#package: UAM Text Tools +#component: kon (search context) +#version: 1.0 +#author: Tomasz Obrebski + +use strict; +use Getopt::Long; +use locale; +use File::HomeDir; + +Getopt::Long::Configure('no_ignore_case_always'); + +my $l='30c'; +my $r='30c'; +my $trim=0; +my $white=0; +my $bon='[0-9]+ [0-9]+ BOM .*'; +my $eon='[0-9]+ [0-9]+ EOM .*'; +my $bod='['; +my $eod=']'; +my $column=0; +my $ignore=0; +my $help=0; + +my $systemconfigfile='/usr/local/etc/utt/kon.conf'; +#my $userconfigfile="$ENV{'HOME'}/.utt/kon.conf"; +my $userconfigfile=home()."/.utt/kon.conf"; + +#read configuration files########################### +my $file; +foreach $file ($systemconfigfile, $userconfigfile){ + if(open(CONFIG, $file)){ + while () { + chomp; s/#.*//; s/^\s+//; s/\s+$//; diff --git a/app/src/kot/kot b/app/src/kot/kot index cd63cd6..f4b38f3 100755 --- a/app/src/kot/kot +++ b/app/src/kot/kot @@ -1,14 +1,21 @@ #!/usr/bin/perl +#package: UAM Text Tools +#component: kot +#version: 1.0 +#author: Tomasz Obrebski + use strict; use Getopt::Long; +use File::HomeDir; my $help=0; my $gap_fill="\n-----\n"; my $spaces=0; my $systemconfigfile='/usr/local/etc/utt/kot.conf'; -my $userconfigfile="$ENV{'HOME'}/.utt/kot.conf"; +#my $userconfigfile="$ENV{'HOME'}/.utt/kot.conf"; +my $userconfigfile=home()."/.utt/kot.conf"; #read configuration files########################### my $file; diff --git a/app/src/mar/mar b/app/src/mar/mar index 35318ad..3e7b3c8 100755 --- a/app/src/mar/mar +++ b/app/src/mar/mar @@ -1,8 +1,9 @@ #!/usr/bin/perl -#package: UAM Text Tools -#component name: mrk -#author: Marcin Walas +#package: UAM Text Tools +#component: mar +#version: 1.0 +#author: Marcin Walas #this program tags the tokenized file with given tags #tags can be given in any order and configuration through the expression diff --git a/app/src/rm12/rm12 b/app/src/rm12/rm12 index 09c7d2b..d039ee2 100755 --- a/app/src/rm12/rm12 +++ b/app/src/rm12/rm12 @@ -1,3 +1,9 @@ #!/bin/bash +#package: UAM Text Tools +#component: rm12 +#version: 1.0 +#author: Tomasz Obrebski + + sed -r '/[0-9]+[ \t]+[0-9]+[ \t]+BOS/! s/[0-9]+[ \t]+[0-9]+[ \t]//' diff --git a/app/src/ser/ser b/app/src/ser/ser index c9ba0fc..9a3cca8 100755 --- a/app/src/ser/ser +++ b/app/src/ser/ser @@ -2,19 +2,18 @@ #package: UAM Text Tools #component: ser (pattern search tool) -#author: Tomasz Obrębski +#version: 1.0 +#author: Tomasz Obrebski use strict; use Getopt::Long; use File::Temp; +use File::HomeDir; my $LIB_DIR="/usr/local/lib/utt"; - my $systemconfigfile='/usr/local/etc/utt/ser.conf'; -my $userconfigfile="$ENV{'HOME'}/.utt/ser.conf"; - -#use lib "$ENV{HOME}/.utt/lib/perl"; -#use attr; +#my $userconfigfile="$ENV{'HOME'}/.utt/ser.conf"; +my $userconfigfile=home()."/.utt/ser.conf"; Getopt::Long::Configure('no_ignore_case_always'); @@ -160,13 +159,25 @@ system "m4 \"--define=PATTERN=$flexpattern\" \"--define=DEFAULTACTION=$defaultac if($flex) { - system "cat $tmpfile_l"; - exit 0; + #system "cat $tmpfile_l"; + if(open(FLEX, $tmpfile_l)) { + while() { + print @_; + } + close FLEX; + } + else { + print "Unable to open file $tmpfile_l\n"; + } + exit 0; } system "flex -o$tmpfile_c $tmpfile_l"; system "cc -O3 -o $tmpfile_x $tmpfile_c -lfl"; system "$tmpfile_x"; -system "rm -f $tmpfile_l $tmpfile_c $tmpfile_x"; +#system "rm -f $tmpfile_l $tmpfile_c $tmpfile_x"; +unlink $tmpfile_l; +unlink $tmpfile_c; +unlink $tmpfile_x; diff --git a/app/src/tags/uam.tag2re b/app/src/tags/uam.tag2re index 1e3e591..033a168 100755 --- a/app/src/tags/uam.tag2re +++ b/app/src/tags/uam.tag2re @@ -1,5 +1,11 @@ #!/usr/bin/perl +#package: UAM Text Tools +#component: tags for utt +#version: 1.0 +#author: Tomasz Obrebski + +use strict; use locale; my $input = <>; diff --git a/app/src/tok/tok b/app/src/tok/tok index c83da04..87a8496 100755 --- a/app/src/tok/tok +++ b/app/src/tok/tok @@ -1,13 +1,21 @@ #!/usr/bin/perl +#package: UAM Text Tools +#component: tok (tokenizer) +#version: 1.0 +#author: Tomasz Obrebski + +use strict; use locale; use Getopt::Long; +use File::HomeDir; my $interactive=0; my $help; my $systemconfigfile='/usr/local/etc/utt/tok.conf'; -my $userconfigfile="$ENV{'HOME'}/.utt/tok.conf"; +#my $userconfigfile="$ENV{'HOME'}/.utt/tok.conf"; +my $userconfigfile=home()."/.utt/tok.conf"; #read configuration files########################### my $file; diff --git a/app/src/unfla/unfla b/app/src/unfla/unfla index dd73ca4..d522087 100755 --- a/app/src/unfla/unfla +++ b/app/src/unfla/unfla @@ -1 +1,8 @@ +#!/bin/bash + +#package: UAM Text Tools +#component: unfla +#version: 1.0 +#author: Tomasz Obrebski + tr '\014' '\012'