Index: _old/app/Makefile
===================================================================
--- _old/app/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,151 @@
+# main makefile
+
+# ******************************
+# * Local variables
+# ******************************
+CUR_DIR=$(shell pwd)
+SRC_DIR=$(CUR_DIR)/src
+OUTPUT_DIR=$(CUR_DIR)/output
+
+# ******************************
+# * Global for make globals
+# ******************************
+
+export UTT_DIR=${OUTPUT_DIR}
+
+# executables
+export UTT_BIN_DIR=${UTT_DIR}/bin
+# configuration files
+export UTT_CONF_DIR=${UTT_DIR}/etc/utt
+# language/encoding specific stuff
+# any extra files for some programs, like: weights.kor, cats.dgc, gram.dgc, etc.
+export UTT_LANG_DIR=${UTT_DIR}/share/utt
+# some files like ser.l.template, terms.m4
+export UTT_LIB_DIR=${UTT_DIR}/lib/utt
+# stuff like documantation (man, info), docs: FAQ, COPYRIGHT, NEWS, README
+export UTT_SHARE_DIR=${UTT_DIR}/share
+
+##############################
+
+# list of components to be included in the distribution
+COMPONENTS = compiledic cor dgp fla gph grp gue kon kor kot lem mar rm12 rs12 sen-l sen-nl ser tags tok.l unfla
+
+##############################
+
+# ------------------------------------------------------------------
+# sekcja kompilacji (kompiluje i wgrywa do OUTPUT_DIR)
+# ------------------------------------------------------------------
+.PHONY: compile
+compile: dirs components
+	@echo "Make compiled successfully!"
+
+.PHONY: dirs
+dirs:
+	if [ -d ${UTT_DIR} ]; then rm -r ${UTT_DIR}; fi
+	mkdir -p ${UTT_DIR}
+	mkdir -p ${UTT_BIN_DIR}
+	mkdir -p ${UTT_CONF_DIR}
+	mkdir -p ${UTT_LANG_DIR}
+	mkdir -p ${UTT_LIB_DIR}
+	mkdir -p ${UTT_SHARE_DIR}/utt
+	mkdir -p ${UTT_SHARE_DIR}/doc/utt
+	mkdir -p ${UTT_SHARE_DIR}/info
+	mkdir -p ${UTT_SHARE_DIR}/man/man3
+
+.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
+
+
+# ------------------------------------------------------------------
+# sekcja sprzatania (kasuje binaria z katalogow SRC/COMPONENTS)
+# ------------------------------------------------------------------
+.PHONY: clean
+clean: clean_components clean_doc clean_dist
+	@echo "All files cleaned successfully!"
+
+.PHONY: clean_components
+clean_components:
+	@for cmp in $(COMPONENTS); do \
+		cd $(SRC_DIR)/$$cmp && make clean ; cd $(CUR_DIR); \
+	done
+	cd $(SRC_DIR)/lib && make clean; cd $(CUR_DIR);
+
+.PHONY: clean_doc
+clean_doc:
+	cd $(CUR_DIR)/doc && make clean; cd $(CUR_DIR)
+
+.PHONY: clean_dist
+clean_dist:
+
+
+# ------------------------------------------------------------------
+# sekcja przygotowania paczki (programow wraz z dodatkowymi plikami)
+# ------------------------------------------------------------------
+.PHONY: build
+build: compile build_conf build_share build_lib build_doc
+	@echo "All files builded successfully!"
+
+.PHONY: build_conf
+build_conf:
+	cp $(CUR_DIR)/conf/*.conf $(UTT_CONF_DIR)/
+
+.PHONY: build_lib
+build_lib:
+	cp $(CUR_DIR)/lib/* $(UTT_LIB_DIR)/
+
+.PHONY: build_doc
+build_doc:
+	cd $(CUR_DIR)/doc && make && make copy; cd $(CUR_DIR)
+
+.PHONY: build_share
+build_share:
+	cp $(CUR_DIR)/share/* $(UTT_LANG_DIR)/
+
+
+# ------------------------------------------------------------------
+# sekcja tworzenia dystrybucji (tarballa, rpm, deb)
+# ------------------------------------------------------------------
+.PHONY: distribute
+distribute: build dist_tarball dist_rpm
+	@echo "All distributions created successfully!"
+
+.PHONY: dist_tarball
+dist_tarball: build
+	cd $(CUR_DIR)/dist && make tarball; cd $(CUR_DIR)
+
+.PHONY: dist_rpm
+dist_rpm: build
+	cd $(CUR_DIR)/dist && make rpm; cd $(CUR_DIR)
+
+.PHONY: dist_deb
+dist_deb: build
+	cd $(CUR_DIR)/dist && make deb; cd $(CUR_DIR)
+
+
+# ------------------------------------------------------------------
+# sekcja testowania (kasuje tarballa z TARBALL_TEST_DIR,
+# kompiluje, robi paczke,
+# tworzy tarballa i wgrywa go do TARBALL_TEST_DIR)
+# ------------------------------------------------------------------
+#install: all
+#	cd ${UTT_DIR} && make install; cd ${CUR_DIR}
+
+#uninstall:
+#	cd ${UTT_DIR} && make uninstall; cd ${DIR}
+
+#reinstall:
+#	cd ${UTT_DIR} && make reinstall; cd ${DIR}
+
+#dist: all
+#	tar -czvf $(UTT_DIST_NAME).tgz $(UTT_DIR)
+
+
+#clean_dist:
+#	if [ -d $(UTT_DIST_DIR) ]; then rm -r $(UTT_DIST_DIR); else true; fi
+#	if [ -f $(UTT_DIST_FILE).tar.bz2 ]; then rm $(UTT_DIST_FILE).tar.bz2; else true; fi
+#	if [ -f $(UTT_DIST_PMDB_FILE).tar.bz2 ]; then rm $(UTT_DIST_PMDB_FILE).tar.bz2; else true; fi
Index: _old/app/README.developers
===================================================================
--- _old/app/README.developers	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/README.developers	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,25 @@
+TO COMPILE UTT YOU WILL NEED:
+make
+gengetopt
+g++
+flex
+
+TO RUN UTT PROGRAMS YOU WILL NEED:
+
+perl module File::HomeDir
+
+COMMANDS TO BE RUN IN THIS DIRECTORY:
+
+% make
+
+compiles all the components, moves all files destinated for
+distribution in the directory [the value of UTT_DIR_NAME variable in
+Makefile] (currently utt-0.9)
+
+% make install
+
+installes the package in your system in the directory ~/.utt
+
+% make dist_tarball
+
+prepares distribution file named ${UTT_DIR_NAME}.tgz (currently utt-0.9.tgz)
Index: _old/app/TODO
===================================================================
--- _old/app/TODO	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/TODO	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,25 @@
+BARDZO WAZNE:
+*
+* instalka slownikow
+* programy maja wykrywac brak slownikow -> "No language module installed"
+  na podst zmiennej language w utt.conf, "Cannot open dict...." gdy po prostu
+  nie znajdzie pliku slownika 
+* tresc na stronie
+* statyczne laczenie bibl 32-bit (miejsce kompilacji)
+* przemyslec sposob wybierania jezyka / slownika po zainstalowaniu roznych dystrybucji [PK, TO]
+* gue nie sortuje wynikow, opcja weights dziala na odwrot
+* kor nie wykonuje zamian <jednalitera> -> <dwielitery>, np. ÅŒ rz
+
+WAZNE:
+* zamienic kota na lepszego (Kubis) [TO]
+* sen - unikac dwukrotnego wstawiania BOSow i EOSow [TO]
+* polaczyc sen'y [TO]
+* generowanie i sprawdzanie zaleznosci dla tarballa [PK]
+* Zadania zwiazane z rozbudowa ser (src/ser/TODO).
+* Nowa funkcjonalnosc dla kot? con? - kazde zdanie w nowym wierszu
+* opcja info w dgp powinna miec domyslna wartosc d lub h
+* przyspieszyc process_seg() -> obliczanie prefiksow pol z opcji -s i -S raz na poczatku programu, a nie w kolko
+* kor: nie dziala opcja distance
+* zunifikowac opcje cor i kor
+* uporzadkowac sprawe zaleznosci miedzy modulem jezykowym a wyborem tagow (tag2re)
+ 
Index: _old/app/conf/Makefile
===================================================================
--- _old/app/conf/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/conf/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,8 @@
+main:
+
+copy:
+ifdef UTT_CONF_DIR
+	cp *.conf ${UTT_CONF_DIR}
+endif
+
+clean:
Index: _old/app/conf/compiledic.conf
===================================================================
--- _old/app/conf/compiledic.conf	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/conf/compiledic.conf	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,13 @@
+# ************************************************************
+# * This file was created automatically during installation. *
+# * If you don't need do not change it.                      *
+# *                                                          *
+# * UAM Text Tools                                           *
+# * Adam Mickiewicz University, Poland                       *
+# * http://utt.amu.edu.pl                                    *
+# ************************************************************
+#
+# All lines must looks like:
+# parameter_name [=] value
+#
+symbols = PATH_PREFIX/share/utt/pl_PL.ISO-8859-2/pl_PL.ISO-8859-2.sym
Index: _old/app/conf/cor.conf
===================================================================
--- _old/app/conf/cor.conf	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/conf/cor.conf	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,14 @@
+# ************************************************************
+# * This file was created automatically during installation. *
+# * If you don't need do not change it.                      *
+# *                                                          *
+# * UAM Text Tools                                           *
+# * Adam Mickiewicz University, Poland                       *
+# * http://utt.amu.edu.pl                                    *
+# ************************************************************
+#
+# All lines must looks like:
+# parameter_name [=] value
+#
+dictionary-home = PATH_PREFIX/share/utt
+process = W
Index: _old/app/conf/dgc.conf
===================================================================
--- _old/app/conf/dgc.conf	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/conf/dgc.conf	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,15 @@
+# ************************************************************
+# * This file was created automatically during installation. *
+# * If you don't need do not change it.                      *
+# *                                                          *
+# * UAM Text Tools                                           *
+# * Adam Mickiewicz University, Poland                       *
+# * http://utt.amu.edu.pl                                    *
+# ************************************************************
+#
+# All lines must looks like:
+# parameter_name [=] value
+#
+categories = PATH_PREFIX/share/utt/cats.dgc
+grammar = PATH_PREFIX/share/utt/gram.dgc
+outputfile = PATH_PREFIX/share/utt/gram.dgp
Index: _old/app/conf/dgp.conf
===================================================================
--- _old/app/conf/dgp.conf	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/conf/dgp.conf	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,18 @@
+# ************************************************************
+# * This file was created automatically during installation. *
+# * If you don't need do not change it.                      *
+# *                                                          *
+# * UAM Text Tools                                           *
+# * Adam Mickiewicz University, Poland                       *
+# * http://utt.amu.edu.pl                                    *
+# ************************************************************
+#
+# All lines must looks like:
+# parameter_name [=] value
+#
+
+grammar = PATH_PREFIX/share/utt/gram.dgp
+process = W
+process = BOS
+process = EOS
+info = d
Index: _old/app/conf/gph.conf
===================================================================
--- _old/app/conf/gph.conf	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/conf/gph.conf	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,16 @@
+# ************************************************************
+# * This file was created automatically during installation. *
+# * If you don't need do not change it.                      *
+# *                                                          *
+# * UAM Text Tools                                           *
+# * Adam Mickiewicz University, Poland                       *
+# * http://utt.amu.edu.pl                                    *
+# ************************************************************
+#
+# All lines must looks like:
+# parameter_name [=] value
+#
+process = W
+process = BOS
+process = EOS
+reset = BOS
Index: _old/app/conf/grp.conf
===================================================================
--- _old/app/conf/grp.conf	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/conf/grp.conf	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,15 @@
+# ************************************************************
+# * This file was created automatically during installation. *
+# * If you don't need do not change it.                      *
+# *                                                          *
+# * UAM Text Tools                                           *
+# * Adam Mickiewicz University, Poland                       *
+# * http://utt.amu.edu.pl                                    *
+# ************************************************************
+#
+# All lines must looks like:
+# parameter_name [=] value
+#
+macros = PATH_PREFIX/lib/utt/terms.m4
+tags=uam
+
Index: _old/app/conf/gue.conf
===================================================================
--- _old/app/conf/gue.conf	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/conf/gue.conf	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,14 @@
+# ************************************************************
+# * This file was created automatically during installation. *
+# * If you don't need do not change it.                      *
+# *                                                          *
+# * UAM Text Tools                                           *
+# * Adam Mickiewicz University, Poland                       *
+# * http://utt.amu.edu.pl                                    *
+# ************************************************************
+#
+# All lines must looks like:
+# parameter_name [=] value
+#
+dictionary-home = PATH_PREFIX/share/utt
+process = W
Index: _old/app/conf/kor.conf
===================================================================
--- _old/app/conf/kor.conf	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/conf/kor.conf	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,16 @@
+# ************************************************************
+# * This file was created automatically during installation. *
+# * If you don't need do not change it.                      *
+# *                                                          *
+# * UAM Text Tools                                           *
+# * Adam Mickiewicz University, Poland                       *
+# * http://utt.amu.edu.pl                                    *
+# ************************************************************
+#
+# All lines must looks like:
+# parameter_name [=] value
+#
+dictionary-home = PATH_PREFIX/share/utt
+weights = PATH_PREFIX/share/utt/weights.kor
+threshold = 1.0
+process=W
Index: _old/app/conf/lem.conf
===================================================================
--- _old/app/conf/lem.conf	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/conf/lem.conf	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,14 @@
+# ************************************************************
+# * This file was created automatically during installation. *
+# * If you don't need do not change it.                      *
+# *                                                          *
+# * UAM Text Tools                                           *
+# * Adam Mickiewicz University, Poland                       *
+# * http://utt.amu.edu.pl                                    *
+# ************************************************************
+#
+# All lines must looks like:
+# parameter_name [=] value
+#
+dictionary-home = PATH_PREFIX/share/utt
+process = W
Index: _old/app/conf/mar.conf
===================================================================
--- _old/app/conf/mar.conf	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/conf/mar.conf	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,15 @@
+# ************************************************************
+# * This file was created automatically during installation. *
+# * If you don't need do not change it.                      *
+# *                                                          *
+# * UAM Text Tools                                           *
+# * Adam Mickiewicz University, Poland                       *
+# * http://utt.amu.edu.pl                                    *
+# ************************************************************
+#
+# All lines must looks like:
+# parameter_name [=] value
+#
+macros = PATH_PREFIX/lib/utt/terms.m4
+tags=uam
+
Index: _old/app/conf/ser.conf
===================================================================
--- _old/app/conf/ser.conf	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/conf/ser.conf	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,15 @@
+# ************************************************************
+# * This file was created automatically during installation. *
+# * If you don't need do not change it.                      *
+# *                                                          *
+# * UAM Text Tools                                           *
+# * Adam Mickiewicz University, Poland                       *
+# * http://utt.amu.edu.pl                                    *
+# ************************************************************
+#
+# All lines must looks like:
+# parameter_name [=] value
+#
+macros = PATH_PREFIX/lib/utt/terms.m4
+flex-template = PATH_PREFIX/lib/utt/ser.l.template
+tags=uam
Index: _old/app/conf/utt.conf
===================================================================
--- _old/app/conf/utt.conf	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/conf/utt.conf	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,14 @@
+# ************************************************************
+# * This file was created automatically during installation. *
+# * If you don't need do not change it.                      *
+# *                                                          *
+# * UAM Text Tools                                           *
+# * Adam Mickiewicz University, Poland                       *
+# * http://utt.amu.edu.pl                                    *
+# ************************************************************
+#
+# All lines must looks like:
+# parameter_name [=] value
+#
+# user locale (dictionary)
+language = pl_PL.ISO-8859-2
Index: _old/app/dist/Makefile
===================================================================
--- _old/app/dist/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/dist/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,46 @@
+
+# some variables
+
+# path, where all nessesary files are placed 
+# (they will be processed for making distribution)
+export UTT_DIST_DIR=$(UTT_DIR)
+# path, where distribution package will be placed
+export UTT_DIST_OUTPUT=$(UTT_DIR)/..
+#temp path for making distribution
+export UTT_DIST_TMP=$(shell pwd)/dist_tmp
+
+
+# -----------------------------------------------------------
+# default task should display options
+.PHONY: default
+defaul:
+	@echo "Using: make tarball|rpm|deb"
+
+
+# -----------------------------------------------------------
+# this task should compile utt (if nesessery) and create tar.gz version
+.PHONY: tarball
+tarball:
+	cd tarball && make
+
+# -----------------------------------------------------------
+# this task should compile utt (if nesessery) and create rpm version
+.PHONY: rpm
+rpm:
+	@#we build rpm (see spec/README for details)
+	cd spec && make
+
+# -----------------------------------------------------------
+# this task should compile utt (if nesessery) and create deb version
+.PHONY: deb
+deb:
+	@#we build deb (see deb/README for details)
+	cd deb && make
+
+# -----------------------------------------------------------
+# this task should remove compiled files and directories
+.PHONY: clean
+clean:
+	# finally the line below should be uncomment
+	rm -fr ${UTT_DIST_TMP}
+
Index: _old/app/dist/common/check_dependenties.pl
===================================================================
--- _old/app/dist/common/check_dependenties.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/dist/common/check_dependenties.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,15 @@
+
+while(<STDIN>) {
+	chomp;
+	$app = $_;
+	$path = `which $app 2>/dev/null`;
+	$err = $?;
+	print $app.": ";
+	if($err != 0) {
+		print "failed ($err)\n";
+	}
+	else {
+		print $path;
+	}
+}
+
Index: _old/app/dist/common/description.def
===================================================================
--- _old/app/dist/common/description.def	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/dist/common/description.def	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,1 @@
+I put here some description.
Index: _old/app/dist/common/description.pl.def
===================================================================
--- _old/app/dist/common/description.pl.def	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/dist/common/description.pl.def	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,1 @@
+Tu umieszczÄ opis po polsku.
Index: _old/app/dist/common/find_perl_deps.pl
===================================================================
--- _old/app/dist/common/find_perl_deps.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/dist/common/find_perl_deps.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,29 @@
+
+
+while(<STDIN>) {
+	chomp;
+    # najpierw nazwa pliku zrodlowego out
+    if($_ =~ /^[^:]*\:\s*(.*)$/) {
+	my $line = $1;
+#	print "TEXT: $line\n";
+	# teraz tylko samo polecenie
+	if($line =~ /\`\s*(.+)\s*\`/) {
+	    my $cmd = $1;
+#	    print "CMD: $cmd\n";
+	    # teraz splitujemy potoki
+	    my @progs = split(/\s*\|\s*/, $cmd);
+	    foreach (@progs) {
+#		print "$_\n";
+		# ucinamy agrumenty programu
+		# oraz linie, zawierajace nie-programy (--replace, $tmpfile_x, /g, \\, itp.)
+		if($_ =~ /^([^\$\\\/\s\']+)(\s.*)?$/) {
+		    my $app = $1;
+#		    print "APP: $app\n";
+#		    my $res = `which $app`;
+#		    print "WYNIK: $res\n";
+		    print "$app\n";
+		}
+	    } # foreach
+	}
+    }
+}
Index: _old/app/dist/common/find_rpm_deps.sh
===================================================================
--- _old/app/dist/common/find_rpm_deps.sh	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/dist/common/find_rpm_deps.sh	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# sprawdzamy czy podano argument
+if test $# -lt 1; then echo RPM file name expected!; exit -1; fi
+
+# sprawdzamy czy to plik, potem, czy rpm
+if test -f $1; \
+then 
+    if test "rpm" = `ls $1 | tail -c 4`; \
+    then
+        rpm -q -R -p $1; \
+    else echo "It's not a RPM file!"; \
+    fi
+else echo RPM file not found!; \
+fi
+
Index: _old/app/dist/common/make_deps.sh
===================================================================
--- _old/app/dist/common/make_deps.sh	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/dist/common/make_deps.sh	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+grep -r -e "\`" ../../src | grep -v -e "\.svn\/" | perl find_perl_deps.pl | sort | uniq > dep_list.txt
Index: _old/app/dist/common/prepare_conf.sh
===================================================================
--- _old/app/dist/common/prepare_conf.sh	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/dist/common/prepare_conf.sh	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+if test 3 -ne $#
+then
+	echo "Usage: " `basename $0` src_conf_dir dest_conf_dir replacement
+else
+	POLEC="s/PATH_PREFIX/$3/g"
+
+	for FN in `ls $1/*.conf`
+	do
+	    BN=`basename ${FN}`
+	    sed ${POLEC} ${FN} > $2/${BN}
+	done
+fi
Index: _old/app/dist/common/release.def
===================================================================
--- _old/app/dist/common/release.def	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/dist/common/release.def	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,1 @@
+2
Index: _old/app/dist/common/version.def
===================================================================
--- _old/app/dist/common/version.def	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/dist/common/version.def	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,1 @@
+0.9
Index: _old/app/dist/deb/Makefile
===================================================================
--- _old/app/dist/deb/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/dist/deb/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,86 @@
+#default task
+
+DIR=$(shell pwd)
+
+ifndef UTT_DIST_DIR
+	UTT_DIST_DIR=${DIR}
+endif
+
+ifndef UTT_DIST_OUTPUT
+	UTT_DIST_OUTPUT=${DIR}
+endif
+
+# here there're few properties
+_PRODUCT_NAME=utt
+_UTT_VER=$(shell cat ../common/version.def)
+_UTT_REL=$(shell cat ../common/release.def)
+_DEB_FROOT=$(DIR)/deb_root
+_UTT_DIR=${_DEB_FROOT}/usr/local/$(_PRODUCT_NAME).$(_UTT_VER)-$(_UTT_REL)
+
+.PHONY: default
+default: make_control make_postinst make_prerm
+	# first, we prepare some directory structure
+	mkdir -p $(_DEB_FROOT)/DEBIAN
+	mkdir -p $(_UTT_DIR)
+
+	# next, we copy deb package files
+	mv ./control $(_DEB_FROOT)/DEBIAN/
+	mv ./postinst $(_DEB_FROOT)/DEBIAN/
+	mv ./prerm $(_DEB_FROOT)/DEBIAN/
+	cd ${_DEB_FROOT} && tar -cvvf control.tar.gz DEBIAN/
+	cd ${DIR};
+	rm -fr ${_DEB_FROOT}/DEBIAN/
+
+	# we copy all necessery files (binaries)
+	cp -r ${UTT_DIST_DIR}/* ${_UTT_DIR}/
+	cp ./changelog ${_UTT_DIR}/share/doc/$(_PRODUCT_NAME)/
+#	gzip --best $(_DEB_ROOT)/usr/share/doc/$(_PRODUCT_NAME)/changelog
+	cp ./changelog.Debian $(_UTT_DIR)/share/doc/$(_PRODUCT_NAME)/
+#	gzip --best $(_DEB_ROOT)/usr/share/doc/$(_PRODUCT_NAME)/changelog.Debian
+	cp ../files/* ${_UTT_DIR}/share/doc/${_PRODUCT_NAME}/
+	cp ../common/utt_make_config.pl ${_UTT_DIR}/bin/
+	chmod 755 ${_UTT_DIR}/bin/utt_make_config.pl
+	
+
+
+#	# next we make man/doc archives
+#	gzip --best $(_DEB_ROOT)/usr/share/man/man1/$(_PRODUCT_NAME).1
+
+	find $(_DEB_FROOT) -type d | xargs chmod 755   # this is necessary on Debian Woody, don't ask me why
+
+	# finally, we buid deb package
+	fakeroot dpkg-deb --build $(_DEB_FROOT)
+	mv $(_DEB_FROOT).deb $(_PRODUCT_NAME)_$(_UTT_VER)-$(_UTT_REL).all.deb
+	rm -rf ${_DEB_FROOT}
+	
+
+
+.PHONY: make_control
+make_control:
+	echo "Package: $(_PRODUCT_NAME)" > control
+	echo "Version: $(_UTT_VER)" >> control
+	echo "Section: web" >> control
+	echo "Priority: optional" >> control
+	echo "Architecture: all" >> control
+	echo "Essential: no" >> control
+
+	echo "Depends: " >> control
+# here we read this information from file ../common/requirements.def
+	#libwww-perl, acme-base (>= 1.2)         <= wymagania pakietowe
+
+	echo "Pre-Depends: perl" >> control
+
+	echo "Maintainer: Adam Mickiewicz University" >> control
+	echo "Provides: $(_PRODUCT_NAME)" >> control
+	echo -n "Description: " >> control
+	cat ../common/description.def >> control
+
+.PHONY: make_postinst
+make_postinst:
+	echo "#!/bin/sh" > postinst
+	echo "$(_INSTALL_DIR)/create_utt_config.pl" >> postinst
+	echo "rm -f $(_INSTALL_DIR)/create_utt_config.pl" >> postinst
+
+.PHONY: make_prerm
+make_prerm:
+	echo "#!/bin/sh" > prerm
Index: _old/app/dist/deb/README
===================================================================
--- _old/app/dist/deb/README	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/dist/deb/README	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,3 @@
+This directory contains files necessery to create deb package.
+
+apt-get install dpkg-dev debhelper devscripts fakeroot linda
Index: _old/app/dist/files/COPYRIGHT
===================================================================
--- _old/app/dist/files/COPYRIGHT	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/dist/files/COPYRIGHT	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,8 @@
+Copyright (C)  2005 - 2008 Tomasz Obrebski, Michal Stolarski, Justyna Walkowska, Pawel Konieczka
+
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.2
+or any later version published by the Free Software Foundation;
+with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+Texts. A copy of the license is included in the section entitled ââGNU
+Free Documentation Licenseââ.
Index: _old/app/dist/files/LICENCE
===================================================================
--- _old/app/dist/files/LICENCE	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/dist/files/LICENCE	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,264 @@
+GNU Free Documentation License
+Version 1.2, November 2002
+Copyright (c) 2000,2001,2002 Free Software Foundation, Inc.
+51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+ 0. PREAMBLE
+ The purpose of this License is to make a manual, textbook, or other functional and
+ useful document free in the sense of freedom: to assure everyone the effective freedom
+ to copy and redistribute it, with or without modifying it, either commercially or noncommercially.
+ Secondarily, this License preserves for the author and publisher a way
+ to get credit for their work, while not being considered responsible for modifications
+ made by others.
+ This License is a kind of âcopyleftâ, which means that derivative works of the document
+ must themselves be free in the same sense. It complements the GNU General Public
+ License, which is a copyleft license designed for free software.
+ We have designed this License in order to use it for manuals for free software, because
+ free software needs free documentation: a free program should come with manuals
+ providing the same freedoms that the software does. But this License is not limited to
+ software manuals; it can be used for any textual work, regardless of subject matter or
+ whether it is published as a printed book. We recommend this License principally for
+ works whose purpose is instruction or reference.
+ 1. APPLICABILITY AND DEFINITIONS
+ This License applies to any manual or other work, in any medium, that contains a
+ notice placed by the copyright holder saying it can be distributed under the terms
+ of this License. Such a notice grants a world-wide, royalty-free license, unlimited in
+ duration, to use that work under the conditions stated herein. The âDocumentâ,
+ below, refers to any such manual or work. Any member of the public is a licensee, and
+ is addressed as âyouâ. You accept the license if you copy, modify or distribute the work
+ in a way requiring permission under copyright law.
+ A âModified Versionâ of the Document means any work containing the Document or
+ a portion of it, either copied verbatim, or with modifications and/or translated into
+ another language.
+ A âSecondary Sectionâ is a named appendix or a front-matter section of the Document
+ that deals exclusively with the relationship of the publishers or authors of the Document
+ to the Documentâs overall subject (or to related matters) and contains nothing that
+ could fall directly within that overall subject. (Thus, if the Document is in part a
+ textbook of mathematics, a Secondary Section may not explain any mathematics.) The
+ relationship could be a matter of historical connection with the subject or with related
+ matters, or of legal, commercial, philosophical, ethical or political position regarding
+ them.
+ The âInvariant Sectionsâ are certain Secondary Sections whose titles are designated, as
+ being those of Invariant Sections, in the notice that says that the Document is released
+ under this License. If a section does not fit the above definition of Secondary then it is
+ not allowed to be designated as Invariant. The Document may contain zero Invariant
+ Sections. If the Document does not identify any Invariant Sections then there are none.
+ The âCover Textsâ are certain short passages of text that are listed, as Front-Cover
+ Texts or Back-Cover Texts, in the notice that says that the Document is released under
+ this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may
+ be at most 25 words.
+ A âTransparentâ copy of the Document means a machine-readable copy, represented
+ in a format whose specification is available to the general public, that is suitable for
+ revising the document straightforwardly with generic text editors or (for images composed
+ of pixels) generic paint programs or (for drawings) some widely available drawing
+ editor, and that is suitable for input to text formatters or for automatic translation to
+ a variety of formats suitable for input to text formatters. A copy made in an otherwise
+ Transparent file format whose markup, or absence of markup, has been arranged to
+ thwart or discourage subsequent modification by readers is not Transparent. An image
+ format is not Transparent if used for any substantial amount of text. A copy that is
+ not âTransparentâ is called âOpaqueâ.
+ Examples of suitable formats for Transparent copies include plain ascii without
+ markup, Texinfo input format, LaTEX input format, SGML or XML using a publicly
+ available DTD, and standard-conforming simple HTML, PostScript or PDF designed
+ for human modification. Examples of transparent image formats include PNG, XCF
+ and JPG. Opaque formats include proprietary formats that can be read and edited
+ only by proprietary word processors, SGML or XML for which the DTD and/or
+ processing tools are not generally available, and the machine-generated HTML,
+ PostScript or PDF produced by some word processors for output purposes only.
+ The âTitle Pageâ means, for a printed book, the title page itself, plus such following
+ pages as are needed to hold, legibly, the material this License requires to appear in the
+ title page. For works in formats which do not have any title page as such, âTitle Pageâ
+ means the text near the most prominent appearance of the workâs title, preceding the
+ beginning of the body of the text.
+ A section âEntitled XYZâ means a named subunit of the Document whose title either
+ is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in
+ another language. (Here XYZ stands for a specific section name mentioned below, such
+ as âAcknowledgementsâ, âDedicationsâ, âEndorsementsâ, or âHistoryâ.) To âPreserve
+ the Titleâ of such a section when you modify the Document means that it remains a
+ section âEntitled XYZâ according to this definition.
+ The Document may include Warranty Disclaimers next to the notice which states that
+ this License applies to the Document. These Warranty Disclaimers are considered to
+ be included by reference in this License, but only as regards disclaiming warranties:
+ any other implication that these Warranty Disclaimers may have is void and has no
+ effect on the meaning of this License.
+ 2. VERBATIM COPYING
+ You may copy and distribute the Document in any medium, either commercially or
+ noncommercially, provided that this License, the copyright notices, and the license
+ notice saying this License applies to the Document are reproduced in all copies, and
+ that you add no other conditions whatsoever to those of this License. You may not use
+ technical measures to obstruct or control the reading or further copying of the copies
+ you make or distribute. However, you may accept compensation in exchange for copies.
+ If you distribute a large enough number of copies you must also follow the conditions
+ in section 3.
+ You may also lend copies, under the same conditions stated above, and you may publicly
+ display copies.
+ 3. COPYING IN QUANTITY
+ If you publish printed copies (or copies in media that commonly have printed covers) of
+ the Document, numbering more than 100, and the Documentâs license notice requires
+ Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all
+ these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+ the back cover. Both covers must also clearly and legibly identify you as the publisher
+ of these copies. The front cover must present the full title with all words of the title
+ equally prominent and visible. You may add other material on the covers in addition.
+ Copying with changes limited to the covers, as long as they preserve the title of the
+ Document and satisfy these conditions, can be treated as verbatim copying in other
+ respects.
+ If the required texts for either cover are too voluminous to fit legibly, you should put
+ the first ones listed (as many as fit reasonably) on the actual cover, and continue the
+ rest onto adjacent pages.
+ If you publish or distribute Opaque copies of the Document numbering more than 100,
+ you must either include a machine-readable Transparent copy along with each Opaque
+ copy, or state in or with each Opaque copy a computer-network location from which
+ the general network-using public has access to download using public-standard network
+ protocols a complete Transparent copy of the Document, free of added material. If
+ you use the latter option, you must take reasonably prudent steps, when you begin
+ distribution of Opaque copies in quantity, to ensure that this Transparent copy will
+ remain thus accessible at the stated location until at least one year after the last time
+ you distribute an Opaque copy (directly or through your agents or retailers) of that
+ edition to the public.
+ It is requested, but not required, that you contact the authors of the Document well
+ before redistributing any large number of copies, to give them a chance to provide you
+ with an updated version of the Document.
+ 4. MODIFICATIONS
+ You may copy and distribute a Modified Version of the Document under the conditions
+ of sections 2 and 3 above, provided that you release the Modified Version under precisely
+ this License, with the Modified Version filling the role of the Document, thus licensing
+ distribution and modification of the Modified Version to whoever possesses a copy of
+ it. In addition, you must do these things in the Modified Version:
+ A. Use in the Title Page (and on the covers, if any) a title distinct from that of the
+ Document, and from those of previous versions (which should, if there were any,
+ be listed in the History section of the Document). You may use the same title as
+ a previous version if the original publisher of that version gives permission.
+ B. List on the Title Page, as authors, one or more persons or entities responsible for
+ authorship of the modifications in the Modified Version, together with at least five
+ of the principal authors of the Document (all of its principal authors, if it has fewer
+ than five), unless they release you from this requirement.
+ C. State on the Title page the name of the publisher of the Modified Version, as the
+ publisher.
+ D. Preserve all the copyright notices of the Document.
+ E. Add an appropriate copyright notice for your modifications adjacent to the other
+ copyright notices.
+ F. Include, immediately after the copyright notices, a license notice giving the public
+ permission to use the Modified Version under the terms of this License, in the form
+ shown in the Addendum below.
+ G. Preserve in that license notice the full lists of Invariant Sections and required Cover
+ Texts given in the Documentâs license notice.
+ H. Include an unaltered copy of this License.
+ I. Preserve the section Entitled âHistoryâ, Preserve its Title, and add to it an item
+ stating at least the title, year, new authors, and publisher of the Modified Version
+ as given on the Title Page. If there is no section Entitled âHistoryâ in the Document,
+ create one stating the title, year, authors, and publisher of the Document
+ as given on its Title Page, then add an item describing the Modified Version as
+ stated in the previous sentence.
+ J. Preserve the network location, if any, given in the Document for public access to
+ a Transparent copy of the Document, and likewise the network locations given in
+ the Document for previous versions it was based on. These may be placed in the
+ âHistoryâ section. You may omit a network location for a work that was published
+ at least four years before the Document itself, or if the original publisher of the
+ version it refers to gives permission.
+ K. For any section Entitled âAcknowledgementsâ or âDedicationsâ, Preserve the Title
+ of the section, and preserve in the section all the substance and tone of each of the
+ contributor acknowledgements and/or dedications given therein.
+ L. Preserve all the Invariant Sections of the Document, unaltered in their text and
+ in their titles. Section numbers or the equivalent are not considered part of the
+ section titles.
+ M. Delete any section Entitled âEndorsementsâ. Such a section may not be included
+ in the Modified Version.
+ N. Do not retitle any existing section to be Entitled âEndorsementsâ or to conflict in
+ title with any Invariant Section.
+ O. Preserve any Warranty Disclaimers.
+ If the Modified Version includes new front-matter sections or appendices that qualify
+ as Secondary Sections and contain no material copied from the Document, you may at
+ your option designate some or all of these sections as invariant. To do this, add their
+ titles to the list of Invariant Sections in the Modified Versionâs license notice. These
+ titles must be distinct from any other section titles.
+ You may add a section Entitled âEndorsementsâ, provided it contains nothing but
+ endorsements of your Modified Version by various partiesâfor example, statements of
+ peer review or that the text has been approved by an organization as the authoritative
+ definition of a standard.
+ You may add a passage of up to five words as a Front-Cover Text, and a passage of up
+ to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified
+ Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be
+ added by (or through arrangements made by) any one entity. If the Document already
+ includes a cover text for the same cover, previously added by you or by arrangement
+ made by the same entity you are acting on behalf of, you may not add another; but
+ you may replace the old one, on explicit permission from the previous publisher that
+ added the old one.
+ The author(s) and publisher(s) of the Document do not by this License give permission
+ to use their names for publicity for or to assert or imply endorsement of any Modified
+ Version.
+ 5. COMBINING DOCUMENTS
+ You may combine the Document with other documents released under this License,
+ under the terms defined in section 4 above for modified versions, provided that you
+ include in the combination all of the Invariant Sections of all of the original documents,
+ unmodified, and list them all as Invariant Sections of your combined work in its license
+ notice, and that you preserve all their Warranty Disclaimers.
+ The combined work need only contain one copy of this License, and multiple identical
+ Invariant Sections may be replaced with a single copy. If there are multiple Invariant
+ Sections with the same name but different contents, make the title of each such section
+ unique by adding at the end of it, in parentheses, the name of the original author or
+ publisher of that section if known, or else a unique number. Make the same adjustment
+ to the section titles in the list of Invariant Sections in the license notice of the combined
+ work.
+ In the combination, you must combine any sections Entitled âHistoryâ in the various
+ original documents, forming one section Entitled âHistoryâ; likewise combine any
+ sections Entitled âAcknowledgementsâ, and any sections Entitled âDedicationsâ. You
+ must delete all sections Entitled âEndorsements.â
+ 6. COLLECTIONS OF DOCUMENTS
+ You may make a collection consisting of the Document and other documents released
+ under this License, and replace the individual copies of this License in the various
+ documents with a single copy that is included in the collection, provided that you
+ follow the rules of this License for verbatim copying of each of the documents in all
+ other respects.
+ You may extract a single document from such a collection, and distribute it individually
+ under this License, provided you insert a copy of this License into the extracted
+ document, and follow this License in all other respects regarding verbatim copying of
+ that document.
+ 7. AGGREGATION WITH INDEPENDENT WORKS
+ A compilation of the Document or its derivatives with other separate and independent
+ documents or works, in or on a volume of a storage or distribution medium, is called
+ an âaggregateâ if the copyright resulting from the compilation is not used to limit the
+ legal rights of the compilationâs users beyond what the individual works permit. When
+ the Document is included in an aggregate, this License does not apply to the other
+ works in the aggregate which are not themselves derivative works of the Document.
+ If the Cover Text requirement of section 3 is applicable to these copies of the Document,
+ then if the Document is less than one half of the entire aggregate, the Documentâs Cover
+ Texts may be placed on covers that bracket the Document within the aggregate, or the
+ electronic equivalent of covers if the Document is in electronic form. Otherwise they
+ must appear on printed covers that bracket the whole aggregate.
+ 8. TRANSLATION
+ Translation is considered a kind of modification, so you may distribute translations
+ of the Document under the terms of section 4. Replacing Invariant Sections with
+ translations requires special permission from their copyright holders, but you may
+ include translations of some or all Invariant Sections in addition to the original versions
+ of these Invariant Sections. You may include a translation of this License, and all the
+ license notices in the Document, and any Warranty Disclaimers, provided that you
+ also include the original English version of this License and the original versions of
+ those notices and disclaimers. In case of a disagreement between the translation and
+ the original version of this License or a notice or disclaimer, the original version will
+ prevail.
+ If a section in the Document is Entitled âAcknowledgementsâ, âDedicationsâ, or âHistoryâ,
+ the requirement (section 4) to Preserve its Title (section 1) will typically require
+ changing the actual title.
+ 9. TERMINATION
+ You may not copy, modify, sublicense, or distribute the Document except as expressly
+ provided for under this License. Any other attempt to copy, modify, sublicense or
+ distribute the Document is void, and will automatically terminate your rights under
+ this License. However, parties who have received copies, or rights, from you under this
+ License will not have their licenses terminated so long as such parties remain in full
+ compliance.
+ 10. FUTURE REVISIONS OF THIS LICENSE
+ The Free Software Foundation may publish new, revised versions of the GNU Free
+ Documentation License from time to time. Such new versions will be similar in spirit
+ to the present version, but may differ in detail to address new problems or concerns.
+ See http://www.gnu.org/copyleft/.
+ Each version of the License is given a distinguishing version number. If the Document
+ specifies that a particular numbered version of this License âor any later versionâ
+ applies to it, you have the option of following the terms and conditions either of that
+ specified version or of any later version that has been published (not as a draft) by
+ the Free Software Foundation. If the Document does not specify a version number of
+ this License, you may choose any version ever published (not as a draft) by the Free
+ Software Foundation.
Index: _old/app/dist/files/README
===================================================================
--- _old/app/dist/files/README	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/dist/files/README	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,51 @@
+General information
+*********************
+
+UAM Text Tools (UTT) is a package of language processing tools
+developed at Adam Mickiewicz University. Its functionality includes:
+* tokenization
+* dictionary-based morphological analysis
+* heuristic morphological analysis of unknown words
+* spelling correction
+* pattern search
+* sentence splitting
+* generation of concordance tables
+                     
+The toolkit is destined for processing of raw (not annotated)
+unrestricted text for any conceivable purpose.
+                        
+
+Installation
+**************
+
+1) unpack the UTT tar archive
+2) in the same directory, unpack the tar archives of all UTT dictionary modules you have
+3) run
+	make install
+   in the root directory of the installation
+4) add the bin directory to the PATH variable
+
+
+Requirements
+*************
+
+* File::HomeDir
+
+  the Perl package File::HomeDir must be installed
+  (to install the package, run 'perl -MCPAN -e shell' and write
+   'install File::HomeDir' after the 'cpan>' prompt appears)
+   
+* flex
+
+  to run the ser component, flex must be installed in your system
+
+* ruby
+
+  to run the tre component, ruby must be installed in your system
+
+* locale pl_PL.iso-8852-2
+
+  the locales pl_PL.iso-8859-2 (pl_PL in short) must be installed
+  and set while using UTT with the Polish module. The text you 
+  process with UTT must be encoded in iso-8859-2.
+  
Index: _old/app/dist/spec/Makefile
===================================================================
--- _old/app/dist/spec/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/dist/spec/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,26 @@
+# this makefile will build rpm
+
+DIR=$(shell pwd)
+
+ifndef UTT_DIST_DIR
+	UTT_DIST_DIR=${DIR}
+endif
+
+_RPM_FROOT=${DIR}/rmp_root
+_UTT_ROOT=${_RPM_FROOT}/usr/local
+# default task
+.PHONY: rpm
+rpm:
+	if test -d ${_RPM_FROOT}; then rm -fr ${_RMP_FROOT}; fi
+	mkdir -p ${_UTT_ROOT}
+	cp -rf ${UTT_DIST_DIR}/* ${_UTT_ROOT}/
+	mkdir -p ${_UTT_ROOT}/cnf
+	mv ${_UTT_ROOT}/etc/utt/*.conf ${_UTT_ROOT}/cnf/
+	${DIR}/../common/prepare_conf.sh ${_UTT_ROOT}/cnf ${_UTT_ROOT}/etc/utt \\\/usr\\\/local
+	rm -rf ${_UTT_ROOT}/cnf
+
+	cp ../files/* ${_UTT_ROOT}/
+	cd ${_RPM_FROOT}; rpmbuild -bb ${DIR}/utt.spec
+	
+	rm -rf ${_RPM_FROOT}
+	
Index: _old/app/dist/spec/README
===================================================================
--- _old/app/dist/spec/README	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/dist/spec/README	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,16 @@
+This directory contains files necessary to produce rpm package.
+
+First, you must have variable UTT_DIST_DIR defined properly.
+This variable should be defined by main Makefile.
+
+To create rpm file, just write:
+make
+
+The created package should appears in default RPM directory.
+(in my computer it is /usr/src/redhat/RPMS/$arch/ directory)
+
+To determine the rpm output directory, execute:
+rpm --showrc | grep _rmpdir
+
+You need access privilage to this directory to create rmp.
+
Index: _old/app/dist/spec/utt.spec
===================================================================
--- _old/app/dist/spec/utt.spec	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/dist/spec/utt.spec	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,81 @@
+#
+# Default RPM header.
+#
+# START_RPM_STD_HEADER:
+
+
+#
+# RPM properties
+#
+%define _this_product     UAM Text Tools
+%define _this_summary	  Some tools for text processing
+%define _this_name        utt
+%define _this_version	  %(cat ../../common/version.def)
+%define _this_release	  %(cat ../../common/release.def)
+%define _this_copyright   Adam Mickiewicz University, Poland
+
+#
+# Default RPM header.
+#
+# END_RPM_STD_HEADER:
+# --------------------------------------------------------------------
+
+Summary:     %_this_summary
+Name:        %_this_name
+Version:     %_this_version
+Release:     %_this_release
+#Copyright:   %_this_copyright
+License:	GPL
+Group:       Development/Tools
+URL:         http://utt.amu.edu.pl
+Vendor:      Adam Mickiewicz University
+BuildRoot:	%(pwd)
+#BuildArch: 	 i586
+# requirements for utt application
+#AutoReq: no
+#AutoReqProv: no
+
+#Requires: 	 glibc >= 2.1.3
+#Requires: 	 libgcc1 >= 3.0
+#Requires: 	 libgcc >= 3.0
+#Requires:    libstdc++6 >= 3.4.1
+#Requires:    libstdc++ >= 3.4.1
+
+%description
+%(cat ../../common/description.def)
+
+%description -l pl
+%(cat ../../common/description.pl.def)
+
+
+# -------------------------------------------------------------
+# preparing sources for compilation
+%prep
+
+# source compilation
+%build
+
+# rpm building
+%install
+
+# cleaning after rpm build
+%clean
+
+# -------------------------------------------------------------
+#before installation
+%pre
+
+#after installation
+%post
+# we need to create utt.conf file
+
+#before uninstallation
+%preun
+
+#after uninstallation
+%postun
+
+# -------------------------------------------------------------
+%files
+%defattr(-,root,root)
+/*
Index: _old/app/dist/struktura.txt
===================================================================
--- _old/app/dist/struktura.txt	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/dist/struktura.txt	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,74 @@
+/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/gph
+/usr/local/bin/grp
+/usr/local/bin/gue
+/usr/local/bin/kot
+/usr/local/bin/lem
+/usr/local/bin/mar
+/usr/local/bin/sen
+/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/ipi.tag2re
+/usr/local/bin/uam.tag2re
+
+
+# R.D. sugeruje /etc/utt
+# lokalnie: ~/.utt lub (trendy) ~/.config/utt
+/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
+/usr/local/etc/utt/kor.conf
+/usr/local/etc/utt/kot.conf
+/usr/local/etc/utt/lem.conf
+/usr/local/etc/utt/mar.conf
+/usr/local/etc/utt/sen.conf
+/usr/local/etc/utt/ser.conf
+/usr/local/etc/utt/tok.conf
+/usr/local/etc/utt/unfla.conf
+/usr/local/etc/utt/utt.conf
+
+/usr/local/share/utt/weights.kor
+/usr/local/share/utt/cats.dgc
+/usr/local/share/utt/gram.dgc
+# lokalnie: wszystkie pliki beda umieszczone w ~/.local/share/utt/
+
+/usr/local/share/utt/pl_PL.ISO-8859-2/pl_PL.ISO-8859-2.sym
+/usr/local/share/utt/pl_PL.ISO-8859-2/cor.bin
+/usr/local/share/utt/pl_PL.ISO-8859-2/gue.bin
+/usr/local/share/utt/pl_PL.ISO-8859-2/lem.bin
+/usr/local/share/utt/pl_PL.UTF-8/pl_PL.UTF-8.sym
+/usr/local/share/utt/pl_PL.UTF-8/cor.bin
+/usr/local/share/utt/pl_PL.UTF-8/gue.bin
+/usr/local/share/utt/pl_PL.UTF-8/lem.bin
+# lokalnie: wszystkie slowniki beda umieszczone w ~/.local/share/utt/
+
+/usr/local/lib/utt/ser.l.template
+/usr/local/lib/utt/terms.m4
+/usr/local/lib/utt/seg.rb
+/usr/local/lib/attr.pm
+# lokalnie: wszystkie pliki beda umieszczone w ~/.local/lib/utt/
+
+/usr/local/share/doc/utt/FAQ
+/usr/local/share/doc/utt/COPYRIGHT
+/usr/local/share/doc/utt/NEWS
+/usr/local/share/doc/utt/README
+/usr/local/share/info/utt.info.gz
+/usr/local/share/man/man3/utt.gz
+
+~/.utt/*.conf  (wszystko z /usr/local/etc/utt)
Index: _old/app/dist/tarball/INSTALL
===================================================================
--- _old/app/dist/tarball/INSTALL	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/dist/tarball/INSTALL	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,5 @@
+Here you can find some information about how to install utt.
+
+You should just unpack archive and then execute
+make test
+make install
Index: _old/app/dist/tarball/Makefile
===================================================================
--- _old/app/dist/tarball/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/dist/tarball/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,48 @@
+# This makefile allows build tarball distribution for utt.
+
+#
+# Some variables
+#
+
+DIR=$(shell pwd)
+
+# Directory with utt binaries
+ifndef UTT_DIST_DIR
+	UTT_DIST_DIR=${DIR}
+endif
+
+# Where put result
+ifndef UTT_DIST_OUTPUT
+	UTT_DIST_OUTPUT=${DIR}
+endif
+
+# Common info about version and release
+_UTT_VER=$(shell cat ../common/version.def)
+_UTT_REL=$(shell cat ../common/release.def)
+
+# Temp vars
+_TARBALL_ROOT=$(DIR)/utt-$(_UTT_VER).$(_UTT_REL)
+_TAR_FILE_NAME=utt.$(_UTT_VER)_$(_UTT_REL).tar.gz
+
+#defualt task
+.PHONY: default
+default:
+	@echo Build directory: ${UTT_DIST_DIR}
+	@echo Output directory for tarball: ${UTT_DIST_OUTPUT}
+	mkdir -p ${_TARBALL_ROOT}
+	cp -fr ${UTT_DIST_DIR}/* ${_TARBALL_ROOT}
+	@# we add some extra files
+	@# config files
+	mkdir -p ${_TARBALL_ROOT}/cnf
+	mv ${_TARBALL_ROOT}/etc/utt/*.conf ${_TARBALL_ROOT}/cnf/
+	${DIR}/../common/prepare_conf.sh ${_TARBALL_ROOT}/cnf ${_TARBALL_ROOT}/etc/utt \~\\\/.local
+	rm -rf ${_TARBALL_ROOT}/cnf
+	cp ./INSTALL ${_TARBALL_ROOT}/
+	cp ./Makefile.tarball ${_TARBALL_ROOT}/Makefile
+	cp ../files/* ${_TARBALL_ROOT}/
+
+
+	tar -czf ${UTT_DIST_OUTPUT}/${_TAR_FILE_NAME} utt*
+
+	rm -rf ${_TARBALL_ROOT}
+
Index: _old/app/dist/tarball/Makefile.tarball
===================================================================
--- _old/app/dist/tarball/Makefile.tarball	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/dist/tarball/Makefile.tarball	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,18 @@
+UTT_LIB_DIR=${HOME}/.local/lib/utt
+UTT_SHARE_DIR=${HOME}/.local/share/utt
+UTT_CONF_DIR=${HOME}/.utt
+
+.PHONY: install
+install:
+	mkdir -p ${UTT_LIB_DIR}
+	cp -r lib/utt/* ${UTT_LIB_DIR}
+	mkdir -p ${UTT_SHARE_DIR}
+	cp -r share/utt/* ${UTT_SHARE_DIR}
+	mkdir -p ${UTT_CONF_DIR}
+	cp -r etc/utt/* ${UTT_CONF_DIR}
+
+.PHONY: uninstall
+uninstall:
+	rm -r ${UTT_LIB_DIR}
+	rm -r ${UTT_SHARE_DIR}
+	rm -r ${CONF_DIR}
Index: _old/app/dist/tarball/README
===================================================================
--- _old/app/dist/tarball/README	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/dist/tarball/README	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,6 @@
+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.
Index: _old/app/lib/attr.pm
===================================================================
--- _old/app/lib/attr.pm	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/lib/attr.pm	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,133 @@
+package attr;
+
+use locale;
+use strict;
+
+use Data::Dumper;
+
+our $pos_re    = qr/(?:[[:upper:]]+)/;
+our $attr_re   = qr/(?:[[:upper:]]+)/;
+our $val_re    = qr/(?:[[:lower:][:digit:]+?!*-]|<[^>\n]+>)/;
+our $av_re     = qr/(?:$attr_re$val_re+)/;
+our $avlist_re = qr/(?:$av_re+)/;
+our $cat_re    = qr/(?:$pos_re(?:\/$avlist_re)?)/;
+
+sub match(\@\@)
+{
+    my ($cat1,$avs1)= @{shift @_};
+    my ($cat2,$avs2)= @{shift @_};
+
+    if($cat1 ne $cat2 && $cat1 ne '*' && $cat2 ne '*')
+    {
+	return 0; 
+    }
+    else
+    {
+      ATTR:for my $attr (keys %$avs1)
+      {
+	  if(exists $avs2->{$attr})
+	  {
+	      for my $val (keys %{$avs1->{$attr}})
+	      {
+		  next ATTR if $avs2->{$attr}->{$val};
+	      }
+	      return 0;
+	      last ATTR;
+	  }
+      }
+    }
+
+    return 1;
+}
+
+sub agree(\@\@$)
+{
+    my $val1 = $_[0]->[1]->{$_[2]};
+    my $val2 = $_[1]->[1]->{$_[2]};
+
+    return 1 if !$val1 || !$val2;
+
+    for my $v (keys %$val1)
+    {
+	return 1 if exists $val2->{$v};
+    }
+    return 0;
+}
+
+# funkcja parse
+# arg:     deskrypcja
+# warto¶æ: referencja do tablicy [<cat>, <avs>],
+#          gdzie <avs> jest referencja do hasza, zawierajacego pary
+#          atrybut=>hasz warto¶ci (pary warto¶æ=>1), czyli np.
+
+#         [
+#           'ADJ',
+#           {
+#             'KOLEDZY' => {
+#                            '<alojzy>' => 1,
+#                            '<karol>' => 1,
+#                            '<jan>' => 1
+#                          },
+#             'C' => {
+#                      'p' => 1,
+#                      'a' => 1,
+#                      'i' => 1
+#                    },
+#             'N' => {
+#                      'p' => 1
+#                    }
+#           }
+#         ];
+
+sub parse ($)
+{
+    my ($dstr)=@_;
+    my $avs={};
+    my ($cat,$attrlist) = split '/', $dstr;
+  ATTR:
+#    while( $attrlist =~ /([[:upper:]]+)((?:[[:lower:][:digit:]+?!*-]|<[^>\n]+>)+)/g )
+    while( $attrlist =~ /($attr_re)($val_re+)/g )
+    {
+	my ($attrstr,$valstr)=($1,$2);
+	my %vals;
+	while($valstr =~ /$val_re/g)
+	{
+	    my $val = $&;
+	    next ATTR if $val eq '*';
+	    $val =~ s/^<([[:lower:]])>$/$1/;
+	    $vals{$val}=1;
+	}
+	
+	$avs->{$attrstr} = \%vals; # dlaczego to dziala? %vals jest lokalne
+    }
+    [$cat, $avs];
+}
+
+# funkcja unparse
+# arg:     jak warto¶æ parse
+# warto¶æ: deskrypcja - napis
+
+sub unparse (\@)
+{
+    my ($cat,$avs)= @{shift @_};
+    my $dstr=$cat;
+    my @attrs = keys %$avs;
+    if(@attrs)
+    {
+	$dstr .= '/';
+	for my $attr ( sort @attrs )
+	{
+	    $dstr .= $attr . (join '', sort keys %{$avs->{$attr}});
+	}
+    }
+    $dstr;
+}
+
+
+sub canonize ($)
+{
+    unparse @{parse @_[0]} ;
+}
+
+
+1;
Index: _old/app/lib/seg.rb
===================================================================
--- _old/app/lib/seg.rb	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/lib/seg.rb	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,31 @@
+
+class Seg
+  
+  def initialize(s="")
+    @line=s
+    self
+  end
+
+  def to_s
+    @line.chomp
+  end
+
+  def set(s)
+    @line=s
+    self
+  end
+
+  def field(key)
+    if key.class==Fixnum
+      @line.split[key-1]
+    elsif key.class==String
+      @line =~ /\s#{key}:(\S+)/; $1
+    end
+  end
+  alias [] field
+
+  def fields
+    @line.split
+  end
+
+end
Index: _old/app/lib/ser.l.template
===================================================================
--- _old/app/lib/ser.l.template	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/lib/ser.l.template	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,30 @@
+%{
+		#include<string.h>
+		int n=0;
+%}
+
+%%
+
+PATTERN			{
+			  int start, end, len;
+			  char *lastseg, *tmp;
+			  if(yytext[yyleng-1]!='\n')
+			    {fprintf(stderr,"ser: pattern matches incomplete line\n"); exit(1);}
+			  n++;
+			  sscanf(yytext,"%d %d",&start,&len);
+			  yytext[yyleng-1]='\0';
+			  if(tmp=strrchr(yytext,'\n'))
+			  {
+			    lastseg=tmp+1;
+			    sscanf(lastseg,"%d %d", &end, &len);
+			  }
+			  else
+			    end=start;
+			  yytext[yyleng-1]='\n';
+			  printf("%04d 00 BOM * ser:%d\n",start,n);
+			  ECHO;
+			  printf("%04d 00 EOM * ser:%d\n",end+len,n);
+			}
+
+
+.*\n			DEFAULTACTION;
Index: _old/app/lib/terms.m4
===================================================================
--- _old/app/lib/terms.m4	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/lib/terms.m4	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,52 @@
+divert(-1)
+#--------------------------------------------------------------------------
+
+# Macros defined here may be used in pattern specifications 
+# You can modify this file according to your needs.
+
+# ENDOFSEGMENT and MORFIELD are macros expanded to, respectively,
+# end of segment marker (dependes on the format: flattened or not)
+# and the name of the annotation field containing morphological
+# information (standard value is 'lem'). These values are controlled
+# by programs using this file to expand search patterns (ser, grp, ...).
+
+# seg(type,form,annotation) 
+
+define(`seg',`(\s*((\d+\s+)(\d+\s+)?)?dnl
+ifelse($1, `',`(\S+)', `($1)')\s+dnl
+ifelse($2, `',`(\S+)', `($2)')dnl
+ifelse($3, `',`((\s+\S+)*)', `(\s+($3))')\s*ENDOFSEGMENT)')
+
+# form(f) - segment containing the form f 
+
+define(`form', `seg(,$1)')
+
+# field(f) segment containing auxiliary field f 
+
+define(`field', `seg(,,`(\S+\s+)*($1)(\s+\S+)*')')
+
+# word, space, punct, number segments (assuming W, S, P, N segment types)
+
+define(`space', `seg(`S',`$1')')
+define(`word',  `seg(`W',`$1')')
+define(`punct', `seg(`P',`$1')')
+define(`number', `seg(`N',`$1')')
+
+# macros specific to PMDB format 
+
+define(`lexeme', `field(`MORFIELD:(\S+;)?$1,\S+')')
+define(`cat', `field(`MORFIELD:\S+,$1([,;]\S+)?')')
+
+
+# Place here your macro definitions. 
+
+
+
+
+
+
+
+
+
+#--------------------------------------------------------------------------
+divert(0)
Index: _old/app/share/cats.dgc
===================================================================
--- _old/app/share/cats.dgc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/share/cats.dgc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,696 @@
+ADJ/DcNpCaGp
+ADJ/DcNpCd
+ADJ/DcNpCgl
+ADJ/DcNpCi
+ADJ/DcNpCnavGaifn
+ADJ/DcNpCnvGp
+ADJ/DcNsCaGi
+ADJ/DcNsCaGpa
+ADJ/DcNsCaiGf
+ADJ/DcNsCavGf
+ADJ/DcNsCdGpain
+ADJ/DcNsCgdlGf
+ADJ/DcNsCgGpain
+ADJ/DcNsCilGpain
+ADJ/DcNsCnavGn
+ADJ/DcNsCnvGpai
+ADJ/DpNpCaGp
+ADJ/DpNpCd
+ADJ/DpNpCgl
+ADJ/DpNpCi
+ADJ/DpNpCnavGaifn
+ADJ/DpNpCnvGp
+ADJ/DpNsCaGi
+ADJ/DpNsCaGpa
+ADJ/DpNsCaiGf
+ADJ/DpNsCavGf
+ADJ/DpNsCdGpain
+ADJ/DpNsCgdlGf
+ADJ/DpNsCgGpain
+ADJ/DpNsCilGpain
+ADJ/DpNsCnavGn
+ADJ/DpNsCnvGpai
+ADJ/DsNpCaGp
+ADJ/DsNpCd
+ADJ/DsNpCgl
+ADJ/DsNpCi
+ADJ/DsNpCnavGaifn
+ADJ/DsNpCnvGp
+ADJ/DsNsCaGi
+ADJ/DsNsCaGpa
+ADJ/DsNsCaiGf
+ADJ/DsNsCavGf
+ADJ/DsNsCdGpain
+ADJ/DsNsCgdlGf
+ADJ/DsNsCgGpain
+ADJ/DsNsCilGpain
+ADJ/DsNsCnavGn
+ADJ/DsNsCnvGpai
+ADJNUM/NpCaGp
+ADJNUM/NpCd
+ADJNUM/NpCgl
+ADJNUM/NpCi
+ADJNUM/NpCnavGaifn
+ADJNUM/NpCnvGp
+ADJNUM/NsCaGi
+ADJNUM/NsCaGpa
+ADJNUM/NsCaiGf
+ADJNUM/NsCavGf
+ADJNUM/NsCdGpain
+ADJNUM/NsCgdlGf
+ADJNUM/NsCgGpain
+ADJNUM/NsCilGpain
+ADJNUM/NsCnavGn
+ADJNUM/NsCnvGpai
+ADJPAP/NpCaGp
+ADJPAP/NpCd
+ADJPAP/NpCgl
+ADJPAP/NpCi
+ADJPAP/NpCnavGaifn
+ADJPAP/NpCnvGp
+ADJPAP/NsCaGi
+ADJPAP/NsCaGpa
+ADJPAP/NsCaiGf
+ADJPAP/NsCavGf
+ADJPAP/NsCdGpain
+ADJPAP/NsCgdlGf
+ADJPAP/NsCgGpain
+ADJPAP/NsCilGpain
+ADJPAP/NsCnavGn
+ADJPAP/NsCnvGpai
+ADJPP/NpCaGp
+ADJPP/NpCd
+ADJPP/NpCgl
+ADJPP/NpCi
+ADJPP/NpCnavGaifn
+ADJPP/NpCnvGp
+ADJPP/NsCaGi
+ADJPP/NsCaGpa
+ADJPP/NsCaiGf
+ADJPP/NsCavGf
+ADJPP/NsCdGpain
+ADJPP/NsCgdlGf
+ADJPP/NsCgGpain
+ADJPP/NsCilGpain
+ADJPP/NsCnavGn
+ADJPP/NsCnvGpai
+ADJPRO/NpCaGp
+ADJPRO/NpCd
+ADJPRO/NpCgl
+ADJPRO/NpCi
+ADJPRO/NpCnavGaifn
+ADJPRO/NpCnvGp
+ADJPRO/NsCaGi
+ADJPRO/NsCaGpa
+ADJPRO/NsCaiGf
+ADJPRO/NsCavGf
+ADJPRO/NsCdGpain
+ADJPRO/NsCgdlGf
+ADJPRO/NsCgGpain
+ADJPRO/NsCilGpain
+ADJPRO/NsCnavGn
+ADJPRO/NsCnvGpai
+ADJPRO/ZdNpCaGp
+ADJPRO/ZdNpCd
+ADJPRO/ZdNpCgl
+ADJPRO/ZdNpCi
+ADJPRO/ZdNpCnavGaifn
+ADJPRO/ZdNpCnvGp
+ADJPRO/ZdNsCaGi
+ADJPRO/ZdNsCaGpa
+ADJPRO/ZdNsCaiGf
+ADJPRO/ZdNsCavGf
+ADJPRO/ZdNsCdGpain
+ADJPRO/ZdNsCgdlGf
+ADJPRO/ZdNsCgGpain
+ADJPRO/ZdNsCilGpain
+ADJPRO/ZdNsCnavGn
+ADJPRO/ZdNsCnvGpai
+ADJPRO/ZgNpCaGp
+ADJPRO/ZgNpCd
+ADJPRO/ZgNpCgl
+ADJPRO/ZgNpCi
+ADJPRO/ZgNpCnavGaifn
+ADJPRO/ZgNpCnvGp
+ADJPRO/ZgNsCaGi
+ADJPRO/ZgNsCaGpa
+ADJPRO/ZgNsCaiGf
+ADJPRO/ZgNsCavGf
+ADJPRO/ZgNsCdGpain
+ADJPRO/ZgNsCgdlGf
+ADJPRO/ZgNsCgGpain
+ADJPRO/ZgNsCilGpain
+ADJPRO/ZgNsCnavGn
+ADJPRO/ZgNsCnvGpai
+ADJPRO/ZiNpCaGp
+ADJPRO/ZiNpCd
+ADJPRO/ZiNpCgl
+ADJPRO/ZiNpCi
+ADJPRO/ZiNpCnavGaifn
+ADJPRO/ZiNpCnvGp
+ADJPRO/ZiNsCaGi
+ADJPRO/ZiNsCaGpa
+ADJPRO/ZiNsCaiGf
+ADJPRO/ZiNsCavGf
+ADJPRO/ZiNsCdGpain
+ADJPRO/ZiNsCgdlGf
+ADJPRO/ZiNsCgGpain
+ADJPRO/ZiNsCilGpain
+ADJPRO/ZiNsCnavGn
+ADJPRO/ZiNsCnvGpai
+ADJPRO/ZnNpCaGp
+ADJPRO/ZnNpCd
+ADJPRO/ZnNpCgl
+ADJPRO/ZnNpCi
+ADJPRO/ZnNpCnavGaifn
+ADJPRO/ZnNpCnvGp
+ADJPRO/ZnNsCaGi
+ADJPRO/ZnNsCaGpa
+ADJPRO/ZnNsCaiGf
+ADJPRO/ZnNsCavGf
+ADJPRO/ZnNsCdGpain
+ADJPRO/ZnNsCgdlGf
+ADJPRO/ZnNsCgGpain
+ADJPRO/ZnNsCilGpain
+ADJPRO/ZnNsCnavGn
+ADJPRO/ZnNsCnvGpai
+ADJPRO/ZqNpCaGp
+ADJPRO/ZqNpCd
+ADJPRO/ZqNpCgl
+ADJPRO/ZqNpCi
+ADJPRO/ZqNpCnavGaifn
+ADJPRO/ZqNpCnvGp
+ADJPRO/ZqNsCaGi
+ADJPRO/ZqNsCaGpa
+ADJPRO/ZqNsCaiGf
+ADJPRO/ZqNsCavGf
+ADJPRO/ZqNsCdGpain
+ADJPRO/ZqNsCgdlGf
+ADJPRO/ZqNsCgGpain
+ADJPRO/ZqNsCilGpain
+ADJPRO/ZqNsCnavGn
+ADJPRO/ZqNsCnvGpai
+ADJPRO/ZqrNpCaGp
+ADJPRO/ZqrNpCd
+ADJPRO/ZqrNpCgl
+ADJPRO/ZqrNpCi
+ADJPRO/ZqrNpCnavGaifn
+ADJPRO/ZqrNpCnvGp
+ADJPRO/ZqrNsCaGi
+ADJPRO/ZqrNsCaGpa
+ADJPRO/ZqrNsCaiGf
+ADJPRO/ZqrNsCavGf
+ADJPRO/ZqrNsCdGpain
+ADJPRO/ZqrNsCgdlGf
+ADJPRO/ZqrNsCgGpain
+ADJPRO/ZqrNsCilGpain
+ADJPRO/ZqrNsCnavGn
+ADJPRO/ZqrNsCnvGpai
+ADJPRO/ZsNpCaGp
+ADJPRO/ZsNpCd
+ADJPRO/ZsNpCgl
+ADJPRO/ZsNpCi
+ADJPRO/ZsNpCnavGaifn
+ADJPRO/ZsNpCnvGp
+ADJPRO/ZsNsCaGi
+ADJPRO/ZsNsCaGpa
+ADJPRO/ZsNsCaiGf
+ADJPRO/ZsNsCavGf
+ADJPRO/ZsNsCdGpain
+ADJPRO/ZsNsCgdlGf
+ADJPRO/ZsNsCgGpain
+ADJPRO/ZsNsCilGpain
+ADJPRO/ZsNsCnavGn
+ADJPRO/ZsNsCnvGpai
+ADJPRP/NpCaGp
+ADJPRP/NpCd
+ADJPRP/NpCgl
+ADJPRP/NpCi
+ADJPRP/NpCnavGaifn
+ADJPRP/NpCnvGp
+ADJPRP/NsCaGi
+ADJPRP/NsCaGpa
+ADJPRP/NsCaiGf
+ADJPRP/NsCavGf
+ADJPRP/NsCdGpain
+ADJPRP/NsCgdlGf
+ADJPRP/NsCgGpain
+ADJPRP/NsCilGpain
+ADJPRP/NsCnavGn
+ADJPRP/NsCnvGpai
+ADVANP
+ADV/Dc
+ADV/Dp
+ADV/Ds
+ADVNUM
+ADVPRO
+ADVPRO/Zd
+ADVPRO/Zi
+ADVPRO/Zn
+ADVPRO/Zq
+ADVPRO/Zqr
+ADVPRO/Zr
+ADVPRP
+APP
+BYC/Vb
+BYC/VpMcNpP1Gaifn
+BYC/VpMcNpP1Gp
+BYC/VpMcNpP2Gaifn
+BYC/VpMcNpP2Gp
+BYC/VpMcNpP3Gaifn
+BYC/VpMcNpP3Gp
+BYC/VpMcNsP1Gf
+BYC/VpMcNsP1Gpai
+BYC/VpMcNsP2Gf
+BYC/VpMcNsP2Gpai
+BYC/VpMcNsP3Gf
+BYC/VpMcNsP3Gn
+BYC/VpMcNsP3Gpai
+BYC/VpMdTaNpP1Gaifn
+BYC/VpMdTaNpP1Gp
+BYC/VpMdTaNpP2Gaifn
+BYC/VpMdTaNpP2Gp
+BYC/VpMdTaNpP3Gaifn
+BYC/VpMdTaNpP3Gp
+BYC/VpMdTaNsP1Gf
+BYC/VpMdTaNsP1Gpai
+BYC/VpMdTaNsP2Gf
+BYC/VpMdTaNsP2Gpai
+BYC/VpMdTaNsP3Gf
+BYC/VpMdTaNsP3Gn
+BYC/VpMdTaNsP3Gpai
+BYC/VpMdTrfNpP1
+BYC/VpMdTrfNpP2
+BYC/VpMdTrfNpP3
+BYC/VpMdTrfNsP1
+BYC/VpMdTrfNsP2
+BYC/VpMdTrfNsP3
+BYC/VpMiNpP1
+BYC/VpMiNpP2
+BYC/VpMiNsP2
+CONJ
+EXCL
+N/GaNpCa
+N/GaNpCd
+N/GaNpCg
+N/GaNpCi
+N/GaNpCl
+N/GaNpCn
+N/GaNpCv
+N/GaNsCa
+N/GaNsCd
+N/GaNsCg
+N/GaNsCi
+N/GaNsCl
+N/GaNsCn
+N/GaNsCv
+N/GfNpCa
+N/GfNpCd
+N/GfNpCg
+N/GfNpCi
+N/GfNpCl
+N/GfNpCn
+N/GfNpCv
+N/GfNsCa
+N/GfNsCd
+N/GfNsCg
+N/GfNsCi
+N/GfNsCl
+N/GfNsCn
+N/GfNsCv
+N/GiNpCa
+N/GiNpCd
+N/GiNpCg
+N/GiNpCi
+N/GiNpCl
+N/GiNpCn
+N/GiNpCv
+N/GiNsCa
+N/GiNsCd
+N/GiNsCg
+N/GiNsCi
+N/GiNsCl
+N/GiNsCn
+N/GiNsCv
+N/GnNpCa
+N/GnNpCd
+N/GnNpCg
+N/GnNpCi
+N/GnNpCl
+N/GnNpCn
+N/GnNpCv
+N/GnNsCa
+N/GnNsCd
+N/GnNsCg
+N/GnNsCi
+N/GnNsCl
+N/GnNsCn
+N/GnNsCv
+N/G?NpCa
+N/G*NpCa
+N/G?NpCd
+N/G*NpCd
+N/G?NpCg
+N/G*NpCg
+N/G?NpCi
+N/G*NpCi
+N/G?NpCl
+N/G*NpCl
+N/G?NpCn
+N/G*NpCn
+N/G?NpCv
+N/G*NpCv
+N/G?NsCa
+N/G?NsCd
+N/G?NsCg
+N/G?NsCi
+N/G?NsCl
+N/G?NsCn
+N/G?NsCv
+N/GpNpCa
+N/GpNpCd
+N/GpNpCg
+N/GpNpCi
+N/GpNpCl
+N/GpNpCn
+N/GpNpCv
+N/GpNsCa
+N/GpNsCd
+N/GpNsCg
+N/GpNsCi
+N/GpNsCl
+N/GpNsCn
+N/GpNsCv
+NPRO/ZdGnNsCa
+NPRO/ZdGnNsCd
+NPRO/ZdGnNsCg
+NPRO/ZdGnNsCi
+NPRO/ZdGnNsCl
+NPRO/ZdGnNsCn
+NPRO/ZgGnNsCa
+NPRO/ZgGnNsCd
+NPRO/ZgGnNsCg
+NPRO/ZgGnNsCi
+NPRO/ZgGnNsCl
+NPRO/ZgGnNsCn
+NPRO/ZgGpNpCa
+NPRO/ZgGpNpCd
+NPRO/ZgGpNpCg
+NPRO/ZgGpNpCi
+NPRO/ZgGpNpCl
+NPRO/ZgGpNpCn
+NPRO/ZiGnNsCa
+NPRO/ZiGnNsCd
+NPRO/ZiGnNsCg
+NPRO/ZiGnNsCi
+NPRO/ZiGnNsCl
+NPRO/ZiGnNsCn
+NPRO/ZiGpNsCa
+NPRO/ZiGpNsCd
+NPRO/ZiGpNsCg
+NPRO/ZiGpNsCi
+NPRO/ZiGpNsCl
+NPRO/ZiGpNsCn
+NPRO/ZnGnNsCa
+NPRO/ZnGnNsCd
+NPRO/ZnGnNsCg
+NPRO/ZnGnNsCi
+NPRO/ZnGnNsCl
+NPRO/ZnGnNsCn
+NPRO/ZnGpNsCa
+NPRO/ZnGpNsCd
+NPRO/ZnGpNsCg
+NPRO/ZnGpNsCi
+NPRO/ZnGpNsCl
+NPRO/ZnGpNsCn
+NPRO/ZpGaifnNpCa
+NPRO/ZpGaifnNpCd
+NPRO/ZpGaifnNpCg
+NPRO/ZpGaifnNpCi
+NPRO/ZpGaifnNpCl
+NPRO/ZpGaifnNpCn
+NPRO/ZpGfNsCa
+NPRO/ZpGfNsCd
+NPRO/ZpGfNsCg
+NPRO/ZpGfNsCi
+NPRO/ZpGfNsCl
+NPRO/ZpGfNsCn
+NPRO/ZpGnNsCa
+NPRO/ZpGnNsCd
+NPRO/ZpGnNsCg
+NPRO/ZpGnNsCi
+NPRO/ZpGnNsCl
+NPRO/ZpGnNsCn
+NPRO/ZpG*NpCa
+NPRO/ZpG*NpCd
+NPRO/ZpG*NpCg
+NPRO/ZpG*NpCi
+NPRO/ZpG*NpCl
+NPRO/ZpG*NpCn
+NPRO/ZpG*NsCa
+NPRO/ZpG*NsCd
+NPRO/ZpG*NsCg
+NPRO/ZpG*NsCi
+NPRO/ZpG*NsCl
+NPRO/ZpG*NsCn
+NPRO/ZpGpaiNsCa
+NPRO/ZpGpaiNsCd
+NPRO/ZpGpaiNsCg
+NPRO/ZpGpaiNsCi
+NPRO/ZpGpaiNsCl
+NPRO/ZpGpaiNsCn
+NPRO/ZpGpNpCa
+NPRO/ZpGpNpCd
+NPRO/ZpGpNpCg
+NPRO/ZpGpNpCi
+NPRO/ZpGpNpCl
+NPRO/ZpGpNpCn
+NPRO/ZqGnNsCa
+NPRO/ZqGnNsCd
+NPRO/ZqGnNsCg
+NPRO/ZqGnNsCi
+NPRO/ZqGnNsCl
+NPRO/ZqGnNsCn
+NPRO/ZqGpNsCa
+NPRO/ZqGpNsCd
+NPRO/ZqGpNsCg
+NPRO/ZqGpNsCi
+NPRO/ZqGpNsCl
+NPRO/ZqGpNsCn
+NPRO/ZqrGnNsCa
+NPRO/ZqrGnNsCd
+NPRO/ZqrGnNsCg
+NPRO/ZqrGnNsCi
+NPRO/ZqrGnNsCl
+NPRO/ZqrGnNsCn
+NPRO/ZqrGpNsCa
+NPRO/ZqrGpNsCd
+NPRO/ZqrGpNsCg
+NPRO/ZqrGpNsCi
+NPRO/ZqrGpNsCl
+NPRO/ZqrGpNsCn
+NPRO/ZxG*N*Ca
+NPRO/ZxG*N*Cd
+NPRO/ZxG*N*Cg
+NPRO/ZxG*N*Ci
+NPRO/ZxG*N*Cl
+NUMCOL/Ca
+NUMCOL/Cd
+NUMCOL/Cg
+NUMCOL/Ci
+NUMCOL/Cl
+NUMCOL/Cn
+NUMCRD/Ca
+NUMCRD/CaGaifn
+NUMCRD/CaGain
+NUMCRD/CaGf
+NUMCRD/CaGp
+NUMCRD/Cd
+NUMCRD/Cg
+NUMCRD/Ci
+NUMCRD/CiGf
+NUMCRD/CiGpain
+NUMCRD/Cl
+NUMCRD/Cn
+NUMCRD/CnGaifn
+NUMCRD/CnGain
+NUMCRD/CnGf
+NUMCRD/CnGp
+NUMCRD/ZiCaGaifn
+NUMCRD/ZiCaGain
+NUMCRD/ZiCaGf
+NUMCRD/ZiCaGp
+NUMCRD/ZiCd
+NUMCRD/ZiCg
+NUMCRD/ZiCi
+NUMCRD/ZiCiGf
+NUMCRD/ZiCiGpain
+NUMCRD/ZiCl
+NUMCRD/ZiCnGaifn
+NUMCRD/ZiCnGain
+NUMCRD/ZiCnGf
+NUMCRD/ZiCnGp
+NUMCRD/ZqiCaGaifn
+NUMCRD/ZqiCaGp
+NUMCRD/ZqiCd
+NUMCRD/ZqiCg
+NUMCRD/ZqiCi
+NUMCRD/ZqiCl
+NUMCRD/ZqiCnGaifn
+NUMCRD/ZqiCnGp
+NUMORD/NpCaGp
+NUMORD/NpCd
+NUMORD/NpCgl
+NUMORD/NpCi
+NUMORD/NpCnavGaifn
+NUMORD/NpCnvGp
+NUMORD/NsCaGi
+NUMORD/NsCaGpa
+NUMORD/NsCaiGf
+NUMORD/NsCavGf
+NUMORD/NsCdGpain
+NUMORD/NsCgdlGf
+NUMORD/NsCgGpain
+NUMORD/NsCilGpain
+NUMORD/NsCnavGn
+NUMORD/NsCnvGpai
+NUMPAR
+NUMPAR/Dc
+NUMPAR/Dp
+NUMPAR/Ds
+NUMPAR/Ns
+NUMPAR/NsGf
+NUMPAR/NsGpain
+NV/Ca
+NV/Cd
+NV/Cg
+NV/Ci
+NV/Cl
+NV/Cn
+ONO
+P
+PART
+P/Ca
+P/Cai
+P/Cal
+P/Cd
+P/Cg
+P/Cga
+P/Cgai
+P/Cgd
+P/Cgi
+P/Ci
+P/Cl
+PPRO/Zp
+V/AiVb
+V/AiViTa
+V/AiVpMcNpP1Gaifn
+V/AiVpMcNpP1Gp
+V/AiVpMcNpP2Gaifn
+V/AiVpMcNpP2Gp
+V/AiVpMcNpP3Gaifn
+V/AiVpMcNpP3Gp
+V/AiVpMcNsP1Gf
+V/AiVpMcNsP1Gpai
+V/AiVpMcNsP2Gf
+V/AiVpMcNsP2Gpai
+V/AiVpMcNsP3Gf
+V/AiVpMcNsP3Gn
+V/AiVpMcNsP3Gpai
+V/AiVpMdTaNpP1Gaifn
+V/AiVpMdTaNpP1Gp
+V/AiVpMdTaNpP2Gaifn
+V/AiVpMdTaNpP2Gp
+V/AiVpMdTaNpP3Gaifn
+V/AiVpMdTaNpP3Gp
+V/AiVpMdTaNsP1Gf
+V/AiVpMdTaNsP1Gpai
+V/AiVpMdTaNsP2Gf
+V/AiVpMdTaNsP2Gpai
+V/AiVpMdTaNsP3Gf
+V/AiVpMdTaNsP3Gn
+V/AiVpMdTaNsP3Gpai
+V/AiVpMdTrfNpP1
+V/AiVpMdTrfNpP2
+V/AiVpMdTrfNpP3
+V/AiVpMdTrfNsP1
+V/AiVpMdTrfNsP2
+V/AiVpMdTrfNsP3
+V/AiVpMiNpP1
+V/AiVpMiNpP2
+V/AiVpMiNsP2
+V/ApVb
+V/ApViTa
+V/ApVpMcNpP1Gaifn
+V/ApVpMcNpP1Gp
+V/ApVpMcNpP2Gaifn
+V/ApVpMcNpP2Gp
+V/ApVpMcNpP3Gaifn
+V/ApVpMcNpP3Gp
+V/ApVpMcNsP1Gf
+V/ApVpMcNsP1Gpai
+V/ApVpMcNsP2Gf
+V/ApVpMcNsP2Gpai
+V/ApVpMcNsP3Gf
+V/ApVpMcNsP3Gn
+V/ApVpMcNsP3Gpai
+V/ApVpMdTaNpP1Gaifn
+V/ApVpMdTaNpP1Gp
+V/ApVpMdTaNpP2Gaifn
+V/ApVpMdTaNpP2Gp
+V/ApVpMdTaNpP3Gaifn
+V/ApVpMdTaNpP3Gp
+V/ApVpMdTaNsP1Gf
+V/ApVpMdTaNsP1Gpai
+V/ApVpMdTaNsP2Gf
+V/ApVpMdTaNsP2Gpai
+V/ApVpMdTaNsP3Gf
+V/ApVpMdTaNsP3Gn
+V/ApVpMdTaNsP3Gpai
+V/ApVpMdTrfNpP1
+V/ApVpMdTrfNpP2
+V/ApVpMdTrfNpP3
+V/ApVpMdTrfNsP1
+V/ApVpMdTrfNsP2
+V/ApVpMdTrfNsP3
+V/ApVpMiNpP1
+V/ApVpMiNpP2
+V/ApVpMiNsP2
+V/GiVb
+V/GiViTa
+V/GiVpMcNpP1Gaifn
+V/GiVpMcNpP1Gp
+V/GiVpMcNpP2Gaifn
+V/GiVpMcNpP2Gp
+V/GiVpMcNpP3Gaifn
+V/GiVpMcNpP3Gp
+V/GiVpMcNsP1Gf
+V/GiVpMcNsP1Gpai
+V/GiVpMcNsP2Gf
+V/GiVpMcNsP2Gpai
+V/GiVpMcNsP3Gf
+V/GiVpMcNsP3Gn
+V/GiVpMcNsP3Gpai
+V/GiVpMdTaNpP1Gaifn
+V/GiVpMdTaNpP1Gp
+V/GiVpMdTaNpP2Gaifn
+V/GiVpMdTaNpP2Gp
+V/GiVpMdTaNpP3Gaifn
+V/GiVpMdTaNpP3Gp
+V/GiVpMdTaNsP1Gf
+V/GiVpMdTaNsP1Gpai
+V/GiVpMdTaNsP2Gf
+V/GiVpMdTaNsP2Gpai
+V/GiVpMdTaNsP3Gf
+V/GiVpMdTaNsP3Gn
+V/GiVpMdTaNsP3Gpai
+V/GiVpMdTrfNpP1
+V/GiVpMdTrfNpP2
+V/GiVpMdTrfNpP3
+V/GiVpMdTrfNsP1
+V/GiVpMdTrfNsP2
+V/GiVpMdTrfNsP3
+V/GiVpMiNpP1
+V/GiVpMiNpP2
+V/GiVpMiNsP2
+VNI
Index: _old/app/share/gram.dgc
===================================================================
--- _old/app/share/gram.dgc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/share/gram.dgc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,126 @@
+#FLAG REL
+
+#UP REL 
+
+#ORDER * pcmpl
+#ORDER ..
+#ORDER subj .. * ..  cmpl
+#ORDER refl .. *
+#ORDER * refl
+
+#CONSTR	cmpl_g	 => ~cmpl_a
+#CONSTR	cmpl_inf => ~(cmpl_g|cmpl_d|cmpl_a|cmpl_p|cmpl_ze|cmpl_s)
+#CONSTR subj_pred => subj
+#constr cmpl_pred => cmpl
+
+
+
+#subj
+ROLE subj         # deklaracja roli (typ zaleznosci) podmiot
+AGR subj N        # zgodnosc podrzednika z nadrzednikiem co do liczby
+AGR subj G        # zgodnosc podrzednika z nadrzednikiem co do rodzaju
+GOV subj */Cn     # wymaganie by podrzednik byl w mianowniku
+
+# pary kategorii, jakie mozna polaczyc zaleznoscia typu podmiot
+
+#	nadrzednik		podrzednik
+LINK	V/VpP3,BYC/VpP3		N,NPRO		subj
+
+# (przecinek znaczy lub)
+
+ROLE cmpl_ga	# dopelnienie w bierniku/dopelniaczu
+ROLE cmpl_d     #             w celowniku
+ROLE cmpl_i     #             w narzedniku
+ROLE cmpl_inf   #             w bezokoliczniku
+ROLE cmpl_s     #             bedace zdaniem
+ROLE cmpl_ze    #             bedace zdaniem poprzedzonym 'ze'
+ROLE aux        # 
+ROLE mod	# modyfikator (okolicznik/przydawka) (niewymagane okreÅlenie) (biaÅy kot)
+ROLE prep	# modyfikator w postaci frazy przyimkowej
+ROLE pcmpl	# dopeÅnienie przyimka (wymagany rzeczownik)
+ROLE ccmpl	# dopeÅnienie spÃ³jnika (wymagany drugi czÅon konstrukcji spÃ³jnikowej)
+ROLE poss	# np. ksiÄ
+ÅŒka Marii, ojciec kolegi
+ROLE restr	# (bardzo <- duÅŒy)
+ROLE part	# partykuÅa
+ROLE coord	# koordynacja (powiÄ
+zanie pierwszego czÅonu konstrukcji wspÃ³ÅrzÄdnej
+		# ze spÃ³jnikiem wspÃ³ÅrzÄdnym centralnym ( Oto [pies -> i] kot. )
+ 
+
+AGR aux N
+AGR aux G
+
+AGR mod N
+AGR mod C
+AGR mod G
+
+AGR pcmpl C
+
+GOV	cmpl_ga	*/Cga
+GOV	cmpl_d	*/Cd
+GOV	cmpl_i	*/Ci
+GOV	poss	*/Cg
+
+SGL subj
+SGL cmpl_ga
+SGL cmpl_d
+SGL cmpl_i
+SGL cmpl_inf
+SGL aux
+SGL pcmpl
+SGL ccmpl
+SGL poss
+SGL restr
+
+REQ	P	pcmpl
+REQ	CONJ	ccmpl
+
+RIGHT pcmpl
+RIGHT ccmpl
+RIGHT cmpl_ze
+RIGHT poss
+
+
+#cmpl_*
+LINK	V,ADVPRP,ADVANP,ADJPRP,ADJPAP,NV	N,NPRO			cmpl_ga
+LINK	V,ADVPRP,ADVANP,ADJPRP,ADJPAP,NV	N,NPRO			cmpl_d
+LINK	V,ADVPRP,ADVANP,ADJPRP,ADJPAP,NV	N,NPRO			cmpl_i
+LINK	V,ADVPRP,ADVANP,ADJPRP,ADJPAP,NV	V/Vb			cmpl_inf
+LINK	V,ADVPRP,ADVANP,ADJPRP,ADJPAP,NV	CONJ			cmpl_ze
+
+#aux
+#czas przyszly analityczny
+LINK	BYC/VpMdTf				V/AiVpP3,V/AiVb		aux
+#czas zaprzeszly(?)
+LINK	BYC/VpMc				V/VpP3			aux
+#BYC jako lacznik w (jest bialy, jest zaszlachtowany, jest pilotem)
+LINK	BYC					ADJPAP/Cn,ADJ/Cn,N/Ci	aux
+
+#mod
+
+LINK	V	ADV,ADVPRP,ADVANP,ADVPRO	mod
+LINK	N,NV	ADJ,ADJPAP,ADJPRP,ADJPRO	mod
+
+
+#prep
+LINK	N,V	P	prep
+
+#pcmpl
+LINK	P	N,NV	pcmpl
+
+
+#poss
+LINK	N	N,NV,NPRO	poss
+
+
+#ccmpl
+LINK	CONJ	V/Vp	ccmpl
+
+
+#restr
+LINK	ADJ	ADV	restr
+
+
+#part
+LINK	V	PART	part
Index: _old/app/share/weights.kor
===================================================================
--- _old/app/share/weights.kor	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/share/weights.kor	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,21 @@
+%stdcor	1
+%xchg	1
+¿  rz 0.5
+ch h  0.5
+u  ó  0.5
+u  o  0.75
+om ¹  0.5
+om a  0.75
+en ê  0.5
+en ê  0.75
+a  ¹  0.25
+c  æ  0.25
+e  ê  0.25
+l  ³  0.25
+n  ñ  0.25
+o  ó  0.25
+s  ¶  0.25
+z  ¿  0.25
+z  Œ  0.25
+x  Œ  0.30
+
Index: _old/app/src/common/Makefile
===================================================================
--- _old/app/src/common/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/common/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,8 @@
+# main: cmdline.c main_template.cc
+# 	g++ -o main cmdline.c common.cc main_template.cc
+
+# cmdline.c cmdline.h : cmdline.ggo
+# 	gengetopt -i cmdline.ggo
+
+# cmdline.ggo: cmdline_common.ggo cmdline_program.ggo
+# 	cat cmdline_common.ggo cmdline_program.ggo > cmdline.ggo
Index: _old/app/src/common/README
===================================================================
--- _old/app/src/common/README	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/common/README	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,18 @@
+Propozycja ujednolicenia dzialania klocka na poziomie
+funkcji main. Parametry meta - zdefiniowane dla
+wszystkich, poza tok, programow, definiujace ich zachowanie
+w systemie klockow.
+
+cmdline_common.ggo		- deklaracje parametrow meta
+
+cmdline_program.ggo		- przyklad deklaracji parametrow programu
+				  nazwa docelowa np. cmdline_guess.ggo
+
+common.cc			- zmienne globalne zawierajace informacje
+				  przekazane przez parametry meta 
+common.h			
+
+main_template.cc		- szkielet funkcji main
+
+Makefile			- sposob kompilacji
+
Index: _old/app/src/common/cmdline_common.ggo
===================================================================
--- _old/app/src/common/cmdline_common.ggo	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/common/cmdline_common.ggo	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,34 @@
+#section "Common UTT options"
+
+
+option  "input"		f	"Input file" string no
+
+option  "output"	o	"Output file for succesfully processed segments" string no
+
+option  "fail"		e	"Output file for unsuccesfully processed segments " string no
+
+option 	"only-fail"	-	"Print only segments the program failed to process" flag off hidden
+
+option 	"no-fail"	-	"Print only segments the program processed" flag off hidden 
+
+option  "copy"		c       "Copy succesfully processed segments to standard output" flag off
+
+option  "process"	p	"Process segments with this tag" string no multiple
+
+option  "select"	s	"Select only segments with this field" string no multiple
+
+option  "ignore"	S	"Select only segments without this field" string no multiple
+
+option	"output-field"	O	"Output field name" string no
+
+option	"input-field"	I	"Input field name" string no multiple
+
+option	"interactive"	i	"Toggle interactive mode" flag off
+
+option  "config"	-	"Configuration file" string typestr="FILENAME" no
+
+option 	"one-field"	1	"Print all results in one segments (creates ambiguous annotation)" flag off
+
+option	"one-line"	-	"Print annotation alternatives as additional fields" flag off
+
+option	"language"	-	"Language." string no
Index: _old/app/src/common/cmdline_program.ggo
===================================================================
--- _old/app/src/common/cmdline_program.ggo	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/common/cmdline_program.ggo	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,5 @@
+package "guess"
+version "0.1"
+
+option  "color"		l       "Show guessed descriptions in colour." flag off
+
Index: _old/app/src/common/common.cc
===================================================================
--- _old/app/src/common/common.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/common/common.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,230 @@
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include "common.h"
+
+#include <stdio.h>
+#include <locale.h>
+
+FILE* inputf=stdin;
+FILE* outputf=stdout;
+FILE* failedf=stdout;
+bool copy_processed=0;
+bool one_field=false;
+bool one_line=false;
+char output_field_prefix[FIELD_PREFIX_MAXLEN];
+char input_field_prefix[FIELD_PREFIX_MAXLEN];
+
+extern int argc;
+extern char **argv;
+
+
+// tilde (home dir) expansion in path
+int expand_path(char* inpath, char* outpath)
+{
+  if(inpath[0]=='~')
+    sprintf(outpath,"%s%s",getenv("HOME"),inpath+1);
+  else
+    strcpy(outpath,inpath);
+  return 0; // no problem
+}
+
+
+
+
+void set_program_name(char program_name[], char* argv0)
+{
+  if (char* p_name = strrchr(argv0, '/'))
+    strcpy(program_name,p_name+1);
+  else
+    strcpy(program_name,argv0);
+}
+
+
+
+extern void process_config_files(gengetopt_args_info* args, char* argv0)
+{
+
+  char program_name[256];
+  char config_file[256];
+  char config_file_tmp[256];
+
+  set_program_name(program_name,argv0);
+
+  // obsÅuga pliku konfiguracyjnego podanego w linii komend
+  if (args->config_given) {
+    if (file_accessible(args->config_arg) == 0) {
+      if (cmdline_parser_configfile(args->config_arg,
+				    args,
+				    0, // 0 - nie nadpisuj wartoÅci parametrÃ³w
+				    0, // 0 - nie inicjuj
+				    0) != 0) {
+	fprintf(stderr, "Error in config file (%s)\n", args->config_arg);
+	exit(1);
+      }
+    }
+  }
+
+  if(args->one_line_given && !one_line) one_line=true, one_field=false;
+  if(args->one_field_given && !one_field) one_line=false, one_field=true;
+
+  // obsluga pliku konfiguracyjnego uzytkownika dla programu
+  sprintf(config_file_tmp, "%s/%s.conf", USER_CONFIG_DIR, program_name);
+  expand_path(config_file_tmp, config_file);
+  if (file_accessible(config_file) == 0) {
+    if (cmdline_parser_configfile(config_file,
+				  args,
+				  0, // 0 - nie nadpisuj danych
+				  0, // 0 - nie inicjuj struktury
+				  0) != 0) {
+      fprintf(stderr, "Error in config file (%s)\n", config_file);
+      exit(1);
+    }
+  }
+
+  if(args->one_line_given && !one_line) one_line=true, one_field=false;
+  if(args->one_field_given && !one_field) one_line=false, one_field=true;
+
+
+  // obsluga pliku konfiguracyjnego uzytkownika globalnego
+  sprintf(config_file_tmp, "%s/utt.conf", USER_CONFIG_DIR);
+  expand_path(config_file_tmp, config_file);
+  if (file_accessible(config_file) == 0) {
+    if (cmdline_parser_configfile(config_file,
+				  args,
+				  0, // 0 - nie nadpisuj danych
+				  0, // 0 - nie inicjuj struktury
+				  0) != 0) {
+      fprintf(stderr, "Error in config file (%s)\n", config_file);
+      exit(1);
+    }
+  }
+
+  if(args->one_line_given && !one_line) one_line=true, one_field=false;
+  if(args->one_field_given && !one_field) one_line=false, one_field=true;
+
+
+
+  // obsluga systemowego pliku konfiguracyjnego dla programu
+  sprintf(config_file, "%s/%s.conf", SYSTEM_CONFIG_DIR, program_name);
+  if (file_accessible(config_file) == 0) {
+    if (cmdline_parser_configfile(config_file,
+				  args,
+				  0, // 0 - nie zmieniaj danych wczesniejszych
+				  0, // 0 - nie inicjuj struktury
+				  0  // 0 - nie sprawdzaj wymaganych parametrow
+				  ) != 0) {
+      fprintf(stderr, "Error in config file (%s)\n", config_file);
+      exit(1);
+    }
+  }
+
+  if(args->one_line_given && !one_line) one_line=true, one_field=false;
+  if(args->one_field_given && !one_field) one_line=false, one_field=true;
+
+
+  // obsluga systemowego pliku konfiguracyjnego globalnego
+  sprintf(config_file, "%s/utt.conf", SYSTEM_CONFIG_DIR);
+  if (file_accessible(config_file) == 0) {
+    if (cmdline_parser_configfile(config_file,
+				  args,
+				  0, // 0 - nie zmieniaj danych wczesniejszych
+				  0, // 0 - nie inicjuj struktury
+				  0  // 0 - nie sprawdzaj wymaganych parametrow
+				  ) != 0) {
+      fprintf(stderr, "Error in config file (%s)\n", config_file);
+      exit(1);
+    }
+  }
+
+  if(args->one_line_given && !one_line) one_line=true, one_field=false;
+  if(args->one_field_given && !one_field) one_line=false, one_field=true;
+
+}
+
+
+void process_common_options(gengetopt_args_info* args, char* argv0)
+{
+  char program_name[256];
+
+  set_program_name(program_name,argv0);
+
+  setlocale(LC_CTYPE,"");
+  setlocale(LC_COLLATE, "");
+
+  if(args->help_given)
+      cmdline_parser_print_help ();
+
+  if(args->input_given)
+    if(!(inputf=fopen(args->input_arg,"r")))
+    {
+      fprintf(stderr,"No such file: %s.\n", args->input_arg);
+      exit(1);
+    }
+  
+  if(args->output_given)
+    if(!(outputf=fopen(args->output_arg,"w")))
+    {
+      fprintf(stderr,"Cannot open output file: %s.\n", args->output_arg);
+      exit(1);
+    }
+  
+  if(args->fail_given)
+      if(!(failedf=fopen(args->fail_arg,"w")))
+      {
+	fprintf(stderr,"Cannot open output file: %s.\n", args->fail_arg);
+	exit(1);
+      }
+
+  if(args->input_field_given)
+    fieldprefix(args->input_field_arg[0],input_field_prefix);
+  else
+    strcpy(input_field_prefix, "4");
+
+  if(args->output_field_given)
+    fieldprefix(args->output_field_arg,output_field_prefix);
+  else
+    sprintf(output_field_prefix, "%s%c", program_name, INFIELD_SEP);
+
+  if ((args->copy_given))
+    copy_processed=true;
+}
+
+// sprawdza istnienie pliku
+int file_accessible(const char* path) {
+  return access(path, R_OK);
+}
+
+// sprawdza istnienie pliku konfiguracyjnego
+int config_file_exists(const char* dir, const char* filename) {
+    struct stat dir_stat;
+    struct stat file_stat;
+
+    char* path = (char*)malloc(strlen(dir) + strlen(filename) + 2); // + '\0' + '/'
+
+    sprintf(path, "%s/%s", dir, filename);
+
+    if (stat(dir, &dir_stat) != 0)
+	return -1;
+
+    if (stat(path, &file_stat) != 0)
+	return -1;
+
+    if (!S_ISDIR(dir_stat.st_mode))
+	return -1; // katalog nie jest katalogiem
+
+    if (!S_ISREG(file_stat.st_mode))
+	return -1; // plik konfiguracyjny nie jest plikiem
+
+    if (access(dir, X_OK) != 0)
+	return -1; // nie mamy prawa zmienic katalogu
+
+    if (access(path, R_OK) != 0)
+	return -1; // nie mamy prawa odczytu pliku
+
+    free(path);
+
+    return 0;
+}
Index: _old/app/src/common/common.h
===================================================================
--- _old/app/src/common/common.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/common/common.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,467 @@
+#ifndef __COMMON_H
+#define __COMMON_H
+
+#include <stdio.h>
+#include <ctype.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "../lib/const.h"
+
+#ifndef _CMDLINE_FILE
+#error _CMDLINE_FILE constant not defined!
+#else
+#include _CMDLINE_FILE
+#endif
+
+
+/**************************************************
+ * Stale dotyczace wejscia/wyjscia
+ */
+
+#define EMPTYFORM '*'
+#define INFIELD_SEP ':'
+#define MAXAUX 16
+#define FIELD_SEP " \t\n"
+#define FIELD_PREFIX_MAXLEN 32
+
+
+// katalogi z plikami konfiguracyjnymi
+// nowe
+// stare - do wyrzucenia
+// #define CONFIG_DIR ".utt/conf"
+
+// nazwa zmiennej okreslajaca sciezke do danych
+
+// #define UTT_DIR_VAR "UTT_DIR"
+
+// sciezka do plikow z danymi (np UTT_DIR/pliki) wzgledem $HOME!
+
+// #define UTT_DIR_DEFAULT ".utt/pl/"
+
+/**************************************************/
+
+
+extern FILE* inputf;
+extern FILE* outputf;
+extern FILE* failedf;
+
+extern char* input_filename;
+extern char* output_filename;
+extern char* failed_filename;
+extern bool one_line;
+extern bool one_field;
+
+extern char input_field_prefix[];
+extern char output_field_prefix[];
+
+extern bool copy_processed;
+extern bool append_output;
+extern bool append_failed;
+
+//sciezka do katalogu z danymi
+extern char utt_dir[];
+
+extern void process_common_options(gengetopt_args_info* args, char* argv0);
+extern void process_config_files(gengetopt_args_info* args, char* argv0);
+
+extern int expand_path(char* inpath, char* outpath);
+
+/**************************************************
+ * problems with casing                           */
+// sprawdzenie wielkosci liter
+// wartoÂ¶ÃŠ zwracana:
+// 0 - wszystkie maÂ³e litery
+// 1 - pierwsza wielka, reszta male
+// 2 - wszystkie wielkie
+// 3 - inne
+inline int casing(char* s)
+{
+  int ret = isupper(*s) ? 1 : 0;
+  while(*++s != '\0')
+  {
+    if(isupper(*s))
+    {
+      if(ret==1) ret=2;
+      else if(ret==0) ret=3;
+    }
+    else
+    {
+      if(ret==2) ret=3;
+    }
+  }
+  return ret;
+}
+
+// 
+inline void tolowers(char* s, char* d)
+{
+  *d=tolower(*s);
+  while(*s != '\0') * ++d = tolower(* ++s);
+}
+
+
+// przepisuje s do d
+// nadajac wielkoÂ¶ÃŠ liter zgodnie z wartoÂ¶ciÂ± casing
+// casing - wartoÂ¶ÃŠ zwracana przez casing()
+// jeÂ¶li casing==3 przepisuje bez zmian (za maÂ³o informacji)
+inline void restorecasing(char *s, char *d, int casing)
+{
+  switch(casing)
+  {
+  case 0:
+  case 3:
+    *d=*s;
+    while(*s != '\0') * ++d = * ++s;
+    break;
+  case 1:
+    *d=toupper(*s);
+    while(*s != '\0') * ++d = * ++s;
+    break;
+  case 2:
+    *d=toupper(*s);
+    while(*s != '\0') * ++d = toupper(* ++s);
+    break;
+  }
+}
+
+/**************************************************/
+
+/*
+parameters:
+  -seg  - segment
+  -pref - field name or "1", "2", "3", "4" for the first four fields
+  +val  - field contents
+return value:
+  1 if specified field exists, 0 otherwise
+*/
+
+inline int getfield(char* seg, const char* pref, char* val)
+{
+
+  char* p=seg;
+  char* p0;
+
+  while(isspace(*p)) ++p;
+
+  // field "1"
+  p0=p; while(isdigit(*p)) ++p;
+  if(*pref=='1') if(p!=p0) { strncpy(val,p0,p-p0); val[p-p0]='\0'; return 1; } else return 0;
+  
+  while(isspace(*p)) ++p;
+
+  // field "2"
+  p0=p; while(isdigit(*p)) ++p;
+  if(*pref=='2') if(p!=p0) { strncpy(val,p0,p-p0); val[p-p0]='\0'; return 1; } else return 0;
+
+  while(isspace(*p)) ++p;
+
+  // field "3"
+  p0=p; while(isgraph(*p)) ++p; 
+  if(*pref=='3') if(p!=p0) { strncpy(val,p0,p-p0); val[p-p0]='\0'; return 1; } else return 0;
+
+  while(isspace(*p)) ++p;
+
+  // field "4"
+  p0=p; while(isgraph(*p)) ++p;
+  if(*pref=='4') if(p!=p0) { strncpy(val,p0,p-p0); val[p-p0]='\0'; return 1; } else return 0;
+
+  while(isspace(*p)) ++p;
+
+  // annotation fields
+  do p=strstr(p,pref); while(p!=NULL && *(p-1)!=' ' && *(p-1)!='\t');
+  
+  if(p==NULL) return 0;
+  else
+  {
+    p+=strlen(pref);
+    int len=strcspn(p,FIELD_SEP "\n\r\f\0");
+    strncpy(val,p,len);
+    val[len]='\0';
+    return 1;
+  }
+}
+
+
+/*
+parameters:
+        -name - field name, long or short
+        +prefix - field name with ':' appended if long name
+return value:
+        1 if correct field name, 0 otherwise
+examples:
+name    prefix  r.v.
+lem     lem:    1
+@       @       1
+::      'undef' 0
+a,b     'undef' 0
+*/
+inline
+int fieldprefix(char *name, char *prefix)
+{
+  if (ispunct(name[0]) && name[1]=='\0') // correct short name
+  {
+    strcpy(prefix, name); return 1;
+  }
+
+  int i=0;
+  while(name[i]!='\0' && isalnum(name[i])) ++i;
+  
+  if(name[i]=='\0' && i>0) // correct long name
+  {
+    sprintf(prefix,"%s:",name); return 1;
+  }
+
+  // incorrect
+  return 0;
+}
+
+inline
+bool process_seg(char* seg, gengetopt_args_info& args)
+{
+  char buf[256];
+  char pref[FIELD_PREFIX_MAXLEN];
+  bool ret = !args.process_given;
+  if(args.process_given)
+    {
+      getfield(seg,"3",buf);
+      for(int i=0; i<args.process_given; ++i)
+	if(strcmp(args.process_arg[i],buf)==0)
+	  {
+	    ret=true;
+	    break;
+	  }
+    }
+
+  if(ret==false) return false; 
+
+  for(int i=0; i<args.select_given; ++i)
+    {
+      fieldprefix(args.select_arg[i],pref); // !!! ÅATKA - ZOPTYMALIZOWAÄ !!!
+      if(! getfield(seg,pref,buf))
+	return false;
+    }
+  for(int i=0; i<args.ignore_given; ++i)
+    {
+      fieldprefix(args.ignore_arg[i],pref);  // !!! ÅATKA - ZOPTYMALIZOWAÄ !!!
+      if(getfield(seg,pref,buf))
+	return false;
+    }
+  
+  if(args.input_field_given & !getfield(seg,input_field_prefix,buf))
+    return false;
+
+  return true;
+}
+
+
+/*
+parameters:
+  -+seg - segment
+  -pref - prefix of the new field
+  -val  - contents of the new field
+return value:
+  1 - success, 0 - fail (limit on segment length exceeded)
+ */
+inline
+int addfield(char *seg, const char *pref, const char *val)
+     // zalozenie, ze seg konczy sie znakiem \n
+{
+  if(strlen(seg)+strlen(pref)+strlen(val) >= MAX_LINE) return 0; // bezpieczniej, ale wolniej
+
+  int seglen=strlen(seg);
+  sprintf(seg+(seglen-1)," %s%s\n",pref,val);
+  return 1;
+}
+
+/**************************************************/
+
+struct Seg
+{
+  int filepos, len;
+  char* tag;
+  char* form;
+  char* aux[MAXAUX];
+  int auxn;
+
+  bool parse(char* line);
+  char* getfield(char* fieldname);
+  void print(char* line);
+  bool addfield(char* s);
+  bool clearfields();
+};
+
+/**************************************************/
+
+/* definicja struktury wejscia/wyjscia
+ */
+struct Segment
+{
+  int filepos, len;
+  char* tag;
+  char* form;
+  char* aux[MAXAUX];
+  int auxn;
+
+  bool parse(char* line);
+  char* getfield(char* fieldname);
+  void print(char* line);
+  bool addfield(char* s);
+  bool clearfields();
+};
+
+/*
+ * Sprawdza czy nalezy przetwarzac dany segment.
+ */
+
+inline
+bool process_seg(Segment& s, gengetopt_args_info& args)
+{
+  bool ret = !args.process_given;
+
+  for(int i=0; i<args.process_given; ++i)
+    if(strcmp(args.process_arg[i],s.tag)==0)
+      {
+        ret=true;
+        break;
+      }
+
+  for(int i=0; i<args.select_given; ++i)
+    if(! s.getfield(args.select_arg[i]))
+      ret=false;
+
+  for(int i=0; i<args.ignore_given; ++i)
+    if(s.getfield(args.ignore_arg[i]))
+      ret=false;
+
+  return ret;
+}
+
+
+/*
+ * FUNKCJE OBSLUGUJACE WEJSCIE/WYJSCIE
+ */
+// napisy zostaj na miejscu (w line), tylko wskazniki sa ustawian
+// i zara dopisywane zera s dopisywane
+
+inline
+bool Segment::parse(char* line)
+{
+  auxn=0;
+  char* field;
+  if((field=strtok(line,FIELD_SEP))!=NULL)
+    filepos=atoi(field); // nie sprawdzana poprawnosc
+  else
+    return false;
+  if((field=strtok(NULL,FIELD_SEP))!=NULL)
+    len=atoi(field); // nie sprawdzana poprawnosc
+  else return false;
+  if((tag=strtok(NULL,FIELD_SEP))==NULL) return false;
+  if((form=strtok(NULL,FIELD_SEP))==NULL)
+    return true;
+  else
+    if(form[0] == EMPTYFORM && form[1] =='\0')
+      form=NULL;
+
+  while((aux[auxn]=strtok(NULL,FIELD_SEP))!=NULL) ++auxn;
+
+  return true;
+}
+
+
+inline char* Segment::getfield(char* f)
+{
+  int flen=strlen(f);
+  if(isalnum(*f))
+  {
+    for(int i=0; i<auxn; ++i)
+      if(strncmp(aux[i],f,flen)==0 && aux[i][flen]==INFIELD_SEP)
+	return aux[i]+flen+1;
+  } else
+  {
+    for(int i=0; i<auxn; ++i)
+    {
+      if(*f==*(aux[i]))
+	return aux[i]+1;
+    }
+  }
+  return NULL;
+}
+
+inline bool Segment::clearfields() {
+  for (int i=0; i<auxn; ++i) {
+    //    free(aux[i]);
+    aux[i] = NULL;
+  }
+  auxn=0;
+  return true;
+}
+
+inline // NIEEFEKTYWNE
+void Segment::print(char* line)
+{
+  sprintf(line,"%04d %02d %s", filepos, len, tag);
+  if(form)
+    {
+      strcat(line," ");
+      strcat(line,form);
+    }
+  else
+    if(auxn)
+      strcat(line," *");
+
+  for(int i=0; i<auxn; ++i)
+    {
+      strcat(line," ");
+      strcat(line,aux[i]);
+    }
+
+  strcat(line,"\n");
+}
+
+
+inline
+bool Segment::addfield(char* s)
+{
+  if(auxn<MAXAUX)
+    {
+      aux[auxn++]=s;
+      return true;
+    }
+  else
+    return false;
+}
+
+/**************************************************
+ * funkcje pomocne w operacjach na plikach        *
+ *  konfiguracyjnych                              *
+ **************************************************/
+
+// sprawdza istnienie pliku
+int file_accessible(const char* path);
+
+// sprawdza istnienie pliku konfiguracyjnego
+int config_file(const char* dir, const char* filename);
+
+/**************************************************/
+
+/* Pobiera wejscie
+ * parametry:
+ * - args - tablica stringow okresnajacych pola wejsciowe
+ * - args_len - rozmiar args
+ * - seg - segment
+ * wartosc - wskaznik do wejscia
+ */
+inline char*  getInput(char** args, int args_len, Segment seg) {
+  char* formp = NULL;
+  for (int i=0; i<args_len; ++i) {
+    if ('4' == args[i][0])
+      return seg.form;
+    if ((formp = seg.getfield(args[i])) != NULL) {
+      return formp;
+    }
+  }
+  return formp;
+}
+
+#endif
Index: _old/app/src/common/main_template.cc
===================================================================
--- _old/app/src/common/main_template.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/common/main_template.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,20 @@
+#include <stdlib.h>
+
+#include "common.h"
+
+main(int argc, char* argv[])
+{
+  gengetopt_args_info args;
+
+  if(cmdline_parser(argc,argv,&args) != 0)
+    exit(1);
+  
+  process_common_options(args);
+
+  //
+  // TU KOD
+  //
+
+  cmdline_parser_free(&args);
+  
+}
Index: _old/app/src/compiledic/Makefile
===================================================================
--- _old/app/src/compiledic/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/compiledic/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,21 @@
+CFLAG1 = -m32 -Wno-deprecated -O3 -fpermissive
+CFLAG_ST = -Wno-deprecated -O3 -fpermissive -static
+
+all: compiledic aut2fsa
+
+compiledic:
+
+
+aut2fsa: aut2fsa.cc
+	#g++ -m32 -Wno-deprecated -O3 -fpermissive -static -o aut2fsa aut2fsa.cc
+	g++ $(CFLAG1) -o aut2fsa aut2fsa.cc
+
+
+copy:
+ifdef UTT_BIN_DIR
+	cp compiledic fsm2aut aut2fsa ${UTT_BIN_DIR}
+endif
+
+clean:
+	rm aut2fsa
+
Index: _old/app/src/compiledic/TODO
===================================================================
--- _old/app/src/compiledic/TODO	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/compiledic/TODO	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,5 @@
+* pliki tymczasowe:
+   - pliki symboli lab i scl
+   - pliki powstajace podczas kompilacji slownika
+
+   gdzie maja byc tworzone? tak jak teraz nie moze byc!
Index: _old/app/src/compiledic/aut2fsa.cc
===================================================================
--- _old/app/src/compiledic/aut2fsa.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/compiledic/aut2fsa.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,18 @@
+
+#include <iostream>
+#include <stdlib.h>
+
+#include "../lib/tfti.h"
+
+#include <fstream>
+
+using namespace std;
+
+int main()
+{
+  TFTiv<char,char> a;
+  a.read();
+  a.save();
+
+  return 0;
+}
Index: _old/app/src/compiledic/compiledic
===================================================================
--- _old/app/src/compiledic/compiledic	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/compiledic/compiledic	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,242 @@
+#! /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 File::Copy;
+use Getopt::Long;
+
+
+my $linesPerFile = 20000;
+
+
+my $systemconfigfile='/usr/local/etc/utt/compiledic.conf';
+my $userconfigfile=home()."/.utt/compiledic.conf";
+
+Getopt::Long::Configure('no_ignore_case_always');
+
+#my $symfile='~/.utt/pl/pl_PL.iso-8859-2.sym';
+my $symbols=0;
+my $help=0;
+
+
+
+#read configuration files###########################
+my $file;
+foreach $file ($systemconfigfile, $userconfigfile){
+  if(open(CONFIG, $file)){
+  	while (<CONFIG>) {
+  		chomp;                  
+      		s/#.*//;                
+	      	s/^\s+//;               
+      		s/\s+$//;               
+    		next unless length;     
+    		my ($name, $value) = split(/\s*=\s*/, $_, 2);
+    		if($name eq "symbols"){
+			$symbols=$value;
+    		}
+   		elsif(($name eq "help")or($name eq "h")){
+			$help=1;
+    		}
+    	
+	} 
+  	close CONFIG;
+  }
+}
+#########################################################
+
+GetOptions("symbols=s" => \$symbols,
+	   "help|h" => \$help);
+
+if($help)
+{
+    print <<'END'
+Usage: compiledic [OPTIONS] dictionaryfile
+
+Options:
+   --help -h                      Help.
+   --symbols=FILE                 Symbol file.
+END
+;
+    exit 0;
+}
+
+##################################################
+
+-f $symbols or die("Symbol file not found.");
+
+@ARGV > 0   or die("Source dictionary not given.");
+
+my $file = shift;
+
+-f $file or die("Source dictionary not found.");
+
+$file =~ /(.*)\.dic/ or die("The input file must have .dic extension.");
+
+my $filenameprefix = $1;
+
+##################################################
+
+# Tworzymy katalog tymczasowy, gdzie wszystko bedzie umieszczane.
+my $tmp_root = File::Temp::tempdir( CLEANUP => 1 );
+
+(undef, my $symfile) = File::Temp::tempfile( DIR => $tmp_root, SUFFIX => ".sym" );
+my $symfilenoext=$symfile;
+$symfilenoext =~ s/\.sym$//;
+my $labfile = $symfilenoext . '.lab';
+my $sclfile = $symfilenoext . '.scl';
+
+copy($symbols, $symfile);
+
+# Przygotowanie etykiet
+
+`lexmakelab $symfilenoext`;
+
+
+# Analiza pliku slownika
+
+print "preparing file...........................................";
+#print "... sed section .....\n";
+(undef, my $file_sed) = File::Temp::tempfile( DIR => $tmp_root, SUFFIX => ".sed" );
+`sed -r "s/([[:punct:]])/\[\\1\]/g" < $file > $file_sed`;
+
+print "OK\n";
+
+#dzielimy plik na wiele czesci, uruchamiamy lexcomplex dla kazdej
+#czesci osobno, nastepnie laczymy to za pomoca programu fsmunion
+
+#print "Dziele slownik na mniejsze czesci...";
+
+open(IN, $file_sed);
+
+my $lineCount = 0;
+my $fileCount = 0;
+
+open(FILE, ">$tmp_root/slo_$fileCount");
+
+while (<IN>) {
+
+    if (++$lineCount >= $linesPerFile) {
+	$fileCount++;
+	$lineCount = 0;
+
+	close(FILE);
+#	print "Tworze nowy plik tymczasowy: slo_".$fileCount."\n";
+	open(FILE, ">$tmp_root/slo_".$fileCount);
+    }
+
+    print(FILE $_);
+}
+
+#print "OK\n";
+
+print "building partial automata";
+
+#32 kropki, fileCount plikow
+my $filesPerDot = $fileCount/32;
+my $files=$filesPerDot;
+my $dots=0;
+
+for (my $i=0; $i<=$fileCount; $i++) {
+
+    if ($files >= $filesPerDot) {
+	$files = 0;
+	print ".";
+	$dots++;
+    }
+    $files++;
+
+    `lexcomplex -l $labfile -S $sclfile < $tmp_root/slo_$i > $tmp_root/slownik_$i.fsm`;
+
+}
+if ($dots < 32) {
+    for (my $i=0; $i<32 - $dots; $i++) {
+	print ".";
+    }
+}
+
+print "OK\n";
+
+unlink <$tmp_root/slo_*>;
+
+print "building final automaton";
+
+#35 kropek...
+my $ndots=33;
+$filesPerDot = $fileCount/$ndots;
+$files=$filesPerDot;
+$dots=0;
+
+copy("$tmp_root/slownik_0.fsm", "$tmp_root/slownik1.fsm");
+
+for (my $i=1; $i<=$fileCount; $i++) {
+
+    if ($files >= $filesPerDot) {
+	$files = 0;
+	print ".";
+	$dots++;
+    }
+    $files++;
+
+    `fsmunion $tmp_root/slownik_$i slownik1.fsm > $tmp_root/slownik2.fsm`;
+
+    move("$tmp_root/slownik2.fsm", "$tmp_root/slownik1.fsm") || die "Unable to move $tmp_root/slownik2.fsm!\n";
+}
+
+if ($dots < $ndots) {
+    for (my $i=0; $i<$ndots - $dots; $i++) {
+	print ".";
+    }
+}
+
+#`fsmunion $tmp_root/* > $tmp_root/slownik1.fsm`;
+
+print "OK\n";
+
+print "removing epsilon-transitions.............................";
+
+`fsmrmepsilon $tmp_root/slownik1.fsm > $tmp_root/slownik2.fsm`;
+
+unlink ("$tmp_root/slownik1.fsm");
+
+print "OK\n";
+
+print "determinizing automaton..................................";
+
+`fsmdeterminize $tmp_root/slownik2.fsm > $tmp_root/slownik1.fsm`;
+
+unlink ("$tmp_root/slownik2.fsm");
+
+print "OK\n";
+
+print "minimizing automaton.....................................";
+
+`fsmminimize $tmp_root/slownik1.fsm > $tmp_root/slownik.fsm`;
+
+#`rm slownik1.fsm`;
+
+print "OK\n";
+
+print "converting fsm format to bin.............................";
+
+`fsmprint -i $labfile $tmp_root/slownik.fsm > $tmp_root/slownik.txt`;
+
+`fsm2aut $tmp_root/slownik.txt > $tmp_root/slownik.aut`;
+
+`aut2fsa < $tmp_root/slownik.aut > $filenameprefix.bin`;
+
+print "OK\n";
+
+print "removing temporary files.................................";
+
+unlink <$tmp_root/*>;
+unlink ($tmp_root);
+
+print "OK\n";
Index: _old/app/src/compiledic/fsm2aut
===================================================================
--- _old/app/src/compiledic/fsm2aut	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/compiledic/fsm2aut	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,44 @@
+#!/usr/bin/perl
+
+my $currstate=-1;
+my @states;
+my @final;
+my $tn=0;
+
+while(<>)
+{
+  if(/^\s*([0-9]+)\s+([0-9]+)\s+(.)(\s*)?$/)
+  {
+    push @{$states[$1]}, ($3, $2);
+    $#states=$2 if $#states<$2;
+    $tn++;
+  }
+  elsif(/^\s*([0-9]+)\s*$/)
+  {
+    $final[$1]=1;
+    $#states=$1 if $#states<$1;
+  }
+  else
+  {
+    die("Input error.");
+  }
+}
+
+print scalar(@states)," ",$tn," char void\n";
+
+my $i=0;
+my $width=int(log(@states+1)/log(10));
+foreach $stateref (@states)
+{
+  $f = ($final[$i]?"+":"-");
+  printf "%${width}d %s",$i++,$f;
+  while(@$stateref)
+  {
+    $c=shift @$stateref;
+    $s=shift @$stateref;
+    print " $c $s";
+  }
+  print "\n";
+}
+
+  
Index: _old/app/src/cor/Makefile
===================================================================
--- _old/app/src/cor/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/cor/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,41 @@
+PAR=-Wno-deprecated -m32 -fpermissive -static
+PAR2=-c -Wno-deprecated -m32 -fpermissive
+LIB_PATH=../lib
+COMMON_PATH=../common
+CMDLINE_FILE='"../cor/cmdline.h"'
+
+
+cor: main.cc corr.o $(LIB_PATH)/word.o \
+	$(LIB_PATH)/auttools.o cmdline.c common_cor.o common.o 
+	g++ $(PAR) -D _CMDLINE_FILE=$(CMDLINE_FILE) main.cc corr.o common.o \
+	$(LIB_PATH)/word.o $(LIB_PATH)/auttools.o cmdline.c common_cor.o \
+	-o cor
+
+corr.o: corr.cc corr.hh
+	g++ $(PAR2) corr.cc
+
+common.o: $(COMMON_PATH)/cmdline_common.ggo $(COMMON_PATH)/common.cc \
+	 $(COMMON_PATH)/common.h
+	g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) $(COMMON_PATH)/common.cc
+
+common_cor.o: cmdline.h common_cor.cc common_cor.h
+	g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) common_cor.cc
+
+cmdline.c cmdline.h: cmdline.ggo
+	gengetopt -i cmdline.ggo --conf-parser
+
+cmdline.ggo: cmdline_cor.ggo $(COMMON_PATH)/cmdline_common.ggo
+	cat cmdline_cor.ggo $(COMMON_PATH)/cmdline_common.ggo > cmdline.ggo
+
+copy:
+ifdef UTT_BIN_DIR
+	cp cor ${UTT_BIN_DIR}
+endif
+
+clean: clean.cmdline
+	rm *.o || true
+	rm cor || true
+
+clean.cmdline:
+	rm cmdline.* || true
+
Index: _old/app/src/cor/cmdline_cor.ggo
===================================================================
--- _old/app/src/cor/cmdline_cor.ggo	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/cor/cmdline_cor.ggo	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,8 @@
+package "cor"
+version "0.1"
+
+option "dictionary-home"	-	"Dictionary home dir." string typestr="FILENAME" no hidden
+option "dictionary"		d	"Dictionary" string typestr="FILENAME" default="cor.bin" no
+option "distance"		n	"Maximal edit distance." int default="1" no
+option "replace"		r	"Replace original form with corrected form, place original form in the cor field. This option has no effect in single mode" flag off hidden
+#option "single"			-	"Place all alternatives in the same line" flag off
Index: _old/app/src/cor/common_cor.cc
===================================================================
--- _old/app/src/cor/common_cor.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/cor/common_cor.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,29 @@
+#include <stdlib.h>
+#include <string.h>
+#include "common_cor.h"
+
+char dictionary[256];
+
+void process_cor_options(gengetopt_args_info* args)
+{
+  if(args->dictionary_given)
+    {
+      expand_path(args->dictionary_arg,dictionary);
+      if(file_accessible(dictionary)!=0)
+	{
+	  fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary);
+	  exit(1);
+	}
+    }
+  else if (args->dictionary_home_given && args->language_given)
+    {
+      char buf[255];
+      expand_path(args->dictionary_home_arg, buf);
+      sprintf(dictionary,"%s/%s/cor.bin",buf,args->language_arg);
+      if(file_accessible(dictionary)!=0)
+	{
+	  fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary);
+	  exit(1);
+	}
+    }
+}
Index: _old/app/src/cor/common_cor.h
===================================================================
--- _old/app/src/cor/common_cor.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/cor/common_cor.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,19 @@
+#ifndef __COMMON_COR_H
+#define __COMMON_COR_H
+
+#include <stdio.h>
+
+//do wyrzucenia - definicja w Makefile! #define _CMDLINE_FILE "../cor/cmdline.h"
+#include "../common/common.h"
+
+#include "cmdline.h"
+
+#define DICT_FILE "cor.bin"
+
+extern int change_count;
+
+extern void process_cor_options(gengetopt_args_info* args);
+
+extern char dictionary[];
+
+#endif
Index: _old/app/src/cor/corr.cc
===================================================================
--- _old/app/src/cor/corr.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/cor/corr.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,142 @@
+//---------------------------------------------------------------------------
+
+#include "corr.hh"
+
+#define MAXPATH 256
+
+#define min(x,y) ((x<y)?(x):(y))
+#define max(x,y) ((x>y)?(x):(y))
+
+
+int Corr::ed(int i,int j)
+{
+  if(i==-1)
+    return j+1;
+  if(j==-1)
+    return i+1;
+  if(i==-2 || j==-2)
+    return n+1;
+
+  if(X[i]==Y[j])
+    return H2[i-1][j-1];
+  if(X[i-1]==Y[j] && X[i]==Y[j-1])
+    return 1+min(H2[i-2][j-2],min(H2[i][j-1],H2[i-1][j]));
+  return 1+min(H2[i-1][j-1],min(H2[i][j-1],H2[i-1][j]));
+
+/*
+  if(X[i]==Y[j])
+    return H[(i-1)+2][(j-1)+2];
+  if(X[i-1]==Y[j] && X[i]==Y[j-1])
+    return 1+min(H[(i-2)+2][(j-2)+2],min(H[(i)+2][(j-1)+2],H[(i-1)+2][(j)+2]));
+  return 1+min(H[(i-1)+2][(j-1)+2],min(H[(i)+2][(j-1)+2],H[(i-1)+2][(j)+2]));
+*/
+}
+
+int Corr::cuted(int j)
+{
+  int l=max(0,j-t);
+  int u=min(m,j+t);
+  int ce=j+t;
+  for(int k=l;k<=u;k++)
+  {
+    if(H2[k][j]<ce)//if(H[(k)+2][(j)+2]<ce)
+      ce=H2[k][j];//ce=H[(k)+2][(j)+2];
+  }
+  return ce;
+}
+
+/*
+void Corr::recomputeH(int j)
+{
+  for(int i=0;i<=m;i++)
+    H[(i)+2][(j)+2]=ed(i,j);
+}
+*/
+
+void Corr::recomputeH(int j)
+{
+  int lo=max(0,j-t-2);
+  int hi=min(m,j+t+2);
+  for(int i=lo;i<=hi;++i)
+    H2[i][j]=ed(i,j);//H[(i)+2][(j)+2]=ed(i,j);
+}
+
+
+int Corr::correct(const char* w, Words& tab)
+{
+  long int path[MAXPATH]={0};
+  int i;                                    // row index (X)
+  int j;                                    // column index (Y)
+  long state=0;
+
+  strcpy(X,w);
+  m=strlen(X)-1;
+  n=m+t;
+
+  for(i=(-2);i<=m;i++)
+    H[(i)+2][(-2)+2]=n;
+  for(i=(-1);i<=m;i++)
+    H[(i)+2][(-1)+2]=(i)+1;
+  for(j=(-2);j<=n;j++)
+    H[(-2)+2][(j)+2]=n;
+  for(j=(-1);j<=n;j++)
+    H[(-1)+2][(j)+2]=(j)+1;
+
+  for(j=0; j<=n; ++j)
+    for(i=0; i<=m; ++i)
+      H[i+2][j+2]=t+1;
+
+  int more=1;
+  bool cont=false;
+
+  strcpy(Y,"");
+  j=0;
+  state=0;
+  int count=0;
+  while(more)
+  {
+    if(!empty(state))
+    {
+      Y[j]=input(state);
+      recomputeH(j);
+      if(cuted(j)<=t)
+      {
+        int edd;
+        if(final(next(state)) && (edd=H[(m)+2][(j)+2])<=t)
+        {
+          char* out=new char[j+2];
+          strncpy(out,Y,j+1);
+          out[j+1]='\0';
+          //          if(cont) putchar(' ');
+          cont=true;
+	  //          printf("%i,%s", edd,out);
+	  //          cout << out << "(" << edd << ")" << endl;
+	  tab.add(out);
+	  count++;
+        }
+        path[j++]=state;
+        state=next(state);
+        continue;
+      }
+      else
+        if(continued(state))
+        {
+          state++;
+          continue;
+        }
+    }
+    //backtracking
+    do
+      if(j>0)
+        j--;
+      else
+        more=0;
+    while(more && !continued(path[j]));
+    state=path[j]+1;
+  }
+  return count;
+}
+
+
+//---------------------------------------------------------------------------
+
Index: _old/app/src/cor/corr.hh
===================================================================
--- _old/app/src/cor/corr.hh	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/cor/corr.hh	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,34 @@
+//---------------------------------------------------------------------------
+#ifndef _corr_hh
+#define _corr_hh
+//---------------------------------------------------------------------------
+
+#include "../lib/tfti.h"
+#include "../lib/word.h"
+
+class Corr : public TFTiv<char,char>
+{
+private:
+  int H[100][100];
+  char X[100];                         // misspelled string
+  char Y[100];                         // (possibly partial) candidate string
+  int m;                               // length of X
+  int n;                               // maximal length of Y
+
+  int ed(int,int);
+  int cuted(int);
+  void recomputeH(int);
+
+public:
+  int (*H2)[100];
+
+  int t;                               // threshold
+
+  Corr() : H2((int(*)[100])&H[2][2]) {};
+  Corr(const char* a) : TFTiv<char,char>(a), H2((int(*)[100])&H[2][2]) { };
+
+  int correct(const char* w, Words& tab);
+};
+
+//---------------------------------------------------------------------------
+#endif
Index: _old/app/src/cor/main.cc
===================================================================
--- _old/app/src/cor/main.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/cor/main.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,155 @@
+#include <stdlib.h>
+#include <ctype.h>
+#include "../lib/iotools.h"
+//do wyrzucenia - definicja w Makefile! #define _CMDLINE_FILE "../cor/cmdline.h"
+#include "../common/common.h"
+#include "common_cor.h"
+#include "corr.hh"
+#include "cmdline.h"
+#include <locale.h>
+
+
+int main(int argc, char** argv) {
+
+//   setlocale(LC_CTYPE,"");
+//   setlocale(LC_COLLATE,"");
+
+  gengetopt_args_info args;
+
+  if(cmdline_parser(argc, argv, &args) != 0)
+    exit(1);
+
+  process_config_files(&args,argv[0]);
+  process_common_options(&args,argv[0]);
+  process_cor_options(&args);
+
+  Corr cor;
+
+  cor.load(dictionary);
+  cor.t=args.distance_arg;
+
+  char line[MAX_LINE+1];
+  long line_count = 0;
+
+  Segment seg;
+  Words tab;
+  char form1[MAX_LINE];
+  char* form;
+  int formcasing;
+  char corfield[MAX_LINE]="";
+
+  while (fgets(line, MAX_LINE, inputf))
+    {
+//       strcpy(outline,line);
+      ++line_count;
+
+//       if(!seg.parse(line))
+//         {
+//           fprintf(stderr,"Input error in line %d.\n",line_count);
+//           exit(1);
+//         }
+
+      char outline[128];
+      //printf("Starting cor... searching for %d fields\n", args.input_field_given);
+      //for (int i=0; i<args.input_field_given; ++i) {
+      //	printf("\t%d. %s\n", i, args.input_field_arg[i]);
+      //}
+
+      if (!process_seg(line, args))
+	fputs(line, outputf);
+      else
+	{
+	  char form[MAX_FORM];
+	  
+	  tab.clear();
+	  getfield(line,input_field_prefix,form);
+	  if (form==NULL) continue;
+	  
+	  formcasing=3;
+	  cor.correct(form, tab);
+	  
+	  if( tab.count() == 0 )
+	    {
+	      formcasing=casing(form);
+	      if( formcasing == 1 || formcasing == 2)
+		tolowers(form, form1), cor.correct(form1, tab);
+	    }
+	  
+	  if ( tab.count() == 0)
+	    fputs(line, failedf);
+	  else 
+	    {
+	      if(args.replace_flag)
+		{
+		  char corfield[128];
+		  strcpy(corfield, input_field_prefix);
+		  strcat(corfield, form);
+		  seg.aux[seg.auxn]=corfield;
+		  ++seg.auxn;
+		  for(int i=0; i<tab.count(); ++i)
+		    {
+		      seg.form=tab[i].form();
+		      restorecasing(seg.form,seg.form,formcasing);
+		      seg.print(outline);
+		      fputs(outline, outputf);
+		    }
+		  --seg.auxn;
+		}
+	      else
+		{
+		  if(one_line)
+		    {
+		      char* p=corfield;
+		      for(int i=0; i<tab.count(); ++i)
+			{
+			  restorecasing(tab[i].form(),tab[i].form(),formcasing);
+			  p += sprintf(p," %s%s",output_field_prefix,tab[i].form());
+			}
+		      sprintf(p,"\n");
+
+		      strcpy(outline,line);
+		      outline[strlen(outline)-1]='\0';
+		      strcat(outline,corfield);
+		      fputs(outline, outputf);
+		    }
+		  else if(one_field)
+		    {
+		      char* p=corfield;
+		      p += sprintf(p," %s",output_field_prefix);
+		      for(int i=0; i<tab.count(); ++i)
+			{
+			  restorecasing(tab[i].form(),tab[i].form(),formcasing);
+			  p += sprintf(p,(i==0)?"%s":";%s",tab[i].form());
+			}
+		      
+		      sprintf(p,"\n");
+
+		      strcpy(outline,line);
+		      outline[strlen(outline)-1]='\0';
+		      strcat(outline,corfield);
+		      fputs(outline, outputf);
+		    }
+		  else
+		    {
+		      for(int i=0; i<tab.count(); ++i)
+			{
+			  restorecasing(tab[i].form(),tab[i].form(),formcasing);
+			  sprintf(corfield," %s%s\n",output_field_prefix,tab[i].form());
+			  strcpy(outline,line);
+			  outline[strlen(outline)-1]='\0';
+			  strcat(outline,corfield);
+			  fputs(outline, outputf);
+			}
+		    }
+		}
+	    }
+	}
+      
+      if(args.interactive_flag)
+	{
+        fflush(outputf);
+        fflush(failedf);
+      }
+    }
+  cmdline_parser_free(&args);
+}
Index: _old/app/src/dgp/Makefile
===================================================================
--- _old/app/src/dgp/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/dgp/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,56 @@
+
+
+SHELL = /bin/sh
+LIB_PATH=../../lib
+COMMON_PATH=../common
+CMDLINE_FILE='"../dgp/cmdline.h"'
+
+
+#vpath %.o  .
+
+CXXFLAGS = -O2 -static
+
+sources = main.cc grammar.cc symbol.cc mgraph.cc sgraph.cc dgp0.cc cmdline.cc \
+          $(COMMON_PATH)/common.cc global.cc
+
+bin  = dgp
+
+# plik *.o sa umieszczane w podkatalogu o
+objs = $(sources:%.cc=%.o)
+
+${bin}: ${objs}
+	${CXX} ${CXXFLAGS} -D _CMDLINE_FILE=$(CMDLINE_FILE) -o $@ ${objs}
+
+include $(sources:.cc=.d)
+
+%.o: %.cc
+	${CXX} -D _CMDLINE_FILE=$(CMDLINE_FILE) -c ${CXXFLAGS} -o $@ $<
+
+%.d: %.cc
+	$(CC) -MM $(CPPFLAGS) -D _CMDLINE_FILE=$(CMDLINE_FILE) $< > $@.$$$$; \
+	sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
+	rm -f $@.$$$$
+
+# stare:
+# cmdline.cc cmdline.h : cmdline.ggo
+# 	gengetopt --c-extension=cc -i cmdline.ggo
+# nowe
+cmdline.cc cmdline.h: cmdline.ggo
+	gengetopt -i cmdline.ggo  --c-extension=cc --conf-parser
+
+cmdline.ggo: cmdline_dgp.ggo ../common/cmdline_common.ggo
+	cat cmdline_dgp.ggo ../common/cmdline_common.ggo > cmdline.ggo
+# endnowe
+
+
+clean:
+	rm ${bin} ${objs} cmdline.cc cmdline.h
+	rm -rf *.d
+
+prof: dgp
+	gprof dgp ~/tmp/dgp-pl/gmon.out > dgp.prof
+
+copy:
+ifdef UTT_BIN_DIR
+	cp dgp dgc canonize tre $(UTT_BIN_DIR)/
+endif
Index: _old/app/src/dgp/Makefile.user
===================================================================
--- _old/app/src/dgp/Makefile.user	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/dgp/Makefile.user	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,3 @@
+
+gram.dgp: gram.dgc
+	dgc -c cats.dgc < gram.dgc > gram.dgp
Index: _old/app/src/dgp/canonize
===================================================================
--- _old/app/src/dgp/canonize	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/dgp/canonize	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,50 @@
+#!/usr/bin/perl
+
+#package:	UAM TExt Tools
+#component:	canonize
+#version:	1.0
+#author:	Tomasz Obrebski
+
+use lib "/usr/local/lib/utt";
+use lib "$ENV{'HOME'}/.local/lib/utt";
+
+use strict;
+use Getopt::Long;
+use attr;
+
+
+my $help;
+
+GetOptions("help|h" => \$help);
+
+if($help)
+{
+    print <<'END'
+
+Transforms syntactic categories to their canonical form.
+
+Usage: canonize
+
+Options:
+   --help -h			Help.
+
+END
+;
+    exit 0;
+}
+
+#$|=1;
+
+my %tra;
+
+while(<>)
+{
+    s/$attr::pos_re\/$attr::avlist_re/trans($&)/ge;
+    print;
+}
+
+sub trans
+{
+    my $cat=shift;
+    exists($tra{$cat}) ? $tra{$cat} : ( $tra{$cat} = attr::canonize $cat );
+}
Index: _old/app/src/dgp/cmdline_dgp.ggo
===================================================================
--- _old/app/src/dgp/cmdline_dgp.ggo	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/dgp/cmdline_dgp.ggo	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,18 @@
+package "dgp"
+version "0.1"
+
+option	"grammar"	g	"Grammar file"
+				string no typestr="filename"
+
+option  "long"		l	"Long output"
+				flag off
+
+option  "debug"		d	"Debug mode."
+				flag off
+
+option	"info"		-	"Print info. 
+h - heads         d - dependents
+s - sets
+c - constraints	  n - node/arc counts	t - parse time
+"
+string no default="h"
Index: _old/app/src/dgp/const.hh
===================================================================
--- _old/app/src/dgp/const.hh	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/dgp/const.hh	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,13 @@
+#ifndef CONST_HH
+#define CONST_HH
+
+#define MAXTYPES 32
+#define MAXFLAGS 64
+#define MAXNODES 1024
+#define MAXCONSTRS 32
+#define MAXLINE 256
+#define MAXFORMLEN 64
+#define MAXDESCRLEN 80
+#define FIELDSEP " \n\t"
+
+#endif
Index: _old/app/src/dgp/dgc
===================================================================
--- _old/app/src/dgp/dgc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/dgp/dgc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,292 @@
+#!/usr/bin/perl
+
+#package:	UAM Text Tools
+#component:	dgc (dg compiler)
+#version:	1.0
+#author:	Tomasz Obrebski
+
+# wymaga niejawnie programu canonize!!!!
+use lib "/usr/local/lib/utt";
+use lib "$ENV{'HOME'}/.local/lib/utt";
+
+use strict;
+use Getopt::Long;
+use Data::Dumper;
+use attr;
+use File::HomeDir;
+
+my $systemconfigfile='/usr/local/etc/utt/dgc.conf';
+my $userconfigfile=home()."/.utt/dgc.conf";
+
+Getopt::Long::Configure('no_ignore_case_always');
+
+my $help=0;
+my $catfile=0;
+my $dicfile=0;
+my $gramfile=0;
+my $outputfile=0;
+
+#read configuration files###########################
+my $file;
+foreach $file ($systemconfigfile, $userconfigfile){
+  if(open(CONFIG, $file)){
+        while (<CONFIG>) {
+                chomp;
+                s/#.*//;
+                s/^\s+//;
+                s/\s+$//;
+                next unless length;
+                my ($name, $value) = split(/\s*=\s*/, $_, 2);
+                if(($name eq "categories")or($name eq "c")){
+                        $catfile=$value;
+                }
+                elsif(($name eq "dictionary")or($name eq "d")){
+                        $dicfile=$value;
+                }
+                elsif(($name eq "grammar")or($name eq "g")){
+                        $gramfile=$value;
+                }
+                elsif(($name eq "outputfile")or($name eq "o")){
+                        $outputfile=$value;
+                }
+                elsif(($name eq "help")or($name eq "h")){
+                        $help=1;
+                }
+
+        }
+        close CONFIG;
+  }
+}
+#########################################################
+
+GetOptions("help|h" => \$help,
+	   "categories|c=s" => \$catfile,
+	   "dictionary|d=s" => \$dicfile,
+	   "grammar|g=s" => \$gramfile,
+	   "outputfile|o=s" => \$outputfile);
+
+my $homedir = $ENV{'HOME'};
+$catfile =~ s/~/$homedir/;
+$dicfile =~ s/~/$homedir/;
+$gramfile =~ s/~/$homedir/;
+$outputfile =~ s/~/$homedir/;
+
+
+if($help)
+{
+    print <<'END'
+Usage: dgc [OPTIONS]
+
+Options:
+   --categories -c filename	List of syntactic categories.
+   --dictionary -d filename     Dictionary.
+   --grammar -g filename	List of grammar rules.
+   --outputfile -o filename	Output file name.
+   --help -h			Help.
+END
+;
+    exit 0;
+}
+
+die("At least one of --cats and --dic must be given.\n") if !$catfile && !$dicfile;
+
+my $ncat=0;
+my $nrole=0;
+my $nsgl=0;
+my $nleft=0;
+my $nright=0;
+my $nreq=0;
+my $nlink=0;
+my $nflag=0;
+
+my %cats;
+my %roles;
+my %agr;
+my %gov;
+
+if(!$outputfile) {
+	*OUTPUT = *STDOUT;
+}
+elsif($outputfile eq "-") {
+    *OUTPUT = *STDOUT;
+}
+else {
+	open(OUTPUT, ">$outputfile") or die("Can't open output file: $outputfile!");
+}
+
+
+loadcats($catfile) if $catfile;
+extractcats($dicfile) if $dicfile;
+
+
+my $cats_re = qr/(?:$attr::cat_re\s*(?:,\s*$attr::cat_re)*)/;
+
+# class parse_class:
+# /$attr::cat_re/g;
+
+
+if(!$gramfile) { 
+	*INPUT = *STDIN;
+}
+elsif($gramfile eq "-"){
+    *INPUT = *STDIN;
+}
+else {
+	open(INPUT, $gramfile) or die("Unable to open: $gramfile!");
+}
+
+while(<INPUT>)
+{
+    s/#.*//;
+    s/^\s+//;
+    s/\s+$//;
+    if(/^AGR\s+(\S+)\s+(\S+)$/)
+    {
+	push @{$agr{$1}}, $2;
+    }
+    elsif(/^GOV\s+(\S+)\s+(\S+)$/)
+    {
+	push @{$gov{$1}}, attr::parse($2);
+    }
+    elsif(/^ROLE\s+\S+$/)
+    {
+	$roles{$_}=1;
+	print OUTPUT "$_\n";
+    }
+    elsif(/^SGL\s+\S+$/)
+    {
+	++$nsgl;
+	print OUTPUT "$_\n";
+    }
+    elsif(/^REQ\s+(\S+)\s+(\S+)$/)
+    {
+	print OUTPUT "#$_\n";
+	my $cat = attr::parse $1;
+	for my $atomcat (keys %cats)
+	{
+	    if(attr::match @$cat, @{$cats{$atomcat}})
+	    {
+		print OUTPUT "REQ ".$atomcat." $2\n";
+		++$nreq;
+	    }
+	}
+    }
+    elsif(/^LEFT\s+\S+$/)
+    {
+	++$nleft;
+	print OUTPUT "$_\n";
+    }
+    elsif(/^RIGHT\s+\S+$/)
+    {
+	++$nright;
+	print OUTPUT "$_\n";
+    }
+    elsif(my ($hs,$ds,$r) = /^LINK\s+($cats_re)\s+($cats_re)\s+(\S+)$/)
+    {
+	print OUTPUT "#$_\n";
+	for my $h ($hs =~ /$attr::cat_re/g)
+	{
+	    for my $d ($ds =~ /$attr::cat_re/g)
+	    {
+		addlinks($h,$d,$r);
+	    }
+	}
+    }
+    elsif(/^FLAG\s+\S+$/)
+    {
+	++$nflag;
+	print OUTPUT "$_\n"
+    }
+    elsif(/^$/) {
+	# pomijamy puste linie oraz komentarze
+	}
+	else
+    {
+	print STDERR "Illegal format: $_\n";
+    }
+}
+
+
+sub addlinks
+{
+    my ($h,$d,$r) = @_;
+
+    for my $a (@{$agr{$r}}) { print OUTPUT "#AGR $r $a\n"; }
+    for my $c (@{$gov{$r}}) { print OUTPUT "#GOV $r ".attr::unparse(@$c)."\n"; }
+    my $head = attr::parse $h;
+    my $dep = attr::parse $d;
+    
+    for my $atomhead (keys %cats)
+    {
+	if(attr::match @$head, @{$cats{$atomhead}})
+	{
+	  DEP:
+	    for my $atomdep (keys %cats)
+	    {
+		next DEP if ! attr::match @$dep, @{$cats{$atomdep}};
+		
+		for my $a (@{$agr{$r}})
+		{
+		    next DEP if ! attr::agree(@{$cats{$atomhead}},@{$cats{$atomdep}},$a);
+		}
+		
+		for my $c (@{$gov{$r}})
+		{
+		    next DEP if ! attr::match(@$c,@{$cats{$atomdep}});
+		}
+		
+		print OUTPUT "LINK ";
+		print OUTPUT $atomhead." ";
+		print OUTPUT $atomdep." $r\n";
+		++$nlink;
+		
+	    }
+	}
+    }
+}
+
+
+printf STDERR "%6d CAT   statements\n", 0+keys(%cats);
+printf STDERR "%6d ROLE  statements\n", 0+keys(%roles);
+printf STDERR "%6d SGL   statements\n", $nsgl;
+printf STDERR "%6d REQ   statements\n", $nreq;
+printf STDERR "%6d LEFT  statements\n", $nleft;
+printf STDERR "%6d RIGHT statements\n", $nright;
+printf STDERR "%6d LINK  statements\n", $nlink;
+printf STDERR "%6d FLAG  statements\n", $nflag;
+
+
+sub extractcats
+{
+    my $file = shift;
+    open DICFILE, "canonize $file |";
+    while(<DICFILE>)
+    {
+	while(/,([^[:space:];]+)/g)
+	{
+	    my $cat=$1;
+	    next if !$cat || exists $cats{$cat};
+	    $ncat++;
+	    print OUTPUT "CAT $1\n";
+	    $cats{$cat}=attr::parse($cat);
+	}
+    }
+    close DICFILE;
+}
+
+
+sub loadcats
+{
+    my $file = shift;
+    open CATFILE, "canonize $file |";
+    while(<CATFILE>)
+    {
+	tr/ \t\n//d;
+	next if !$_ || exists $cats{$_};
+	print OUTPUT "CAT $_\n";
+	++$ncat;
+	$cats{$_}=attr::parse($_);
+    }
+    close CATFILE;
+}
+
Index: _old/app/src/dgp/dgp0.cc
===================================================================
--- _old/app/src/dgp/dgp0.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/dgp/dgp0.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,217 @@
+#include "dgp0.hh"
+#include "global.hh"
+
+extern Grammar grammar;
+extern MGraph mgraph;
+extern SGraph sgraph;
+
+SNode* snodes;
+
+extern bool debug;
+
+list<int> nodelist;
+list<int>::iterator processed;
+
+
+void set_initial_constraints(int node)
+{
+  snodes[node].prop.forbidden.reset();
+  snodes[node].prop.required=grammar.obl[snodes[node].mnode->cat];
+}
+
+
+bool changing_constraints(int head, Role role)
+{
+  return grammar.sgl[role] || snodes[head].prop.required[role];
+}
+
+void apply_constraints(int head, Role role)
+{
+  if(grammar.sgl[role]) snodes[head].prop.forbidden.set(role);
+  snodes[head].prop.required.reset(role);
+}
+
+NodeProp compute_prop_left(NodeProp headprop, Role role)
+{
+  NodeProp ret=headprop;
+  if(grammar.sgl[role]) ret.forbidden.set(role);
+  ret.required.reset(role);
+  return ret;
+}
+
+NodeProp compute_prop_right(NodeProp headprop, Role role)
+{
+  NodeProp ret=headprop;
+
+  if(grammar.sgl[role]) ret.forbidden.set(role);
+  ret.required.reset(role);
+  return ret;
+}
+
+int get_node(MNode& mnode, NodeProp p, bitset<MAXNODES>& newheadLH, bitset<MAXNODES>& newheadLV)
+{
+  for(vector<int>::iterator ps=mnode.snodes.begin(); ps!=mnode.snodes.end(); ++ps)
+    if(snodes[*ps].prop==p && snodes[*ps].LH==newheadLH && snodes[*ps].LV==newheadLV)
+      return *ps;
+  return -1;
+}
+
+void connect_left(list<int>::iterator h, list<int>::iterator d, Role r)
+{
+  NodeProp &oldheadprop = snodes[*h].prop;
+  NodeProp newheadprop;
+  bitset<MAXNODES> newheadLV;
+  bitset<MAXNODES> newheadLH;
+  bitset<MAXNODES> newheadLD;
+  
+  newheadprop=compute_prop_left(oldheadprop,r);
+  
+  int newheadind;
+  if(oldheadprop==newheadprop)
+    newheadind = *h;
+  else
+  {
+    newheadLH = snodes[*h].LH;
+    newheadLV = snodes[*d].LV;
+    newheadLD = snodes[*h].LD;
+
+    newheadind = get_node(*(snodes[*h].mnode), newheadprop, newheadLH, newheadLV);
+    if( newheadind < 0 )
+    {
+      newheadind = sgraph.clone(*h,newheadprop);
+      list<int>::iterator nextit=h; ++nextit;
+      nodelist.insert(nextit,newheadind);
+      snodes[newheadind].LH=newheadLH;
+      snodes[newheadind].in_LH=true;
+      snodes[newheadind].LV.reset();
+      snodes[newheadind].LD = newheadLD;
+      
+      if(debug) sgraph.print_node_debug(stderr," C ",newheadind);
+    }
+    else
+      snodes[newheadind].LD |= newheadLD; // TYLKO DLA LD
+  }
+
+  snodes[newheadind].deps.push_back(Arc(*d,r,*h));
+  
+  if(snodes[*d].saturated()) snodes[newheadind].LV |= snodes[*d].LV;
+  snodes[newheadind].LD.set(*d);
+  if(snodes[*d].saturated()) snodes[newheadind].LD |= snodes[*d].LD;
+  
+  if(debug)
+    sgraph.print_arc(stderr,*d,newheadind,r,0), sgraph.print_node_debug(stderr," U ",newheadind);
+}
+
+
+void connect_right(list<int>::iterator h, list<int>::iterator d, Role r)
+{
+  NodeProp &oldheadprop = snodes[*h].prop;
+  NodeProp newheadprop;
+  bitset<MAXNODES> newheadLV;
+  bitset<MAXNODES> newheadLH;
+  bitset<MAXNODES> newheadLD;
+  int newheadind;
+  
+  newheadprop = compute_prop_right(oldheadprop,r);
+  if(oldheadprop==newheadprop)
+    newheadind = *h;
+  else
+  {
+    newheadLH = snodes[*h].LH;
+    newheadLV = snodes[*h].LV;
+    newheadLD = snodes[*h].LD;
+
+    newheadind = get_node(*(snodes[*h].mnode), newheadprop, newheadLH, newheadLV);
+    if( newheadind < 0 )
+    {
+      newheadind = sgraph.clone(*h,newheadprop);
+      snodes[newheadind].LH=newheadLH;
+      snodes[newheadind].in_LH=false;
+      snodes[newheadind].LV=newheadLV;
+      snodes[newheadind].LD=newheadLD;
+      list<int>::iterator nextit=h; ++nextit;
+      nodelist.insert(nextit,newheadind);
+      
+      if(debug) sgraph.print_node_debug(stderr," C ",newheadind);
+    }
+    else
+      snodes[newheadind].LD |= newheadLD; // TYLKO DLA LD
+  }
+  
+  snodes[*d].heads.push_back(Arc(newheadind,r,*h));
+
+  snodes[*d].LH.set(newheadind);
+
+  if(snodes[newheadind].saturated()) snodes[*d].LH |= snodes[newheadind].LH;
+
+  if(debug)
+    sgraph.print_arc(stderr,newheadind,*d,r,1), sgraph.print_node_debug(stderr," U ",*d);
+  
+}
+
+
+void try_connect_dependents(list<int>::iterator j)
+{
+  for(list<int>::iterator i(j); i!=nodelist.begin(); --i)
+    if(sgraph.visible(*i,*j) && sgraph.saturated(*i))
+    {
+      Roles& ji_roles = grammar.connect[snodes[*j].mnode->cat][snodes[*i].mnode->cat];
+      for(RolesIter r=ji_roles.begin(); r!=ji_roles.end();++r)
+        if(grammar.check_constr(snodes[*j].prop,snodes[*i].prop,0,*r))
+          connect_left(j,i,*r);
+    }
+}
+
+
+void try_connect_heads(list<int>::iterator j)
+{
+  for(list<int>::iterator i(j); i!=nodelist.begin(); --i)
+    if(sgraph.visible(*i,*j))
+    {
+      Roles& ij_roles = grammar.connect[snodes[*i].mnode->cat][snodes[*j].mnode->cat];
+      for(RolesIter r=ij_roles.begin(); r!=ij_roles.end();++r)
+        if(grammar.check_constr(snodes[*i].prop,snodes[*j].prop,1,*r))
+          connect_right(i,j,*r);
+    }
+}
+
+
+void reverse_links()
+{
+  list<int>::iterator i = nodelist.begin();
+  for(++i; i!=nodelist.end(); ++i)
+    {
+      for(vector<Arc>::iterator da=sgraph.nodes[*i].deps.begin()--; da!=sgraph.nodes[*i].deps.end(); ++da)
+        sgraph.nodes[da->dst].heads.push_back(Arc(*i,da->role,da->anc));
+      for(vector<Arc>::iterator ha=sgraph.nodes[*i].heads.begin(); ha!=sgraph.nodes[*i].heads.end(); ++ha)
+        sgraph.nodes[ha->dst].deps.push_back(Arc(*i,ha->role,ha->anc));
+    }
+}
+
+
+void dgp0()
+{
+  snodes=sgraph.nodes;
+
+  nodelist.clear();
+  nodelist.push_back(0); // BOS
+  processed=nodelist.begin();
+
+  for(int m=0; m<mgraph.n ; ++m)
+  {
+    int basenode = sgraph.add_base_snode(mgraph.nodes+m); // ma zwracaæ SNode*
+    set_initial_constraints(basenode);
+    nodelist.push_back(basenode);
+
+    if(debug) {sgraph.print_node_debug(stderr,"B  ",basenode);} // STDOUT!!!
+
+    list<int>::iterator cursor=processed;
+    while(++cursor != nodelist.end())
+    {
+      try_connect_dependents(cursor);
+      try_connect_heads(cursor);
+      processed=cursor;
+    }
+  }
+  reverse_links();
+}
Index: _old/app/src/dgp/dgp0.hh
===================================================================
--- _old/app/src/dgp/dgp0.hh	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/dgp/dgp0.hh	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,12 @@
+#ifndef _DGP0_HH
+#define _DGP0_HH
+
+#include "grammar.hh"
+#include "sgraph.hh"
+#include "mgraph.hh"
+
+// API
+
+void dgp0();
+
+#endif
Index: _old/app/src/dgp/global.cc
===================================================================
--- _old/app/src/dgp/global.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/dgp/global.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,5 @@
+
+#include "global.hh"
+
+bool debug = false;
+
Index: _old/app/src/dgp/global.hh
===================================================================
--- _old/app/src/dgp/global.hh	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/dgp/global.hh	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,1 @@
+extern bool debug;
Index: _old/app/src/dgp/go
===================================================================
--- _old/app/src/dgp/go	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/dgp/go	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,13 @@
+if test -f Makefile.go; 
+then
+	make -f Makefile.go gram.dgp;
+	tok |\
+	lem -p W |\
+	canonize |\
+	sen |\
+	gph -p W -p BOS -p EOS -r BOS |\
+	dgp -i ds -p W -p BOS -p EOS -g gram.dgp
+else 
+	echo "Invalid configuration! Run utt_make_config.pl first."
+fi
+
Index: _old/app/src/dgp/grammar.cc
===================================================================
--- _old/app/src/dgp/grammar.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/dgp/grammar.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,181 @@
+
+#include <stdio.h>
+
+#include "grammar.hh"
+
+bool (*constraint[MAXCONSTRS])(int head, int dep);
+
+
+int chk_type(const char* s, int lineno) // SIDE EFECTS!
+{
+  if(Role::index(s)>0) return 1;
+
+  fprintf(stderr,"%8d: Invalid type '%s'. Line ignored.\n",lineno,s);
+  return 0;
+}
+
+int chk_cat(const char* s, int lineno)
+{
+  if(Cat::index(s)>0) return 1;
+
+  fprintf(stderr,"%8d: Invalid category '%s'. Line ignored.\n",lineno,s);
+  return 0;
+}
+
+void Grammar::add_category(const char* s)
+{
+  Cat::add(s);
+  if(Cat::count()>cats_sz)
+  {
+    cats_sz += 16;
+    connect.resize(cats_sz);
+    for(int i=0; i<cats_sz; ++i)
+      connect[i].resize(cats_sz);
+    obl.resize(cats_sz);
+  }
+}
+
+void Grammar::add_type(const char* s)
+{  
+  Role::add(s);
+  if(Role::count()>types_sz)
+  {
+    types_sz += 16;
+    lt.resize(types_sz);
+    gt.resize(types_sz);
+  }
+}
+
+void Grammar::add_flag(const char* s)
+{  
+  Flag::add(s);
+  if(Flag::count()>flags_sz)
+  {
+    flags_sz += 16;
+    pass.resize(flags_sz);
+  }
+}
+
+
+void Grammar::set_lt(Role s, Role t)
+{
+  lt[s].set(t);
+  gt[t].set(s);
+  if(s==0||(int)t==0)
+    return;
+  else
+  {
+    for(int i=0; i<Role::count(); ++i)
+      if(lt[i][s])
+	set_lt(i,t);
+    for(int i=0; i<Role::count(); ++i)
+      if(lt[t][i])
+	set_lt(s,i);
+  }
+}  
+
+
+void Grammar::compute_gt()
+{
+  for(Role s=0; s<Role::count(); ++s)
+    for(Role t=0; t<Role::count(); ++t)
+      if(lt[s][t])
+	gt[t].set(s);
+}
+
+
+bool Grammar::read(FILE* f)
+{
+  int lineno=0;
+  char line[MAXLINE]; // line has the structure: key [arg1 [arg2 [arg3]]]
+  char key[MAXLINE];
+  char arg1[MAXLINE];
+  char arg2[MAXLINE];
+  char arg3[MAXLINE];
+
+  while(fgets(line,MAXLINE,f))
+  {
+    lineno++;
+    int fields=sscanf(line,"%s %s %s %s",key,arg1,arg2,arg3);
+
+    if(fields<1 || key[0]=='#') continue; // skip empty lines and comments
+
+    if     (strcmp(key,"CAT")==0 && fields>=2)
+    {
+      add_category(arg1);
+    }
+    else if(strcmp(key,"ROLE")==0 && fields>=2)
+    {
+      add_type(arg1);
+    }
+    else if(strcmp(key,"SGL")==0 && fields>=2)
+    {  
+      if(chk_type(arg1,lineno))
+        set_sgl(arg1);
+    }
+    else if(strcmp(key,"LEFT")==0 && fields>=2)
+    { 
+      if(chk_type(arg1,lineno))
+        set_left(arg1);
+    }
+    else if(strcmp(key,"RIGHT")==0 && fields>=2)
+    {
+      if(chk_type(arg1,lineno))
+        set_right(arg1);
+    }
+    else if(strcmp(key,"REQ")==0 && fields>=3)
+    {
+      if(chk_cat(arg1,lineno) + chk_type(arg2,lineno) == 2)
+        set_obl(arg1,arg2);
+    }
+    else if(strcmp(key,"LINK")==0 && fields>=4)
+    { 
+      if(chk_cat(arg1,lineno) + chk_cat(arg2,lineno) + chk_type(arg3,lineno) == 3)    
+        set_connect(arg1,arg2,arg3);
+    }
+    // FLAG DECLARATION
+    else if(strcmp(key,"FLAG")==0 && fields>=2)
+    { 
+      add_flag(arg1);
+    }
+
+    else fprintf(stderr,"Invalid line %d. Ignored.\n", lineno);
+  }
+
+//   compute_gt();
+
+  return true;
+  
+}
+
+void Grammar::write(FILE* f)
+{
+  for(Cat i=1; i<Cat::count(); ++i)
+    fprintf(f,"CAT\t%s\n",i.str());
+
+  for(Role i=1; i<Role::count(); ++i)
+    fprintf(f,"ROLE\t%s\n",i.str());
+
+  for(Role i=1; i<Role::count(); ++i)
+    if(sgl.test(i)) fprintf(f,"SGL\t%s\n",i.str());
+  
+  for(Role i=1; i<Role::count(); ++i)
+    if(left.test(i)) fprintf(f,"LEFT\t%s\n",i.str());
+
+  for(Role i=1; i<Role::count(); ++i)
+    if(right.test(i)) fprintf(f,"RIGHT\t%s\n",i.str());
+
+  for(Cat c=1; c<Cat::count(); ++c)
+    for(Role r=1; r<Role::count(); ++r)
+      if(obl[c].test(r)) fprintf(f,"REQ\t%s\t%s\n",c.str(),r.str());
+  
+  for(Cat c=1; c<Cat::count(); ++c)
+    for(Cat d=1; d<Cat::count(); ++d)
+      for(Role t=1; t<Role::count(); ++t)
+	if(connect[c][d].count(t))
+          fprintf(f,"LINK\t%s\t%s\t%s\n",c.str(),d.str(),t.str());
+
+  for(Flag i=1; i<Flag::count(); ++i)
+    fprintf(f,"FLAG\t%s\n",i.str());
+}
+
Index: _old/app/src/dgp/grammar.hh
===================================================================
--- _old/app/src/dgp/grammar.hh	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/dgp/grammar.hh	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,81 @@
+#ifndef _GRAMMAR_HH
+#define _GRAMMAR_HH
+
+#include <bitset>
+#include <vector>
+#include <list>
+#include <set>
+
+#include "const.hh"
+#include "thesymbols.hh"
+#include "sgraph.hh"
+
+
+using namespace std;
+
+class Link
+{
+  Role role;
+  FlagSet hflags;
+  FlagSet dflags;
+};
+
+
+class Grammar
+{
+
+ public:
+
+  //  enum CONSTR { SGL, OBL, LEFT, RIGHT, INIT, NONINIT, FIN, NONFIN };
+
+  Grammar() : types_sz(0), cats_sz(0), flags_sz(0) {} ;
+  
+  int types_sz;
+  int cats_sz;
+  int flags_sz;
+
+  vector< vector< Roles > >    connect;
+  RoleSet                      sgl;
+  vector< RoleSet >            obl;
+  RoleSet                      left;
+  RoleSet                      right;
+  vector< RoleSet >            lt;
+  vector< RoleSet >            gt;
+
+
+  //  vector< vector< vector<
+  vector< FlagSet >            set;
+  vector< FlagSet >            pass;
+
+  bool read(FILE* f);
+  void write(FILE* f);
+
+  void add_category(const char* s);
+  void add_type(const char* s);
+  void add_flag(const char* s);
+
+  void set_sgl(Role r)           { sgl.set(r); }
+  void set_obl(Cat c, Role r)    { obl[c].set(r); }
+  void set_left(Role r)          { left.set(r); }
+  void set_right(Role r)         { right.set(r); }
+  void set_order(Role r, Role s) { lt[s].set(r); }
+  void set_connect(Cat c, Cat d, Role r)   { connect[c][d].insert(r); }
+  void set_lt(Role r, Role s);
+  void compute_gt();
+
+
+  bool check_constr(NodeProp& hprop, NodeProp& dprop, int dir, Role role);
+
+};
+
+inline bool Grammar::check_constr(NodeProp& hprop, NodeProp& dprop, int dir, Role role)
+{
+  return 
+    !hprop.forbidden[role] &&
+    ( !right[role] || dir==1 ) &&
+    ( !left[role] || dir==0 )
+    ;
+}
+
+
+#endif
Index: _old/app/src/dgp/main.cc
===================================================================
--- _old/app/src/dgp/main.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/dgp/main.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,121 @@
+
+/**
+ * Package:	UAM Text Tools
+ * Component:	dgp (dg parser)
+ * Version:	1.0
+ * Author:	Tomasz Obrebski
+ */
+
+#include "global.hh"
+#include "mgraph.hh"
+#include "sgraph.hh"
+#include "grammar.hh"
+#include "dgp0.hh"
+#include "../common/common.h"
+#include "cmdline.h"
+
+#define MAXSEGMENTS 500
+
+char segment[MAXSEGMENTS][MAXLINE];
+int segcount=0;
+char seg_mnode[MAXSEGMENTS];
+char grammarfile[255];
+
+
+Grammar grammar;
+MGraph mgraph;
+SGraph sgraph;
+
+FILE* grammarf;
+FILE* debugf=stdout;
+unsigned int info=0U;
+
+void output();
+
+main(int argc, char* argv[])
+{
+  gengetopt_args_info args;
+
+  if(cmdline_parser(argc,argv,&args) != 0)
+    exit(1);
+
+  process_config_files(&args,argv[0]);
+  process_common_options(&args,argv[0]);
+
+  if(!args.grammar_given)
+    fprintf(stderr,"dgp: no grammar given\n");
+
+  expand_path(args.grammar_arg,grammarfile);
+
+  if(!(grammarf=fopen(grammarfile,"r")))
+    fprintf(stderr,"dgp: grammar file not found: %s.\n", grammarfile), exit(1);
+
+  if(args.debug_given) debug=true;
+
+  for(char* c=args.info_arg; *c!='\0' ; ++c)
+    switch(*c)
+    {
+    case 'h': info|=SGraph::HEADS; break;
+    case 'd': info|=SGraph::DEPS; break;
+    case 's': info|=SGraph::SETS; break;
+    case 'c': info|=SGraph::CONSTRAINTS; break;
+    }
+
+  grammar.read(grammarf);
+  fclose(grammarf);
+
+  mgraph.clear();
+  sgraph.clear();
+
+  char line[1000];
+  while (fgets(line, MAXLINE+1, inputf))
+  {
+    line[strlen(line)-1] = '\0';
+    strcpy(segment[segcount],line);
+
+    char segtype[80];
+
+    seg_mnode[segcount] = process_seg(line, args) ? mgraph.add_node(line) : -1;
+
+    segcount++;
+
+    getfield(line,"3",segtype);
+    if(strcmp(segtype,"EOS")==0)
+    {
+      dgp0(); // parametry!!! MGraph, SGraph, Grammar
+      output();
+      
+      mgraph.clear();
+      sgraph.clear();
+      segcount=0;
+    }
+    //    if(args.interactive_flag) { fflush(outputf); fflush(failedf); }
+  }
+  
+  fclose(inputf);
+  fclose(outputf);
+  cmdline_parser_free(&args);
+  exit(0);
+}
+
+void output()
+{
+  for(int si=0; si<segcount; ++si)
+  {
+    if(seg_mnode[si]>=0)
+    {
+      MNode& m=mgraph.nodes[seg_mnode[si]];
+      for(vector<int>::iterator s=m.snodes.begin(); s!=m.snodes.end(); ++s)
+      {
+        fputs(segment[si],outputf);
+        sgraph.print_node(outputf, *s, info);
+        fputc('\n',outputf);
+      }
+    }
+    else
+    {
+      fputs(segment[si],outputf);
+      fputc('\n',outputf);
+    }
+  }
+}
Index: _old/app/src/dgp/mgraph.cc
===================================================================
--- _old/app/src/dgp/mgraph.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/dgp/mgraph.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,54 @@
+
+#include "mgraph.hh"
+#include "thesymbols.hh"
+#include "const.hh"
+
+#include <stdio.h>
+
+int MGraph::add_node(char* seg)
+{
+  nodes[n].clear();
+  
+  char field1[80], field3[80], descr[256], gph[256];
+  char* cat;
+  
+  getfield(seg,"1",field1);
+  nodes[n].pos=atoi(field1);
+
+  getfield(seg,"3",field3);
+  if(!getfield(seg,"lem",descr)) strcpy(descr,"?,?");
+
+  cat=descr;
+  while(*cat!=',' && *cat ) ++cat;
+  if(*cat) ++cat;
+  
+//  Cat::add(cat);
+  if(Cat::index(cat)>0)
+    nodes[n].cat=cat;
+  else
+    nodes[n].cat="NULL";
+  
+  nodes[n].pred.clear();
+  
+  char* tok;
+  int previd;
+  
+  if(!getfield(seg,"gph",gph))
+  {
+    fprintf(stderr,"No gph field. Aborting (sorry).\n");
+    exit(1);
+  }
+
+  char* ids=strtok(gph,":");
+  if(n!=atoi(ids)){fprintf(stderr,"Invalid node id in line ?. Program aborted.\n"); exit(1); }
+  
+  char *preds;
+  while(preds=strtok(NULL,","))
+  {
+    previd=atoi(preds);
+    nodes[n].pred.push_back(&nodes[previd]);
+  }
+
+  return n++;
+}
+
Index: _old/app/src/dgp/mgraph.hh
===================================================================
--- _old/app/src/dgp/mgraph.hh	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/dgp/mgraph.hh	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,37 @@
+#ifndef _MGRAPH_HH
+#define _MGRAPH_HH
+
+#include <vector>
+
+#include "const.hh"
+#include "thesymbols.hh"
+#include "../common/common.h"
+
+
+using namespace std;
+
+class MNode
+{
+public:
+
+  char           type[MAXFORMLEN];
+  Cat            cat;
+  int            pos;
+  vector<MNode*> pred;
+  vector<int>    snodes;
+
+  void           clear() { snodes.clear(); };
+};
+
+class MGraph
+{
+ public:
+
+  MNode nodes[MAXNODES];
+  int   n;
+
+  void clear() { n=0; };
+  int add_node(char* seg);
+};
+
+#endif
Index: _old/app/src/dgp/sgraph.cc
===================================================================
--- _old/app/src/dgp/sgraph.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/dgp/sgraph.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,165 @@
+#include "global.hh"
+#include "sgraph.hh"
+#include "mgraph.hh"
+#include "grammar.hh"
+#include "const.hh"
+#include <stdio.h>
+
+
+int SGraph::add_base_snode(MNode* mn)
+{
+  int nodeind=n;
+  SNode &node=nodes[n];
+
+  node.clear();
+
+  node.mnode=mn;
+
+  for(vector<MNode*>::iterator pm=node.mnode->pred.begin(); pm!=node.mnode->pred.end(); ++pm)
+    for(vector<int>::iterator ps=(*pm)->snodes.begin(); ps!=(*pm)->snodes.end(); ++ps)
+      if(nodes[*ps].in_LH)
+      {
+        node.LV.set(*ps);
+        if(nodes[*ps].saturated()) node.LV |= nodes[*ps].LH;
+      }
+
+  mn->snodes.push_back(nodeind);
+  ++n;
+
+  node.in_LH=true;
+
+  return nodeind;
+}
+
+
+void SGraph::update_left(int headind, int depind)
+{
+  SNode &head=nodes[headind], &dep=nodes[depind];
+
+  if(dep.saturated()) head.LV |= dep.LV, head.LD |= dep.LD;
+}
+
+
+void SGraph::update_right(int headind, int depind)
+{
+  SNode &head=nodes[headind], &dep=nodes[depind];
+
+  dep.LH.set(headind);
+  if(head.saturated())
+    dep.LH |= head.LH;
+}
+
+
+int SGraph::clone(int ancind, NodeProp newprop)
+{
+  int newind = n++;
+  SNode &newnode=nodes[newind];
+  SNode &ancnode = nodes[ancind];
+
+  newnode.clear();
+  newnode.prop=newprop;
+  newnode.mnode=ancnode.mnode;
+  newnode.mnode->snodes.push_back(newind);
+  return newind;
+}
+
+
+//-------------------------------------------------------------------------
+//-------------------------------------------------------------------------
+
+
+int SGraph::print_node(FILE* f, int n, unsigned int info)
+{
+  char buf[1000];
+  sprint_node(buf,n,info);
+  fputs(buf,f);
+}
+
+int SGraph::sprint_node(char* buf, int nodeind, unsigned int info)
+{
+  char* buf0=buf;
+  char descr[256];
+  char nodeinfo[16];
+
+  SNode &node=nodes[nodeind];
+
+  buf+=sprintf(buf," dgp:%d",nodeind);
+  buf+=sprintf(buf, saturated(nodeind) ? ";s" : ";u");
+
+  bool cont=false;
+  if (info&HEADS)
+  {
+    buf+=sprintf(buf,";");
+    for(vector<Arc>::iterator h=node.heads.begin(); h!=node.heads.end(); ++h)
+    {
+      if(cont) buf+=sprintf(buf,","); else cont=true;
+      buf+=sprintf(buf,"++%s-%d/%d",h->role.str(),h->dst,h->anc);
+    }
+  }
+  
+  if (info&DEPS)
+  {
+    buf+=sprintf(buf,";");
+    for(vector<Arc>::iterator d=node.deps.begin(); d!=node.deps.end(); ++d)
+    {
+      //      if(! nodes[d->dst].saturated()) continue; // NIE DRUKUJ NIENASYCONYCH PODRZEDNIKOW
+      if(cont) buf+=sprintf(buf,","); else cont=true;
+      buf+=sprintf(buf,"--%s-%d/%d",d->role.str(),d->dst,d->anc);
+    }
+  }
+  
+  if (info&SETS)
+  {
+    int ord=0;
+    buf+=sprintf(buf,";{");
+    for(vector<MNode*>::iterator pm=node.mnode->pred.begin(); pm!=node.mnode->pred.end(); ++pm)
+      for(vector<int>::iterator ps=(*pm)->snodes.begin(); ps!=(*pm)->snodes.end(); ++ps)
+        buf+=sprintf(buf, ord++ ? ",%d" : "%d", *ps);
+    buf+=sprintf(buf,"};{");
+    ord=0;for(int j=0; j<=n; ++j) if(node.LV[j]) buf+=sprintf(buf, ord++ ? ",%d" : "%d", j);
+    buf+=sprintf(buf,"};{");
+    ord=0;for(int j=0; j<=n; ++j) if(node.LH[j]) buf+=sprintf(buf, ord++ ? ",%d" : "%d", j);
+    buf+=sprintf(buf,"};{");
+    ord=0;for(int j=0; j<=n; ++j) if(node.LD[j]) buf+=sprintf(buf, ord++ ? ",%d" : "%d", j);
+    buf+=sprintf(buf,"}");
+  }
+
+  if (info&CONSTRAINTS)//  buf+=sprint_node_constraints(buf,n);
+  {
+    buf+=sprintf(buf,";");
+    int cont=0;
+    for(Role i=1; i<=Role::count(); ++i)
+      if(node.prop.forbidden[i]) buf+=sprintf(buf,"%s!%s",(cont++)?",":"",i.str());
+    for(Role i=1; i<=Role::count(); ++i)
+      if(node.prop.required[i]) buf+=sprintf(buf,"%s&%s",(cont++)?",":"",i.str());
+  }
+  
+//   buf+=sprintf(buf,"\n");
+  
+  return buf-buf0;
+}
+
+
+int SGraph::sprint_node_debug(char* buf, const char* pref, int n)
+{
+  char *buf0 = buf;
+  buf+=sprintf(buf,"#%s",pref);
+  buf+=sprint_node(buf,n,HEADS|DEPS|SETS|CONSTRAINTS);
+  buf+=sprintf(buf,"\n");
+  return buf-buf0;
+}
+
+int SGraph::print_node_debug(FILE* f, const char* pref, int n)
+{
+  char buf[1000];
+  sprint_node_debug(buf,pref,n);
+  fputs(buf,f);
+}
+
+void SGraph::print_arc(FILE* f, int left, int right, Role role, int dir) // 0 - left, 1 - right
+{
+  fprintf(f,"#   %s:%s.%02d %s %s.%02d\n",
+          role.str(),nodes[left].mnode->type,left,
+          dir ? "-->" : "<--",
+          nodes[right].mnode->type,right);
+}
Index: _old/app/src/dgp/sgraph.hh
===================================================================
--- _old/app/src/dgp/sgraph.hh	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/dgp/sgraph.hh	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,110 @@
+#ifndef _SGRAPH_HH
+#define _SGRAPH_HH
+
+#include <stdio.h>
+
+#include <list>
+#include <vector>
+#include <bitset>
+
+#include "const.hh"
+#include "thesymbols.hh"
+
+
+using namespace std;
+
+class MNode;
+
+
+struct Arc
+{
+  int dst;
+  Role role;
+  int anc;
+ 
+  Arc(int d, Role r, int a) : dst(d), role(r), anc(a) {};
+ };
+
+
+struct NodeProp
+{
+  bitset<MAXTYPES> required;
+  bitset<MAXTYPES> forbidden;
+
+  bool operator==(const NodeProp& p)
+  { return required==p.required && forbidden==p.forbidden; }
+
+  void clear()
+  { required.reset(), forbidden.reset(); }
+
+};
+
+
+struct SNode
+{
+  
+  MNode* mnode;
+
+  NodeProp prop;
+
+  bitset<MAXNODES> LV;
+  bitset<MAXNODES> LH;
+  bitset<MAXNODES> LD;
+  bool in_LH;
+
+  vector<Arc> heads;
+  vector<Arc> deps;
+
+  void clear()      { prop.clear(), LV.reset(), LD.reset(), LH.reset(), heads.clear(), deps.clear(); }
+  bool saturated()  { return prop.required.none(); }
+};
+
+
+
+class SGraph
+{
+public:
+
+  SNode nodes[MAXNODES];
+  int n; // number of nodes
+
+  enum Output { HEADS=1, DEPS=2, SETS=4, CONSTRAINTS=8 };
+
+  SGraph() : n(0) {}
+
+  void clear() { n=0; }
+ 
+  int add_base_snode(MNode* mn);
+  int clone(int ancind, NodeProp newprop);
+  void update_left(int headind, int depind);
+  void update_right(int headind, int depind);
+
+  bool visible(int left, int right);
+  bool saturated(int node);
+
+  //--------------------------------------------------------------------
+
+  void read(FILE* f);
+  void write(FILE* f, list<int> nodelist, unsigned int info);
+
+  int sprint_node(char* buf, int n, unsigned int info);
+  int print_node(FILE* f, int n, unsigned int info);
+  int sprint_node_debug(char* buf, const char* pref, int n);
+  int print_node_debug(FILE* f, const char* pref, int n);
+
+  void print_arc(FILE* f, int left, int right, Role role, int dir); // 0 - left, 1 - right
+
+};
+
+
+inline bool SGraph::visible(int left, int right)
+{
+  return nodes[right].LV[left];
+}
+
+inline bool SGraph::saturated(int node)
+{
+  return nodes[node].saturated();
+}
+
+#endif
Index: _old/app/src/dgp/symbol.cc
===================================================================
--- _old/app/src/dgp/symbol.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/dgp/symbol.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,39 @@
+#include "symbol.hh"
+
+// CLASS symbols
+
+//int Symbols::_no_of_spaces=0;
+
+Symbols::~Symbols()
+{
+  while(!table.empty())
+  {
+    free((void*)table.back());
+    table.pop_back();
+  }
+}
+
+void Symbols::load(const char* filename)
+{
+  ifstream f(filename);
+  char s[100];
+  while(f)
+  {
+    f >> s >> ws;
+    if(strlen(s)) add(s);
+  }
+}  
+
+void Symbols::add(const char* sym)
+{
+  if(hash.count(sym)==0)
+  {
+    char* symdup=strdup(sym);
+    hash[symdup]=table.size();
+    table.push_back(symdup);
+  }
+}
+
+
+//template<int space>
+//Symbols Symbol<space>::defs;
Index: _old/app/src/dgp/symbol.hh
===================================================================
--- _old/app/src/dgp/symbol.hh	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/dgp/symbol.hh	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,143 @@
+#ifndef _SYMBOL_HH
+#define _SYMBOL_HH
+
+#include <ext/hash_map>
+//#include <ext/hash_fun.h>
+#include <string>
+#include <string.h>
+#include <fstream>
+#include <vector>
+#include <iostream>
+
+using namespace std;
+
+using __gnu_cxx::hash_map;
+using __gnu_cxx::hash;
+
+
+// Key comparison for the cstr_hash hash table
+struct eqstr
+{ 
+  bool operator()(const char * s, const char* t) const 
+  { return strcmp(s,t)==0; }
+};
+
+
+// Hash table for storing symbols
+
+typedef hash_map<const char*,int,hash<const char*>,eqstr> cstr_hash;
+
+// Symbol table. Provides access to symbols through their index or name.
+
+class Symbols
+{
+ public:
+
+  Symbols() { add("NULL"); };
+  ~Symbols();
+  
+  void load(const char* filename);
+
+  int operator[](const char* s) { return hash[s]; };
+  
+  const char* operator[](int i) { return table[i]; };
+
+  void add(const char* c);
+
+  int count() { return table.size(); };
+
+ private:
+    
+  std::vector<const char*> table;
+  cstr_hash hash;
+
+};
+
+//////////////////////////////////////////////////////////////////////
+
+/// Symbol class template. 
+/** The template argument determines the symbol space.
+    Each space is created with symbol "NULL" with indexed 0 already in.
+*/
+
+template <int space>
+class Symbol
+{
+ public:
+
+  /// Load the contents of the symbol table from file.
+  static void define(const char *filename) 
+  { defs.load(filename); }
+  
+  /// Add symbol s.
+  /** The string is duplicated.
+   */
+  static Symbol<space> add(const char* s) { defs.add(s); }
+      
+  /// Number of symbols.
+  static int count() { return defs.count(); };
+
+  /// First symbol.
+  static int first() { return 1; }
+
+  /// Last symbol.
+  static int last() { return defs.count()+1; }
+
+  /// Last symbol.
+  static int index(const char* s) { return defs[s]; }
+
+  /// Just for tests.
+  static void print();
+
+  /// 0-argument constructor, default value is 0 ("NULL").
+  Symbol() : val(0) {};
+
+  /// Constructing a symbol from its index.
+  /** No check is performed.
+  */
+
+  Symbol(int v) : val(v) {};
+  
+  /// Constructing a symbol from its name (string to Symbol conversion).
+  /** If s is not a symbol name, the value of 0 ("NULL") is assigned.
+  */
+
+  Symbol(const char * s) : val(defs[s]) {};
+  
+  /// Symbol to char* conversion. If symbol is invalid, NULL is returned.
+  const char* str() const { return (val>=0 && val<count())?defs[val]:NULL; };
+
+  /// Symbol to int& conversion.
+  /** Provides a way to iterate through symbols, eg:
+   *  for(Symbol<0> s=1; s; s++ ) ...
+      s=0; while(++s) ...
+   */
+  (operator int)() const { return val; };
+
+  Symbol operator++() {val++; return *this;}
+
+  //  bool operator<(Symbol& s) { return val < s.val; }
+
+
+ private:
+  static Symbols defs;
+  int val;
+};
+
+template <int space>
+void Symbol<space>::print()
+{
+  for(Symbol i=0; i<count(); ++i)
+    cout << (int)i << ": " << (const char*)i << endl;
+}
+
+template<int space>
+Symbols Symbol<space>::defs;
+
+template<int space>
+bool operator<(const Symbol<space>& s, const Symbol<space>& t)
+{
+  return (int)s < (int)t;
+}
+
+#endif
Index: _old/app/src/dgp/thesymbols.hh
===================================================================
--- _old/app/src/dgp/thesymbols.hh	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/dgp/thesymbols.hh	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,32 @@
+#ifndef __THESYMBOLS__HH
+#define __THESYMBOLS__HH
+
+#include "symbol.hh"
+#include "const.hh"
+
+#include <list>
+#include <set>
+#include <bitset>
+
+
+using namespace std;
+
+typedef Symbol<1> Cat;
+
+typedef Symbol<2> Role;
+typedef list<Role> RoleList;
+typedef list<Role>::iterator RoleListIter;
+typedef bitset<MAXTYPES> RoleSet;
+typedef set<Role> Roles;
+typedef Roles::iterator RolesIter;
+
+typedef Symbol<3> Constr;
+typedef list<Constr> ConstrList;
+typedef list<Constr>::iterator ConstrListIter;
+
+typedef Symbol<4> Rel;
+
+typedef Symbol<5> Flag;
+typedef bitset<MAXFLAGS> FlagSet;
+
+#endif
Index: _old/app/src/dgp/tre
===================================================================
--- _old/app/src/dgp/tre	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/dgp/tre	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,304 @@
+#!/usr/bin/ruby -I /usr/local/lib/utt -I $HOME/.local/lib/utt
+
+$: << "#{ENV['HOME']}/.local/lib/utt"
+$: << "/usr/local/lib/utt"
+
+require 'getoptlong'
+require 'seg.rb'
+
+opts = GetoptLong.new(
+[ '--help',     '-h',   GetoptLong::NO_ARGUMENT ],
+[ '--debug',    '-d',   GetoptLong::NO_ARGUMENT ],
+[ '--format',   '-F',   GetoptLong::REQUIRED_ARGUMENT ],
+[ '--info',     '-I',   GetoptLong::REQUIRED_ARGUMENT ],
+[ '--only-trees','-t',  GetoptLong::NO_ARGUMENT ])
+
+$helptext=
+"The program generates trees from the graph output by dgp. dgp must\n"+
+"must be run with '-i ds' option.\n\n"+
+"Command:       tre [options]\n\n"+
+"Options:\n"+
+"--help         -h      Print help (this text) and exit.\n"+
+"--debug        -d      Verbose output. For developers only.\n"+
+"--format=s     -F s    Output format. Recognized values:\n"+
+"                               a       root + list of arcs\n"+
+"                               p       parenthesized notation\n"+
+"                               h       human readable indented tree format\n"+
+"                       Multiple values are allowed. (default p)\n"+
+"--info=s       -I s    Information printed. Recognized values:\n"+
+"                               n       node identifier\n"+
+"                               f       surface form\n"+
+"                               m       morphological information\n"+
+"                               l       arc labels\n"+
+"--only-trees   -t      Do not copy input. Print trees only.\n"
+
+$DEBUG=false
+$FORMAT='p'
+$INFO='DEFAULT'
+$ONLYTREES=false
+
+opts.each do |opt, arg|
+  case opt
+  when '--help'
+    print $helptext
+    exit 0
+  when '--debug'
+    $DEBUG=true
+  when '--format'
+    $FORMAT=arg
+  when '--info'
+    $INFO=arg
+  when '--only-trees'
+    $ONLYTREES=true
+  else
+    print "Unknown option #{opt}. Ignored.\n"
+  end
+end
+
+if $INFO=='DEFAULT'
+  case $FORMAT
+    when 'p','a'
+    $INFO='nl'
+    when 'h'
+    $INFO='fmnl'
+  end
+end
+
+$dgpsep=';'
+
+def tre(input)
+  $gphid=[]
+  $form=[]
+  $lem=[]
+  nodes=[]
+  count=0
+  seg=Seg.new
+  for line in input
+    print line unless $ONLYTREES
+    seg.set(line)
+    if dgp=seg['dgp']
+      if nodes==[] && seg[3]!='BOS'
+        print "A sentence must start with BOS segment. Aborting.\n"
+        return
+      end
+
+      id=dgp[/^\d+/].to_i
+
+      if gph=seg['gph']
+        $gphid[id]=gph[/^\d+/].to_i
+      else
+        print "No gph field. Aborting.\n"
+        return
+      end
+
+      $form[$gphid[id]]=seg[4]
+      $lem[$gphid[id]]=seg['lem']
+              
+      nodes[id] = [seg[1].to_i,dgp]
+
+      if seg[3]=='EOS'
+        $pref = "#{seg[1]} #{seg[2]} SYN *"
+        parsegraph(nodes)
+        printgraph if $DEBUG
+        $thetrees=[]
+        gentrees2
+        for t in $thetrees
+          count += 1
+          t1=ground(t)
+          case $FORMAT
+          when /a/
+            print "#{$pref} tre:#{count} arc:"
+            printarcs(t1[0],t1[1])
+            print "\n"
+          when /p/
+            print "#{$pref} tre:#{count} par:"
+            printpar(t1[0],t1[1])
+            print "\n"
+          when /h/
+            print "#\n# tree #{count}\n# ------\n"
+            printtree(t1[0],t1[1],0)
+          end
+        end
+        nodes=[]
+      end
+    end
+  end
+end
+
+
+def nodeinfo(id)
+  info=""
+  if $INFO =~ /n/
+    info += id.to_s                           
+    info += '.' if $INFO =~ /[fm]/
+  end
+  if $INFO =~ /f/
+    info += $form[id] 
+    info += ';' if $INFO =~ /m/
+  end
+  if $INFO =~ /m/
+    info += $lem[id]  
+  end
+  info
+end
+
+
+def printarcs(root,arcs)
+  print nodeinfo(root)
+  for a in arcs
+    print ';'
+    print "#{a[2]}:" if $INFO =~ /l/
+      print nodeinfo(a[0])+'-'+nodeinfo(a[1])
+  end
+end
+
+def printtree(root,arcs,o)
+  if o==0
+        print "# %-16s" % "root: "
+  end
+  print nodeinfo(root),"\n"
+  for arc in arcs.select{ |a| a[0]==root }.sort{|a,b| a[1]<=>b[1] }
+    print '# ',"   "*(o+1)
+    print "%-16s" % (arc[2]+": ")
+    printtree(arc[1],arcs,o+1)
+  end
+end
+
+def printpar(root,arcs)
+  print nodeinfo(root)
+  deps = arcs.select{ |a| a[0]==root }.sort{|a,b| a[1]<=>b[1] }
+  unless deps == []
+    print '('
+    cont=false
+    for arc in deps
+      if cont then print ',' else cont=true end
+      print arc[2],':' if $INFO =~ /l/
+      printpar(arc[1],arcs)
+    end
+    print ')'
+  end
+end
+
+
+def parsegraph(nodes)
+
+  $n   =nodes.length
+  $sat =[];
+
+  $vis =[];
+  $succ=[];
+  $lhs =[];
+  $arcs=[];
+  $pos=[]
+
+  for dgp in nodes
+
+    parts  = dgp[1].split($dgpsep,6)
+
+    if parts[3]==nil || parts[4]==nil || parts[5]==nil
+      $stderr.print "ERR: tre requires dgp be called with '--info s' option. Aborting.\n"
+      exit
+    end
+
+    i      = parts[0].to_i
+    $pos[i] = dgp[0].to_i
+    $sat << i if parts[1]=="s"
+    $arcs |= parts[2].split(',').map{ |a| case a 
+                                          when /\-\-(\w+)-(\d+)\/(\d+)/
+                                            [i, $2.to_i, $1, $3.to_i]
+                                          when /\+\+(\d+)-(\w+)\/(\d+)/
+                                            [$1.to_i, i, $2, $3.to_i]
+                                          end }
+    $succ |= parts[3][1..-2].split(',').map{|x| [x.to_i,i]}
+    $vis  |= parts[4][1..-2].split(',').map{|x| [x.to_i,i]} 
+    $lhs  |= parts[5][1..-2].split(',').map{|x| [x.to_i,i]} + [[i,i]]
+
+  end
+end
+
+
+def ground(t)
+  [ $gphid[t[0]] , t[1].map{|a| [$gphid[a[0]],$gphid[a[1]],a[2]]} ]
+end  
+
+
+def gentrees2()
+  $thetrees=[];
+  bos=0; eos=$n-1;
+  roots = (1...eos).select{|i| $vis.include? [i,eos]}.select{|i| $vis.include? [bos,i]}
+  if $DEBUG then print "ROOTS: #{roots.inspect}\n" end
+  for i in roots
+    $theroot=i
+    for r in buildR(i , eos, [])
+      (rmin,rmax,rtree) = r
+      buildR(bos, rmin, rtree)
+    end
+  end
+end
+
+
+def buildR(min, max, tree)
+  if $DEBUG then print "buildR--#{min}--#{max}--#{tree.inspect}\n" end
+  trees=[]
+  for a in $arcs.select{|a| a[0]==max && $vis.include?([min,a[1]]) }
+    if $DEBUG then print "ARC: #{a.inspect}\n" end
+    for r in buildR(a[1],a[3],tree+[a])
+      (rmin,rmax,rarcs) = r
+      for l in buildR(min,rmin,rarcs)
+        (lmin,lmax,larcs) = l
+        trees << [lmin,rmax,larcs]
+      end
+    end
+  end
+  for i in (0...$n).select{|i| $succ.include?([i,max])}.select{|i| $lhs.include?([min,i])}
+    for l in buildL(min,i,tree)
+      (lmin,lmax,larcs) = l
+      trees << [lmin,lmax,larcs]
+    end
+  end
+  trees  
+end
+    
+
+def buildL(min,max,tree)
+  if $DEBUG then print "buildL--#{min}--#{max}--#{tree.inspect}\n" end
+  if $pos[min]==$pos[max]
+    if min==0 && max==0
+      $thetrees.push [$theroot,tree]
+      if $DEBUG then print "adding tree: #{tree.inspect}\n" end
+    end
+    return [[max,max,tree]]
+  end
+  trees=[]
+  for arc in $arcs.select{|a| a[1]==max && $lhs.include?([min,a[0]]) }
+    if $DEBUG then print "ARC: #{arc.inspect}\n" end
+    for r in buildR(arc[3],max,tree+[arc])
+      (rmin,rmax,rarcs) = r
+      for l in buildL(min,rmin,rarcs)
+        (lmin,lmax,larcs) = l
+        trees << [lmin,lmax,larcs]
+      end
+    end
+  end
+  trees
+end
+
+
+def printgraph()
+  
+  print "N:    #{$n}\n"
+  print "SAT:  #{set_to_s($sat)}\n"
+  print "SUCC: #{rel_to_s($succ)}\n"
+  print "VIS:  #{rel_to_s($vis)}\n"
+  print "LHS:  #{rel_to_s($lhs)}\n"
+  print "ARCS: #{arcs_to_s($arcs)}\n"
+end
+
+def set_to_s(s) "{#{s.join(',')}}" end
+def rel_to_s(r) "{#{r.map{|p| "(#{p[0]},#{p[1]})"}.join(',')}}" end
+def arc_to_s(q) "-#{q[0]}-#{q[2]}-#{q[1]}/#{q[3]}" end
+def arcs_to_s(a) "{#{a.map{|q| arc_to_s(q)}.join(',')}}" end
+
+######################################################################
+
+tre($stdin)
Index: _old/app/src/dgp/uttcommon.c
===================================================================
--- _old/app/src/dgp/uttcommon.c	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/dgp/uttcommon.c	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,2 @@
+#include "uttcommon.h"
+
Index: _old/app/src/dgp/uttcommon.h
===================================================================
--- _old/app/src/dgp/uttcommon.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/dgp/uttcommon.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,146 @@
+#ifndef __COMMON_H
+#define __COMMON_H
+
+#include <stdio.h>
+
+/**************************************************
+ * Stale dotyczace wejscia/wyjscia
+ */
+
+#define MAXLINE 1024
+
+#define EMPTYFORM '*'
+#define INFIELD_SEP ':'
+#define MAXAUX 16
+#define FIELD_SEP " \t\n"
+
+
+/***************************************************************/
+/* problems with casing                                        */
+/* sprawdzenie wielkosci liter                                 */
+/* warto¶æ zwracana:                                           */
+/* 0 - wszystkie ma³e litery, 1 - pierwsza wielka, reszta male */
+/* 2 - wszystkie wielkie, 3 - inne                             */
+/***************************************************************/
+inline int casing(char* s)
+{
+  int ret = isupper(*s) ? 1 : 0;
+  while(*++s != '\0')
+  {
+    if(isupper(*s))
+    {
+      if(ret==1) ret=2;
+      else if(ret==0) ret=3;
+    }
+    else
+    {
+      if(ret==2) ret=3;
+    }
+  }
+  return ret;
+}
+
+// 
+inline void tolowers(char* s, char* d)
+{
+  *d=tolower(*s);
+  while(*s != '\0') * ++d = tolower(* ++s);
+}
+
+
+// przepisuje s do d
+// nadajac wielko¶æ liter zgodnie z warto¶ci± casing
+// casing - warto¶æ zwracana przez casing()
+// je¶li casing==3 przepisuje bez zmian (za ma³o informacji)
+inline void restorecasing(char *s, char *d, int casing)
+{
+  switch(casing)
+  {
+  case 0:
+  case 3:
+    *d=*s;
+    while(*s != '\0') * ++d = * ++s;
+    break;
+  case 1:
+    *d=toupper(*s);
+    while(*s != '\0') * ++d = * ++s;
+    break;
+  case 2:
+    *d=toupper(*s);
+    while(*s != '\0') * ++d = toupper(* ++s);
+    break;
+  }
+}
+
+
+/**************************************************/
+/*
+parameters:
+  -seg  - segment
+  -name - field name
+  +val  - field contents
+return value:
+  1 if specified field exists, 0 otherwise
+*/
+
+inline int getfield(char* seg, const char* pref, char* val)
+{
+  char* p=seg;
+
+  while(isspace(*p)) ++p;
+  
+ pos:
+  if(isdigit(*p) or *p=='*') while(!isspace(*p)) ++p; 
+  else goto type;
+
+  while(isspace(*p)) ++p;
+  
+ len:
+  if(isdigit(*p) or *p=='*') while(!isspace(*p)) ++p; 
+  else goto type;
+
+  while(isspace(*p)) ++p;
+  
+ type:
+  while(isspace(*p)) ++p; while(!isspace(*p)) ++p;
+
+  while(isspace(*p)) ++p;
+
+ form:
+  while(isspace(*p)) ++p; while(!isspace(*p)) ++p;
+
+ annotation:
+  do p=strstr(p,pref); while(p!=NULL && *(p-1)!=' ' && *(p-1)!='\t');
+  
+  if(p==NULL) return 0;
+  else
+  {
+    p+=strlen(pref);
+    int len=strcspn(p,FIELD_SEP "\n\r\f\0");
+    strncpy(val,p,len);
+    val[len]='\0';
+    return 1;
+  }
+}
+
+
+/*
+parameters:
+  +seg - segment
+  -pref - prefix of the new field
+  -val  - contents of the new field
+return value:
+  1 - success, 0 - fail (limit on segment length exceeded)
+*/
+inline int addfield(char *seg, const char *pref, const char *val)
+     // zalozenie, ze seg konczy sie znakiem \n
+{
+  if(strlen(seg)+strlen(pref)+strlen(val) >= MAXLINE) return 0; // bezpieczniej, ale wolniej
+
+  int seglen=strlen(seg);
+  sprintf(seg+(seglen-1)," %s%s\n",pref,val);
+  return 1;
+}
+
+
+#endif
Index: _old/app/src/gue/Makefile
===================================================================
--- _old/app/src/gue/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/gue/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,42 @@
+PAR=-Wno-deprecated -O3 -fpermissive -m32 -static
+PAR2=-c -Wno-deprecated -O3 -fpermissive -m32
+LIB_PATH=../lib
+COMMON_PATH=../common
+CMDLINE_FILE='"../gue/cmdline.h"'
+
+
+gue: main.cc guess.o $(LIB_PATH)/auttools.o $(LIB_PATH)/word.o \
+      cmdline.c common_guess.o common.o
+	g++ $(PAR) main.cc guess.o \
+	$(LIB_PATH)/auttools.o $(LIB_PATH)/word.o cmdline.c common.o common_guess.o \
+	-o gue
+
+guess.o: guess.h guess.cc
+	g++ $(PAR2) guess.cc
+
+common_guess.o: cmdline.h  common_guess.cc common_guess.h
+	g++ $(PAR2) common_guess.cc
+
+common.o: $(COMMON_PATH)/cmdline_common.ggo $(COMMON_PATH)/common.cc \
+	 $(COMMON_PATH)/common.h
+	g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) $(COMMON_PATH)/common.cc
+
+cmdline.c cmdline.h: cmdline.ggo
+	gengetopt -i cmdline.ggo --conf-parser
+
+cmdline.ggo: cmdline_guess.ggo $(COMMON_PATH)/cmdline_common.ggo
+	cat cmdline_guess.ggo $(COMMON_PATH)/cmdline_common.ggo > cmdline.ggo
+
+
+clean: clean.cmdline
+	rm *.o || true
+	rm gue || true
+
+
+clean.cmdline:
+	rm cmdline.* || true
+
+copy:
+ifdef UTT_BIN_DIR
+	cp gue ${UTT_BIN_DIR}
+endif
Index: _old/app/src/gue/cmdline_guess.ggo
===================================================================
--- _old/app/src/gue/cmdline_guess.ggo	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/gue/cmdline_guess.ggo	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,12 @@
+package "guess"
+version "0.1"
+
+option "guess_count"		n	"Guess up to n descriptions" int default="0" no
+option "delta"			-	"Stop displaying answers after fall of weight" float default="0.2" no
+option "cut-off"		-	"Do not display answers with less weight than cut-off" int default="200" no
+option "dictionary-home"	-	"dh" string typestr="FILENAME" no hidden
+option "dictionary"		d	"File with dictionary information" string typestr="filename" default="gue.bin" no
+option "per-info"		v	"Display performance information" flag off
+option "weights"		w	"Print weights" flag off
+option "no-uppercase"		-	"Do not process form containing uppercase letters" flag off
+
Index: _old/app/src/gue/common_guess.cc
===================================================================
--- _old/app/src/gue/common_guess.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/gue/common_guess.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,60 @@
+#include <stdlib.h>
+#include <string.h>
+#include "common_guess.h"
+
+int guess_count=0;
+double delta=0.1;
+int cut_off=100;
+char dictionary[255];
+bool per_info=false;
+bool weights=false;
+
+void process_guess_options(gengetopt_args_info* args)
+{
+
+  if(args->dictionary_given)
+    {
+      expand_path(args->dictionary_arg,dictionary);
+      if(file_accessible(dictionary)!=0)
+	{
+	  fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary);
+	  exit(1);
+	}
+    }
+  else if (args->dictionary_home_given && args->language_given)
+    {
+      char buf[255];
+      expand_path(args->dictionary_home_arg, buf);
+      sprintf(dictionary,"%s/%s/gue.bin",buf,args->language_arg);
+      if(file_accessible(dictionary)!=0)
+	{
+	  fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary);
+	  exit(1);
+	}
+    }
+
+  if(args->guess_count_given)
+    guess_count=args->guess_count_arg;
+  else
+    guess_count=0;
+
+  if(guess_count==0)
+    guess_count=100;
+
+  if(args->delta_given)
+    delta=args->delta_arg;
+  else
+    delta=0.1;
+
+  if(args->cut_off_given)
+    cut_off=args->cut_off_arg;
+  else
+    cut_off=100;
+
+  if(args->per_info_given)
+    per_info=args->per_info_flag;
+
+  if(args->weights_given)
+    weights=true;
+
+}
Index: _old/app/src/gue/common_guess.h
===================================================================
--- _old/app/src/gue/common_guess.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/gue/common_guess.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,20 @@
+#ifndef __COMMON_GUESS_H
+#define __COMMON_GUESS_H
+
+#include <stdio.h>
+#define _CMDLINE_FILE "../gue/cmdline.h"
+#include "../common/common.h"
+#include "cmdline.h"
+
+#define DIC_FILE "gue.bin"
+
+extern int guess_count;
+extern double delta;
+extern int cut_off;
+extern char dictionary[];
+extern bool per_info;
+extern bool weights;
+
+void process_guess_options(gengetopt_args_info* args);
+
+#endif
Index: _old/app/src/gue/guess.cc
===================================================================
--- _old/app/src/gue/guess.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/gue/guess.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,142 @@
+
+#include "guess.h"
+
+#include <string.h>
+#include <iostream>
+#include <stdlib.h>
+#include <assert.h>
+#include <time.h>
+
+#define DICT 1
+#define COR 2
+#define DICT_P 3
+#define COR_P 4
+
+#define W_PRE 0.1
+#define W_SUF 0.9
+
+#define PREF_SIGN '_'
+
+
+using namespace std;
+
+
+Guess::Guess(const char* suf_file)
+  : _suf(suf_file) {
+  /*  _suf = NULL;
+  _pref = NULL;
+
+   if (strlen(suf_file) > 0)
+    _suf = new TFTiv<char, char>(suf_file);
+  if (strlen(pref_file) > 0)
+    _pref = new TFTiv<char, char>(corp_file);
+  */
+}
+
+
+  char buf[MAX_LINE];
+  char out[MAX_LINE];
+  char* buf0_s = buf;
+  char* word_t = NULL;
+  long state_s = 0;
+  unsigned length_s = buf0_s - buf;
+  long len = 0;
+  int i=0;
+
+int Guess::ana(const char* word, Words& result) {
+
+  assert(word && &result);
+
+  /* Word zawiera wyraz, ktory mamy zbadac.
+   * Nalezy przepisac go w odwrotnej kolejnosci do bufora,
+   * znalezc najdluzszy prefiks pasujacy do tego bufora
+   * separatorem jest '/' - za tym znakiem znajduje sie
+   * prawdopodobienstwo wystapienia danego opisu */
+
+  buf0_s = buf;
+  word_t = strdup(word);
+
+  if (reverse(word, buf) != 0)
+    return -1;
+
+ 
+
+  state_s = -1;
+  //  printf("#buf0_s=%s, ", buf0_s);
+  state_s = _suf.pref(buf0_s, PREF_SIGN);
+  //  printf("#word=%s, buf0_s=%s\t", word, buf0_s);
+  /* jezeli state_s != -1 to oznacza, ze w slowniku jest zawarta
+   * informacja o prefiksie tego slowa.
+   * nie jest ona odwrocona, wiec porownujemy do word a nie do buf
+   */
+  //  printf("state_s=%d\t", state_s);
+  if (state_s != -1) {
+    state_s = _suf.pref(word_t, '~', state_s);
+    //    printf("state_s(wp)=%d, word_t=%s, word=%s\n", state_s, word_t, word);
+  }
+  if (state_s == -1) {
+  //  if (_suf != NULL) 
+    buf0_s = buf;
+    state_s = _suf.pref(buf0_s, '~');
+    //    printf("state_s=%d\n", state_s);
+  }
+
+  length_s = buf0_s - buf;
+ 
+  /* state jest stanem, od ktorego zaczyna sie sciezka opisujaca
+   * prawdopodobienstwo przeciwienstwa wystapienia opisu
+   * znajdujacego sie dalej na tej sciezce.
+   * Im mniejsza wartosc liczby tym wieksze prawdopodobienstwo */
+
+  len = 0;
+  i=0;
+  
+  //  if (_suf != NULL)
+    len = _suf.cont(state_s, out);
+  while (len > 0) {
+    i++;
+    add_word_prob(result, word, out, length_s, DICT);
+    len = _suf.cont(-1, out);
+  }
+    
+  return i;
+
+}
+
+
+int Guess::add_word_prob(Words& tab, const char* word, const char* path, unsigned len, int source) {
+
+  /* Dodaje do tablicy tab wyraz word wraz
+   * z prawdopodobienstwem i opisem zawartym
+   * w sciezce path */
+
+  //  printf("add_word_prob(");
+  //  fflush(stdout);
+  char p[MAX_LINE];
+
+  strcpy(p, path);
+
+  int probLen = strcspn(p, ";");
+  char prob[probLen+1];
+  strncpy(prob, p, probLen);
+  prob[probLen] = '\0';
+
+  char* desc = p + probLen+1; // +2 bo pomijamy jeszcze znak ';'
+
+  int i = tab.add(word, desc);
+
+  if (source==DICT) {
+    tab[i].len_suf(len);
+    tab[i].w_suf(atof(prob)); // + W_PRE*tab[i].w_suf()));
+    //    tab[i].w_suf((float)(W_SUF*(1000-atof(prob)) + W_PRE*tab[i].w_suf()));
+  }
+//   if (source==COR) {
+//     tab[i].len_pref(len);
+//     tab[i].w_pref(W_SUF*(1000-atof(prob)) + W_PRE*tab[i].w_pref());
+//   }
+//   printf(")\n");
+//   fflush(stdout);
+
+  return i;
+
+}
Index: _old/app/src/gue/guess.h
===================================================================
--- _old/app/src/gue/guess.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/gue/guess.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,56 @@
+
+#include "../lib/tfti.h"
+#include "../lib/word.h"
+
+#include <sys/timeb.h>
+
+/**************************************************************
+ * Zawiera definicje klasy Guess.                              *
+ *                                                            *
+ * Klasa ta pozwala na okreslenie opisu slowa nie             *
+ * znajdujacego sie w slowniku wraz z prawdopodobienstwem     *
+ * jego wystapienia.                                          *
+ *************************************************************/
+
+class Guess {
+
+ public:
+
+  // nazawa pliku slownika w parametrze
+  Guess(const char* suf_file);
+
+  // zwraca tablice opisow slowa wraz z prawdopodobienstwem ich wystapienia
+  int ana(const char* word, Words& result);
+
+  long time_overall;
+
+ private:
+
+  // sufiksy
+  TFTiv<char, char> _suf;
+
+  // prefiksy
+  TFTiv<char, char> _pref;
+
+  //odwraca ciag znakow
+  int reverse(const char* src, char* dest) {
+ 
+  //  assert((src != NULL) && (dest != NULL));
+
+    const char* c = src;
+  
+    int len = strlen(src);
+
+    for (int i=1; i<=len; ++i) {
+      dest[i-1] = src[len-i];
+    }
+
+    dest[len] = '\0';
+
+    return 0;
+  }
+
+  //dodaje nowy element do tablicy WordsProb
+  int add_word_prob(Words& tab, const char* word, const char* path, unsigned len, int source);
+
+};
Index: _old/app/src/gue/main.cc
===================================================================
--- _old/app/src/gue/main.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/gue/main.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,237 @@
+#include <time.h>
+#include <stdlib.h>
+#include "../lib/iotools.h"
+#define _CMDLINE_FILE "../gue/cmdline.h"
+#define CONFIGFILE1 "/home/ynka/utt/utt-0.9/conf/gue.conf"
+#define CONFIGFILE2 "/home/ynka/utt/utt-0.9/conf/gue.conf"
+#include "../common/common.h"
+#include "common_guess.h"
+#include "guess.h"
+#include "cmdline.h"
+
+#define W_SUFF 0.6
+#define W_PREF 0.4
+
+
+int main(int argc, char** argv) {
+
+  //  int non_standard_config=0;
+
+  gengetopt_args_info args;
+
+  if(cmdline_parser(argc, argv, &args) != 0)
+    exit(1);
+
+  process_config_files(&args,argv[0]);
+  process_common_options(&args,argv[0]);
+  process_guess_options(&args);
+
+  char line[MAX_LINE];
+  char outline[MAX_LINE];
+  char parms[MAX_LINE], desc[MAX_LINE], lemma[MAX_LINE];
+  long line_count = 0;
+  
+  Guess guess(dictionary);
+  int words_count=0;
+  time_t start_time = time(NULL);
+  
+  //  Segment seg;
+  Words tab;
+  while (fgets(line, MAX_LINE, inputf))
+    {
+      line_count++;
+      int start, len;
+      
+      //      line[strlen(line)-1] = '\0';
+      
+      if (!process_seg(line, args))
+	fputs(line,outputf);
+      else
+	{
+	  char form[MAX_FORM];
+	  words_count++;
+	  tab.clear();
+	  getfield(line,input_field_prefix,form);
+	  if (form==NULL) continue;//BZDURA
+	  
+	  guess.ana(form, tab);
+	  
+	  if ((tab.count()==0) && (!args.no_fail_flag)) // no guesses - analysis was unsuccessful
+	    fputs(line, failedf);
+	  else
+	    {
+
+// 	      if (copy_processed)
+// 		fputs(line, stdout);
+// 	      continue;
+// 	    }
+	  // we've got some guesses. Do we want to print it?
+// 	      if (args.only_fail_flag)
+// 	    continue;
+
+	      float last_weight=0;
+	      int i=0;
+	      int count=0;
+	      unsigned first=1;
+	      char* parms_end = parms;
+	      char last_lemma[MAX_LINE];
+
+	      count = 1;
+
+	      	      tab.sort();
+	      
+	      while (count < tab.count() && count <= guess_count)
+		if (first || tab[count].w_suf() >= cut_off && tab[count].w_suf() >= delta * last_weight)
+		  {
+		    first=0;
+		    last_weight = tab[i].w_suf();
+		    count++;
+		  }
+		else
+		  break;
+	      
+	      // drukujemy count pierwszych z tab
+
+
+	      if(one_line)
+		{
+		  char* descp=desc;
+		  for (int i=0; i< count; ++i)
+		    {
+		      descp += sprintf(descp," %s%s,%s", output_field_prefix, tab[i].lemma(), tab[i].descr());
+		      if(weights) descp += sprintf(descp,":%d",(int)tab[i].w_suf());
+		    }
+		  strcpy(outline,line);
+		  outline[strlen(outline)-1]='\0';
+		  strcat(outline,desc);
+		  strcat(outline,"\n");
+		  fputs(outline, outputf);
+		  if (copy_processed)
+		    fputs(line,outputf);
+		}
+	      else if(one_field)
+		{
+		  char* descp=desc;
+		  for (int i=0; i< count; ++i)
+		    if(i==0)
+		      {
+			descp += sprintf(descp," %s%s,%s", output_field_prefix, tab[i].lemma(), tab[i].descr());
+			if(weights) descp += sprintf(descp,":%d",(int)tab[i].w_suf());
+		      }
+		    else
+		      {
+			if(strcmp(tab[i].lemma(),tab[i-1].lemma())==0)
+			  descp += sprintf(descp,",%s",tab[i].descr());
+			else
+			  descp += sprintf(descp,";%s,%s",tab[i].lemma(),tab[i].descr());
+			if(weights) descp += sprintf(descp,":%d",(int)tab[i].w_suf());
+		      }
+		  
+		  strcpy(outline,line);
+		  outline[strlen(outline)-1]='\0';
+		  strcat(outline,desc);
+		  strcat(outline,"\n");
+		  fputs(outline, outputf);
+		  if (copy_processed)
+		    fputs(line,outputf);
+		}
+	      else
+		{
+		  for (int i=0; i< count; ++i)
+		    {
+		      // kolejne opisy - kolejne linie.
+		      char* descp=desc;
+		      descp += sprintf(desc, " %s%s,%s", output_field_prefix, tab[i].lemma(), tab[i].descr());
+		      if(weights) descp += sprintf(descp,":%d",(int)tab[i].w_suf());
+		      descp += sprintf(descp,"\n");
+		      strcpy(outline,line);
+		      outline[strlen(outline)-1]='\0';
+		      strcat(outline,desc);
+		      fputs(outline, outputf);
+		    }
+		  if (copy_processed)
+		    fputs(line,outputf);
+		}
+	    }
+	}
+      if(args.interactive_flag) 
+	fflush(outputf), fflush(failedf);
+      
+    }
+  cmdline_parser_free(&args);
+}
+
+
+
+
+
+
+
+
+// 	      while ((i=tab.next()) != -1 && count++<guess_count) {
+// 		/* if we have "one-line" flag then everything goes in one segment as many fields,
+// 		 * if we have "one-field" flag everything goes in one segment as ONE field:
+// 		 * - diferent lemmas are separated with ';', sequent descriptions to one lemma
+// 		 *   are separated with ','
+// 		 */
+// 		if ((!first) && (tab[i].w_suf() < cut_off) || (tab[i].w_suf() < delta * last_weight)) {
+// 		  break;
+// 		}
+// 		if (first) {
+// 		  parms_end += sprintf(parms_end, "%s", output_field_prefix);
+// 		} else if (!args.one_field_flag)
+// 		  parms_end += sprintf(parms_end, "%s", output_field_prefix);
+		
+// 		if (!args.one_field_flag || strcmp(last_lemma, tab[i].lemma()) != 0) {
+// 		  if (args.one_field_flag && !first)
+// 		    parms_end += sprintf(parms_end, ";");
+// 		  parms_end += sprintf(parms_end, "%s", tab[i].lemma());
+// 		  strcpy(last_lemma, tab[i].lemma());
+// 		}
+		
+// 		first=0;
+		
+// 		last_weight = tab[i].w_suf();
+// 		if (!weights)
+// 		  parms_end += sprintf(parms_end, ",%s:%d",  tab[i].descr(), (int)tab[i].w_suf());
+// 		else
+// 		  parms_end += sprintf(parms_end, ",%s", tab[i].descr());
+		
+// 		if (!args.one_field_flag) {
+// 		  seg.addfield(parms);
+// 		  parms_end = parms;
+// 		}
+		
+// 		if (!(args.one_field_flag || args.one_line_flag)) {
+// 		  seg.print(outline);
+// 		  fputs(outline, outputf);
+// 		  --seg.auxn;
+// 		}
+// 		//if (copy_processed)
+// 		//  fputs(outline, stdout);
+// 	      } //while
+	      
+// 	      if (args.one_field_flag)
+// 		seg.addfield(parms);
+	      
+// 	      if (args.one_field_flag || args.one_line_flag){
+// 		seg.print(outline);
+// 		fputs(outline, outputf);
+// 	      }
+// 	    } else { // if (process_segment)
+// 	    // jak to nie jest wyraz - to przepisz token na wyjscie.
+// 	    //      printtok(line, start, len, cat, form);
+// 	    seg.print(outline);
+// 	    fputs(outline, outputf);
+// 	    if (copy_processed)
+// 	      fputs(outline, stdout);
+// 	  }
+// 	}
+//       time_t end_time = time(NULL);
+//       if (per_info) {
+// 	printf("Liczba sÂ³Ã³w: %d\n", words_count);
+// 	printf("Czas analizy: %d sekund\n", end_time-start_time);
+//       }
+//       cmdline_parser_free(&args);
+//     }
+  
Index: _old/app/src/kor/Makefile
===================================================================
--- _old/app/src/kor/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/kor/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,46 @@
+PAR=-Wno-deprecated -m32 -fpermissive -static
+PAR2=-c -Wno-deprecated -m32 -fpermissive
+LIB_PATH=../lib
+COMMON_PATH=../common
+CMDLINE_FILE='"../kor/cmdline.h"'
+
+
+kor: main.cc corr.o corlist.o cmdline.o $(LIB_PATH)/word.o \
+	$(LIB_PATH)/auttools.o cmdline.c common_cor.o common.o 
+	g++ $(PAR) -D _CMDLINE_FILE=$(CMDLINE_FILE) main.cc corlist.o corr.o common.o \
+	$(LIB_PATH)/word.o $(LIB_PATH)/auttools.o cmdline.c common_cor.o \
+	-o kor
+
+corr.o: corr.cc corr.hh cmdline.h
+	g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) corr.cc
+	
+corlist.o: corlist.cc corlist.h cmdline.h
+	g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) corlist.cc
+	
+
+
+common.o: cmdline.h $(COMMON_PATH)/cmdline_common.ggo $(COMMON_PATH)/common.cc \
+	 $(COMMON_PATH)/common.h
+	g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) $(COMMON_PATH)/common.cc
+
+common_cor.o: cmdline.h common_cor.cc common_cor.h
+	g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) common_cor.cc
+
+cmdline.c cmdline.h: cmdline.ggo
+	gengetopt -i cmdline.ggo --conf-parser
+
+cmdline.ggo: cmdline_cor.ggo $(COMMON_PATH)/cmdline_common.ggo
+	cat cmdline_cor.ggo $(COMMON_PATH)/cmdline_common.ggo > cmdline.ggo
+
+copy:
+ifdef UTT_BIN_DIR
+	cp kor ${UTT_BIN_DIR}
+endif
+
+clean: clean.cmdline
+	rm *.o || true
+	rm kor || true
+
+clean.cmdline:
+	rm cmdline.* || true
+
Index: _old/app/src/kor/cmdline_cor.ggo
===================================================================
--- _old/app/src/kor/cmdline_cor.ggo	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/kor/cmdline_cor.ggo	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,13 @@
+package "kor"
+version "0.1"
+
+option "dictionary-home"	-	"Dictionary home dir." string typestr="FILENAME" no hidden
+option "dictionary"		d	"Dictionary" string typestr="FILENAME" default="cor.bin" no
+option "distance"		D	"Maximal edit distance." int default="1" no
+option "replace"		r	"Replace original form with corrected form, place original form in the cor field. This option has no effect in single mode" flag off
+#option "single"			-	"Place all alternatives in the same line" flag off
+option "weights"		w	"File with translation rules." string typestr="FILENAME" default="weight.cor" no
+option "threshold"		t	"Edit distance threshold" float default="1" no
+option "show-scores"		-	"Show scores" flag off
+option	"count"			n	"Print only count best results" int no
+
Index: _old/app/src/kor/common_cor.cc
===================================================================
--- _old/app/src/kor/common_cor.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/kor/common_cor.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,48 @@
+#include <stdlib.h>
+#include <string.h>
+#include "common_cor.h"
+
+#define MAX_PATH_LENGTH 255
+
+char dictionary[MAX_PATH_LENGTH];
+char file_weights[MAX_PATH_LENGTH];
+float threshold;
+bool show_scores = false;
+int result_count;
+
+void process_cor_options(gengetopt_args_info* args)
+{
+  if(args->dictionary_given)
+    {
+      expand_path(args->dictionary_arg,dictionary);
+      if(file_accessible(dictionary)!=0)
+	{
+	  fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary);
+	  exit(1);
+	}
+    }
+  else if (args->dictionary_home_given && args->language_given)
+    {
+      char buf[MAX_PATH_LENGTH];
+      expand_path(args->dictionary_home_arg, buf);
+      sprintf(dictionary,"%s/%s/cor.bin",buf,args->language_arg);
+      if(file_accessible(dictionary)!=0)
+	{
+	  fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary);
+	  exit(1);
+	}
+    }
+  
+  expand_path(args->weights_arg, file_weights);
+  
+  threshold = args->threshold_arg;
+
+  show_scores = args->show_scores_flag;
+
+  if(args->count_given) {
+    result_count = args->count_arg;
+  }
+  else {
+    result_count = 0;
+  }
+}
Index: _old/app/src/kor/common_cor.h
===================================================================
--- _old/app/src/kor/common_cor.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/kor/common_cor.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,25 @@
+#ifndef __COMMON_COR_H
+#define __COMMON_COR_H
+
+// SEKCJA STALYCH
+
+#define MAX_LEN 2
+#define PREC 1000
+#define Weight int
+
+// SEKCJA INCLUDOW
+#include "../common/common.h"
+#include "cmdline.h"
+
+
+// SEKCJA GENGETOPT
+extern int change_count;
+extern void process_cor_options(gengetopt_args_info* args);
+extern char dictionary[];
+extern char file_weights[];
+extern float threshold;
+extern bool show_scores;
+extern int result_count;
+
+#endif
+
Index: _old/app/src/kor/corlist.cc
===================================================================
--- _old/app/src/kor/corlist.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/kor/corlist.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,70 @@
+#include <stdio.h>
+#include <malloc.h>
+#include "corlist.h"
+
+#define min(x,y) ((x<y)?(x):(y))
+
+
+Weight CorList::GetValue(char X[100], char Y[100], Weight (*H2)[100], int i, int j)
+{
+  Weight R = 9999*PREC;  // (+nieskonczonosc)
+  int n;
+  
+  for (n=0; n<total; n++)
+  {
+    int la = List[n].la;
+    int lb = List[n].lb;
+    if (la<=i+1 && lb<=j+1)
+      if (strncmp(List[n].a,X+i+1-la,la)==0 && strncmp(List[n].b,Y+j+1-lb,lb)==0) 
+        R = min(R,H2[i-la][j-lb]+List[n].w);
+    if (la<=j+1 && lb<=i+1)
+      if (strncmp(List[n].b,X+i+1-lb,lb)==0 && strncmp(List[n].a,Y+j+1-la,la)==0) 
+        R = min(R,H2[i-lb][j-la]+List[n].w);
+  }
+  return R;
+}
+
+
+int CorList::loadCWL(char *Name)
+{
+  FILE *f = fopen(Name,"r");
+  int len=MAX_LEN*2+100;
+  char a[100],b[100], buf[len+1];
+  float wtmp;
+  CorWeight w;
+  
+  cor_stdcor = 1 * PREC;
+  cor_xchg   = 1 * PREC;
+  
+  List = (CorWeight*)malloc(sizeof(CorWeight));  // 100 BO NIE DZIALA REALLOC
+  total=0;
+  
+  if (!f) { fprintf(stderr,"\nCan't open correction weight list file!\n"); return -1; }
+  while (!feof(f) && fgets(buf,len,f))
+  {
+    if (buf[0]=='%')
+     {
+      sscanf(buf+1,"%s %f",&a,&wtmp);
+      int ok=0;
+      if (strcmp(a,"stdcor")==0) { ok=1; cor_stdcor=Weight(wtmp*PREC); /*printf("Standard letter correction set to: %1.2f\n",wtmp);*/ }
+      if (strcmp(a,"xchg")==0) { ok=1; cor_xchg=Weight(wtmp*PREC); /*printf("Inverted letters correction set to: %1.2f\n",wtmp);*/ }
+      if (!ok) { fprintf(stderr,"Error in file %s: Unknown keyword: '%s'.\n",Name,a); return -1; }
+     }
+    else
+     { 
+      sscanf(buf,"%s %s %f",&a,&b,&wtmp);
+      w.w=(Weight)(wtmp*PREC);
+      w.la=strlen(a); w.lb=strlen(b);
+      if (w.la>MAX_LEN) { printf("ERROR in file %s: the string '%s' exceeds maximum length of %d characters.\n",Name,a,MAX_LEN); fclose(f); return -1; }
+      if (w.lb>MAX_LEN) { printf("ERROR in file %s: the string '%s' exceeds maximum length of %d characters.\n",Name,b,MAX_LEN); fclose(f); return -1; }
+      strcpy(w.a,a), strcpy(w.b,b);
+      total++;
+      List = (CorWeight*)realloc(List,total*sizeof(CorWeight));
+      List[total-1]=w;
+      //      printf("%s\t<->\t%s\t%1.2f\n",w.a,w.b,((float)w.w/PREC));
+     }
+  }
+  fclose(f);
+  //  printf("Total: %d\n\n",total);
+  return(total);
+}
Index: _old/app/src/kor/corlist.h
===================================================================
--- _old/app/src/kor/corlist.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/kor/corlist.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,20 @@
+#ifndef _CORLIST_H
+#define _CORLIST_H
+
+//#include <stdio.h>
+#include "common_cor.h"
+
+typedef struct { char a[MAX_LEN+1],b[MAX_LEN+1]; Weight w; short la,lb; } CorWeight;
+
+class CorList
+{
+ private:
+   CorWeight *List;
+   int total;
+ public:
+   Weight cor_stdcor, cor_xchg;
+   int loadCWL(char *Name);
+   Weight GetValue(char X[100], char Y[100], Weight (*H2)[100], int i, int j);
+};
+
+#endif
Index: _old/app/src/kor/corr.cc
===================================================================
--- _old/app/src/kor/corr.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/kor/corr.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,163 @@
+//---------------------------------------------------------------------------
+#include "common_cor.h"
+#include "corr.hh"
+
+#define MAXPATH 256
+
+#define min(x,y) ((x<y)?(x):(y))
+#define max(x,y) ((x>y)?(x):(y))
+
+
+Weight Corr::ed(int i,int j)
+{
+  if(i==-1)
+    return (j+1)*CL.cor_stdcor;  // moje*  Nie wiem czy tak bêdzie dobrze, ale uzna³em, ¿e poza tablic¹ powinny byæ wartosci przemno¿one przez wagê standardowej zmiany litery
+  if(j==-1)
+    return (i+1)*CL.cor_stdcor;  // moje*
+  if(i==-2 || j==-2)
+    return (n+1)*CL.cor_stdcor;  // moje*
+
+  if(X[i]==Y[j])
+    return min(H2[i-1][j-1], min(CL.cor_stdcor+min(H2[i][j-1],H2[i-1][j]),CL.GetValue(X,Y,H2,i,j)));
+  if(X[i-1]==Y[j] && X[i]==Y[j-1])
+    return min(min(CL.cor_xchg+H2[i-2][j-2],CL.cor_stdcor+min(H2[i][j-1],H2[i-1][j])), CL.GetValue(X,Y,H2,i,j));
+  return min(CL.cor_stdcor+min(H2[i-1][j-1],min(H2[i][j-1],H2[i-1][j])), CL.GetValue(X,Y,H2,i,j));
+
+/*  // wersja z wagami ale dla floatów
+  if(X[i]==Y[j])//zielone->      <-      niebieskie       ->  <-      rózowe        ->
+    return min(H2[i-1][j-1], min(1+min(H2[i][j-1],H2[i-1][j]),CL.GetValue(X,Y,H2,i,j)));
+  if(X[i-1]==Y[j] && X[i]==Y[j-1])
+    return min(1+min(H2[i-2][j-2],min(H2[i][j-1],H2[i-1][j])), CL.GetValue(X,Y,H2,i,j));
+  return min(1+min(H2[i-1][j-1],min(H2[i][j-1],H2[i-1][j])), CL.GetValue(X,Y,H2,i,j));
+*/
+
+/*  // normalna wersja
+  if(X[i]==Y[j])
+    return H2[i-1][j-1];
+  if(X[i-1]==Y[j] && X[i]==Y[j-1])
+    return 1+min(H2[i-2][j-2],min(H2[i][j-1],H2[i-1][j]));
+  return 1+min(H2[i-1][j-1],min(H2[i][j-1],H2[i-1][j]));
+*/
+
+/*
+  if(X[i]==Y[j])
+    return H[(i-1)+2][(j-1)+2];
+  if(X[i-1]==Y[j] && X[i]==Y[j-1])
+    return 1+min(H[(i-2)+2][(j-2)+2],min(H[(i)+2][(j-1)+2],H[(i-1)+2][(j)+2]));
+  return 1+min(H[(i-1)+2][(j-1)+2],min(H[(i)+2][(j-1)+2],H[(i-1)+2][(j)+2]));
+*/
+}
+
+int Corr::load2(char *Name)  // moje
+{
+  return CL.loadCWL(Name);
+}
+
+Weight Corr::cuted(int j)
+{
+  int l=max(0,j-t);
+  int u=min(m,j+t);
+  Weight ce=(j+t)*PREC;   // moje*
+  for(int k=l;k<=u;k++)
+  {
+    if(H2[k][j]<ce)//if(H[(k)+2][(j)+2]<ce)
+      ce=H2[k][j];//ce=H[(k)+2][(j)+2];
+  }
+  return ce;
+}
+
+/*
+void Corr::recomputeH(int j)
+{
+  for(int i=0;i<=m;i++)
+    H[(i)+2][(j)+2]=ed(i,j);
+}
+*/
+
+void Corr::recomputeH(int j)
+{
+  int lo=max(0,j-t-2); 
+  int hi=min(m,j+t+2); 
+  for(int i=lo;i<=hi;++i)
+    H2[i][j]=ed(i,j);//H[(i)+2][(j)+2]=ed(i,j);
+}
+
+
+int Corr::correct(const char* w, Words& tab)
+{
+  long int path[MAXPATH]={0};
+  int i;                                    // row index (X)
+  int j;                                    // column index (Y)
+  long state=0;
+
+  strcpy(X,w);
+  m=strlen(X)-1;
+  n=m+t;
+
+  for(i=(-2);i<=m;i++)
+    H[(i)+2][(-2)+2]=n*PREC;  // moje *PREC
+  for(i=(-1);i<=m;i++)
+    H[(i)+2][(-1)+2]=((i)+1)*PREC; // moje*
+  for(j=(-2);j<=n;j++)
+    H[(-2)+2][(j)+2]=n*1000;  // moje*
+  for(j=(-1);j<=n;j++)
+    H[(-1)+2][(j)+2]=((j)+1)*PREC;  // moje*
+
+  for(j=0; j<=n; ++j)
+    for(i=0; i<=m; ++i)
+      H[i+2][j+2]=(t+1)*PREC;
+
+  int more=1;
+  bool cont=false;
+
+  strcpy(Y,"");
+  j=0;
+  state=0;
+  int count=0;
+  while(more)
+  {
+    if(!empty(state))
+    {
+      Y[j]=input(state);
+      recomputeH(j);
+      if(cuted(j)<=t)
+      {
+        Weight edd;  // moje 
+        if(final(next(state)) && (edd=H[(m)+2][(j)+2])<=t)
+        {
+          char* out=new char[j+2];
+          strncpy(out,Y,j+1);
+          out[j+1]='\0';
+          //          if(cont) putchar(' ');
+          cont=true;
+	  //	            printf("%1.2f %s\n", (float)edd/PREC,out);  // moje
+	  //          cout << out << "(" << edd << ")" << endl;
+		    tab.add(out,(float)edd/PREC);
+	  count++;
+        }
+        path[j++]=state;
+        state=next(state);
+        continue;
+      }
+      else
+        if(continued(state))
+        {
+          state++;
+          continue;
+        }
+    }
+    //backtracking
+    do
+      if(j>0)
+        j--;
+      else
+        more=0;
+    while(more && !continued(path[j]));
+    state=path[j]+1;
+  }
+  return count;
+}
+
+
+//---------------------------------------------------------------------------
+
Index: _old/app/src/kor/corr.hh
===================================================================
--- _old/app/src/kor/corr.hh	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/kor/corr.hh	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,39 @@
+//---------------------------------------------------------------------------
+#ifndef _corr_hh
+#define _corr_hh
+//---------------------------------------------------------------------------
+
+#include "../lib/tfti.h"
+#include "../lib/word.h"
+#include "corlist.h"
+#include "../common/common.h"
+
+class Corr : public TFTiv<char,char>
+{
+private:
+  Weight H[100][100];
+  char X[100];                         // misspelled string
+  char Y[100];                         // (possibly partial) candidate string
+  int m;                               // length of X
+  int n;                               // maximal length of Y
+
+  Weight ed(int,int);
+  Weight cuted(int);
+  void recomputeH(int);
+
+
+public:
+  Weight (*H2)[100];   // moje: zmiana z int na Weight (float)
+  int t;                               // threshold
+  CorList CL;  // moje
+
+  Corr() : H2((Weight(*)[100])&H[2][2]) {};   // moje (int->float)
+  Corr(const char* a) : TFTiv<char,char>(a), H2((Weight(*)[100])&H[2][2]) { };
+
+  int correct(const char* w, Words& tab);
+  
+  int load2(char *Name);  // moje
+};
+
+//---------------------------------------------------------------------------
+#endif
Index: _old/app/src/kor/main.cc
===================================================================
--- _old/app/src/kor/main.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/kor/main.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,174 @@
+#include <stdlib.h>
+#include <ctype.h>
+#include "../lib/iotools.h"
+#include "common_cor.h"
+#include "corr.hh"
+#include <locale.h>
+
+
+int main(int argc, char** argv) {
+
+//   setlocale(LC_CTYPE,"");
+//   setlocale(LC_COLLATE,"");
+
+  gengetopt_args_info args;
+
+  if(cmdline_parser(argc, argv, &args) != 0)
+    exit(1);
+
+  process_config_files(&args,argv[0]);
+  process_common_options(&args,argv[0]);
+  process_cor_options(&args);
+
+  Corr cor;
+
+  //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//  strcpy(dictionary,"cor.bin");
+
+  cor.load(dictionary);
+  cor.t=args.distance_arg;
+
+  //>>>>>>>>>>>>>>>
+  cor.CL.cor_stdcor=1*PREC;
+  cor.CL.cor_xchg=1*PREC;
+  if (cor.load2(file_weights)==-1) return -1;  // moje
+  cor.t=1*PREC; // ODLEGLOSC EDYCYJNA
+  //<<<<<<<<<<<<<<
+
+  char line[MAX_LINE+1];
+  long line_count = 0;
+
+  Segment seg;
+  Words tab;
+  char form1[MAX_LINE];
+  char* form;
+  int formcasing;
+  char corfield[MAX_LINE]="";
+
+  while (fgets(line, MAX_LINE, inputf))
+    {
+      ++line_count;
+      char outline[128];
+
+      if (!process_seg(line, args))
+	fputs(line, outputf);
+      else
+	{
+	  char form[MAX_FORM];
+	  
+	  tab.clear();
+	  getfield(line,input_field_prefix,form);
+	  if (form==NULL) continue;
+	  
+	  formcasing=3;
+	  cor.correct(form, tab);
+	  
+	  if( tab.count() == 0 )
+	    {
+	      formcasing=casing(form);
+	      if( formcasing == 1 || formcasing == 2)
+		tolowers(form, form1), cor.correct(form1, tab);
+	    }
+	  
+	  if ( tab.count() == 0)
+	    fputs(line, failedf);
+	  else 
+	    {
+	      	      tab.sort();
+
+		int max_cnt = 0;
+		if(result_count < 1) {
+			max_cnt = tab.count();
+		}
+		else {
+			max_cnt = (tab.count() < result_count) ? tab.count() : result_count;
+		}
+		
+	      if(args.replace_flag)
+		{
+		  char corfield[128];
+		  strcpy(corfield, input_field_prefix);
+		  strcat(corfield, form);
+		  seg.aux[seg.auxn]=corfield;
+		  ++seg.auxn;
+		  for(int i=0; i<tab.count(); ++i)
+		    {
+		      seg.form=tab[i].form();
+		      restorecasing(seg.form,seg.form,formcasing);
+		      seg.print(outline);
+		      fputs(outline, outputf);
+		    }
+		  --seg.auxn;
+		}
+	      else
+		{
+		  if(one_line)
+		    {
+		      char* p=corfield;
+		      for(int i=tab.count()-1; i >= tab.count()-max_cnt; --i)
+			{
+			  if(tab[i].w_suf() > threshold) continue;
+			  restorecasing(tab[i].form(),tab[i].form(),formcasing);
+			  p += sprintf(p," %s%s",output_field_prefix,tab[i].form());
+			  if(show_scores) {
+			    p += sprintf(p,",%1.2f",tab[i].w_suf());
+			  }
+			}
+		      sprintf(p,"\n");
+
+		      strcpy(outline,line);
+		      outline[strlen(outline)-1]='\0';
+		      strcat(outline,corfield);
+		      fputs(outline, outputf);
+		    }
+		  else if(one_field)
+		    {
+		      char* p=corfield;
+		      p += sprintf(p," %s",output_field_prefix);
+		      for(int i=tab.count()-1; i >= tab.count()-max_cnt; --i)
+			{
+			  if(tab[i].w_suf() > threshold) continue;
+			  restorecasing(tab[i].form(),tab[i].form(),formcasing);
+			  p += sprintf(p,(i==0)?"%s":";%s",tab[i].form());
+			  if(show_scores) {
+			    p += sprintf(p,",%1.2f",tab[i].w_suf());
+			  }
+			}
+		      
+		      sprintf(p,"\n");
+
+		      strcpy(outline,line);
+		      outline[strlen(outline)-1]='\0';
+		      strcat(outline,corfield);
+		      fputs(outline, outputf);
+		    }
+		  else
+		    {
+		      for(int i=tab.count()-1; i >= tab.count()-max_cnt; --i)
+			{
+			  if(tab[i].w_suf() > threshold) continue;
+			  restorecasing(tab[i].form(),tab[i].form(),formcasing);
+			  char* p = corfield;
+			  p += sprintf(p," %s%s",output_field_prefix,tab[i].form());
+			  if(show_scores) {
+				p += sprintf(p,",%1.2f",tab[i].w_suf());
+			  }
+			  p += sprintf(p, "\n");
+			  strcpy(outline,line);
+			  outline[strlen(outline)-1]='\0';
+			  strcat(outline,corfield);
+			  fputs(outline, outputf);
+			}
+		    }
+		}
+	    }
+	}
+      
+      if(args.interactive_flag)
+	{
+        fflush(outputf);
+        fflush(failedf);
+      }
+    }
+  cmdline_parser_free(&args);
+}
Index: _old/app/src/lem/Makefile
===================================================================
--- _old/app/src/lem/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/lem/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,56 @@
+PAR=-Wno-deprecated -m32 -O3 -fpermissive -static
+PAR2=-c -Wno-deprecated -m32 -O3 -fpermissive -static
+LIB_PATH=../lib
+COMMON_PATH=../common
+CMDLINE_FILE='"../lem/cmdline.h"'
+
+
+lem: main.cc lem.o  $(LIB_PATH)/auttools.o $(LIB_PATH)/word.o \
+      cmdline.c common_lem.o common.o symtab.o
+	g++ $(PAR) -D _CMDLINE_FILE=$(CMDLINE_FILE) \
+	main.cc lem.o $(LIB_PATH)/auttools.o \
+	$(LIB_PATH)/word.o cmdline.c common.o common_lem.o \
+	symtab.o -o lem
+
+lem.o: lem.h lem.cc
+	g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) lem.cc
+
+# alphabet.o: $(LIB_PATH)/alphabet.h $(LIB_PATH)/alphabet.cc
+# 	g++ $(PAR2) $(LIB_PATH)/alphabet.cc
+
+# auttools.o: $(LIB_PATH)/auttools.h $(LIB_PATH)/auttools.cc
+# 	g++ $(PAR2) $(LIB_PATH)/auttools.cc
+
+# word.o: $(LIB_PATH)/word.h $(LIB_PATH)/word.cc
+# 	g++ $(PAR2) $(LIB_PATH)/word.cc
+
+# erro.o: $(LIB_PATH)/erro.h $(LIB_PATH)/erro.cc
+# 	g++ $(PAR2) $(LIB_PATH)/erro.cc
+
+common.o: $(COMMON_PATH)/cmdline_common.ggo $(COMMON_PATH)/common.cc \
+	 $(COMMON_PATH)/common.h
+	g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) $(COMMON_PATH)/common.cc
+
+common_lem.o: cmdline.h common_lem.h common_lem.cc
+	g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) common_lem.cc
+
+cmdline.c cmdline.h: cmdline.ggo
+	gengetopt -i cmdline.ggo --conf-parser
+
+cmdline.ggo: cmdline_lem.ggo ../common/cmdline_common.ggo
+	cat cmdline_lem.ggo ../common/cmdline_common.ggo > cmdline.ggo
+
+symtab.o: $(LIB_PATH)/symtab.h $(LIB_PATH)/symtab.cc
+	g++ $(PAR2) $(LIB_PATH)/symtab.cc
+
+clean: clean.cmdline
+	rm *.o || true
+	rm lem || true
+
+clean.cmdline:
+	rm cmdline.* || true
+
+copy:
+ifdef UTT_BIN_DIR
+	cp lem $(UTT_BIN_DIR)
+endif
Index: _old/app/src/lem/cmdline_lem.ggo
===================================================================
--- _old/app/src/lem/cmdline_lem.ggo	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/lem/cmdline_lem.ggo	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,5 @@
+package "lem"
+version "0.1"
+
+option "dictionary-home"	-	"D.h." string typestr="FILENAME" hidden no
+option "dictionary"		d	"Dictionary" string typestr="FILENAME" default="lem.bin" no
Index: _old/app/src/lem/common_lem.cc
===================================================================
--- _old/app/src/lem/common_lem.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/lem/common_lem.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,51 @@
+#include <stdlib.h>
+#include <string.h>
+#include "common_lem.h"
+
+char dictionary[255];
+
+void process_lem_options(gengetopt_args_info* args)
+{
+
+  if(args->dictionary_given)
+    {
+      expand_path(args->dictionary_arg,dictionary);
+      if(file_accessible(dictionary)!=0)
+	{
+	  fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary);
+	  exit(1);
+	}
+    }
+  else if (args->dictionary_home_given && args->language_given)
+    {
+      char buf[255];
+      expand_path(args->dictionary_home_arg, buf);
+      sprintf(dictionary,"%s/%s/lem.bin",buf,args->language_arg);
+      if(file_accessible(dictionary)!=0)
+	{
+	  fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary);
+	  exit(1);
+	}
+    }
+}
+
+
+// STARE
+//  if(args.dictionary_given)
+//    strcpy(dictionary, args.dictionary_arg);
+//  else {
+//     char path[256];
+//     //sprintf(path, "/etc/utt/data/%s/%s", args.locale_arg, DICT_FILE);
+//     //if (file_accessible(path) == 0)
+//     //  strcpy(dictionary, path);
+//     //else {
+//       sprintf(path, "%s/%s", utt_dir, DICT_FILE);
+//       if (file_accessible(path) == 0)
+// 	strcpy(dictionary, path);
+//       else {
+// 	fprintf(stderr, "Cannot find dictionary!\n");
+// 	exit(1);
+//       }
+//       //}
+//   }
+
Index: _old/app/src/lem/common_lem.h
===================================================================
--- _old/app/src/lem/common_lem.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/lem/common_lem.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,15 @@
+#ifndef __COMMON_LEM__H
+#define __COMMON_LEM__H
+
+#include <stdio.h>
+#include "../common/common.h"
+
+#include "cmdline.h"
+
+#define DICT_FILE "lem.bin"
+
+extern char dictionary[];
+
+extern void process_lem_options(gengetopt_args_info* args);
+
+#endif
Index: _old/app/src/lem/lem.cc
===================================================================
--- _old/app/src/lem/lem.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/lem/lem.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,153 @@
+#include "lem.h"
+
+#include <stdlib.h>
+#include <assert.h>
+
+
+/* Znajduje opisy slownikowe dla wyrazu.
+ * Parametry:
+ * form - wyraz,
+ * tab - referencja do tablicy Words (miejsce na wyniki)
+ * Wartosc:
+ * liczba dodanych opisow
+ */
+int Lem::ana(const char* form, Words& tab) {
+
+  // sprawdzamy czy parametry wywolania sa poprawne
+  assert(form && &tab);
+  int count0 = tab.count();
+  long l;
+  if ((l=_dict.next(_dict.gtra(0, form, FT::ftMAXPATH), ';'))>=0)
+    add_to_table(tab, form, l);
+  return tab.count()-count0;
+}
+
+
+/* Szukamy opisu slownikowego nastepnego wyrazu w buforze.
+ * Parametry:
+ * buf - bufor
+ * tab - miejsce na wyniki
+ * Wartosc:
+ * ilosc dodanych opisow
+ */
+int Lem::pref(char* buf, Words& tab) {
+
+  // sprawdzamy czy parametry wywolania sa poprawne
+  assert(buf && &tab);
+
+  int count0 = tab.count();
+  long l;
+  char* buf0 = buf;
+
+  if((l=_dict.pref(buf, ';'))>=0) {
+    char form[MAX_FORM];
+    int len=buf-buf0;
+    form[len]='\0';
+    add_to_table(tab,form,l);
+  }
+  return tab.count() - count0;
+}
+
+/* Dodaje kolejne opisy do tablicy wynikow.
+ * Parametry:
+ * tab - tablica wynikow,
+ * f - wyraz,
+ * s - stan, na ktorym zaczyna sie pierwszy opis
+ */
+void Lem::add_to_table(Words& tab, const char* f, long s) {
+
+  // sprawdzenie parametrow
+  assert(&tab);
+  assert(f);
+
+  char des[FT::ftMAXPATH];
+
+  while (_dict.cont(s, des)) {
+    char* des1;
+    if ((des1=strtok(des, ";")) != NULL)
+      do {
+	if (tab.count() >= MAX_ALT) break;
+	tab.add(f, des1);
+	des1=strtok(NULL, ";");
+      } while (des1!=NULL);
+    s=-1;
+  }
+}
+
+void Lem::prn_dict()
+{
+ 
+  char des[FT::ftMAXPATH];
+
+  long s=0;
+
+  while (_dict.cont(s, des)) 
+    {
+      printf("%s\n",des);
+      s=-1;
+    }
+}
+
+
+AuxLem::AuxLem(const char* filename)
+        : Lem(), _dict(SIZE)
+{
+  FILE* f;
+  char buf[MAX_LINE+2];
+  f=fopen(filename,"r");
+  for(long i=0; i<SIZE; ++i) info[i]=(char*)NULL;
+  while(fgets(buf,MAX_LINE,f))
+  {
+    int l=strlen(buf);
+    if(l>=MAX_LINE-1) continue; // BEZ isalpha!
+    buf[l-1]='\0';
+    char* sep=strchr(buf,';');
+    if(sep==NULL) continue;
+    *sep='\0';
+    long formind=_dict.add(buf);
+    if(formind>=0)
+    {
+      char* desc=strdup(sep+1);
+      info[formind]=desc;
+    }
+    else
+      fprintf(stderr,"AuxLem: Form not added: %s;%s.\n", buf,sep+1);
+  }
+  fclose(f);
+};
+
+//---------------------------------------------------------------------------
+
+AuxLem::~AuxLem()
+{
+//  for(long i=0; i<_dict.count(); ++i)
+//    free(info[_dict.hashindex(i)]);
+  for(long i=0; i<SIZE; ++i)
+    if(info[i]) free(info[i]);
+}
+
+//---------------------------------------------------------------------------
+
+int AuxLem::ana(const char* form, Words& tab)
+{
+  if(!form) return 0;
+  int count0=tab.count();
+  char des[MAX_LINE];
+  long ind=_dict[form];
+  if(ind>=0)
+  {
+    strcpy(des,info[ind]);
+    char* des1;
+    if((des1=strtok(des,";"))!=NULL)
+      do
+      {
+        if(tab.cnt>=MAXALT) break;
+        tab.add(form,des1);
+        des1=strtok(NULL,";");
+      } while(des1!=NULL);
+  }
+  return tab.count()-count0;
+}
+
+//---------------------------------------------------------------------------
+
Index: _old/app/src/lem/lem.h
===================================================================
--- _old/app/src/lem/lem.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/lem/lem.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,50 @@
+#include "../lib/tfti.h"
+#include "../lib/word.h"
+#include "../lib/symtab.h"
+#include "../lib/const.h"
+
+class Lem {
+
+ protected:
+  //  Alphabet& _alpha;
+
+  // slownik
+  TFTiv<char,char> _dict;
+
+  void add_to_table(Words& tab, const char* f, long s);
+
+ public:
+
+  Lem() {};
+  Lem(const char* d)
+    : _dict(d) {};
+  virtual int ana(const char* form, Words& tab);
+  int pref(char* form, Words& tab);
+  void prn_dict();
+
+};
+
+
+class AuxLem : public Lem {
+public:
+
+  static const int SIZE=1500000;
+  //  static const int MAXLINE=1000;
+  static const int MAXALT=256;
+
+  AuxLem(const char* filename);
+  ~AuxLem();
+
+//  int ana(const char* form, Grams& tab);
+  int ana(const char* form, Words& tab);
+
+//  operator bool() { return _dict && info; }
+
+private:
+  SymbolTable _dict;
+  char* info[SIZE];
+
+};
+
+
+
Index: _old/app/src/lem/main.cc
===================================================================
--- _old/app/src/lem/main.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/lem/main.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,131 @@
+#include "../lib/iotools.h"
+//do wyrzucenia - definicja w Makefile! #define _CMDLINE_FILE "../lem/cmdline.h"
+#include "../common/common.h"
+#include "common_lem.h"
+#include "lem.h"
+#include "cmdline.h"
+#include <locale.h>
+
+int main(int argc, char** argv) {
+
+//   setlocale(LC_CTYPE,""); //PO CO TO?
+//   setlocale(LC_COLLATE,""); //
+
+  gengetopt_args_info args;
+
+  if(cmdline_parser(argc, argv, &args) != 0)
+    exit(1);
+
+  process_config_files(&args,argv[0]);
+  process_common_options(&args,argv[0]);
+  process_lem_options(&args);
+  
+  char line[MAX_LINE+1];
+  char outline[MAX_LINE+1];
+  char parms[MAX_LINE+1], desc[MAX_LINE+1], lemma[MAX_LINE+1];
+  long line_count = 0;
+
+  Lem* lem;
+  
+  if(strcmp(dictionary+strlen(dictionary)-4,".bin")==0)
+    lem = new Lem(dictionary);
+  else if(strcmp(dictionary+strlen(dictionary)-4,".dic")==0)
+    lem = new AuxLem(dictionary);
+  else
+    fprintf(stderr,"lem: Invalid dictionary file extension.\n");
+
+  Words tab;
+//   Segment seg;
+
+  while (fgets(line, MAX_LINE, inputf))
+    {
+      ++line_count;
+      int start, len;
+      
+      if (!process_seg(line, args)) // TO POWINNO BYC WCZESNIEJ ZABEZPIECZONE
+	fputs(line, outputf);
+      else
+	{
+	  char form[MAX_FORM];
+
+	  tab.clear();
+	  getfield(line,input_field_prefix,form);
+	  
+	  if (form==NULL) continue;//BZDURA
+	  
+	  lem->ana(form, tab);
+	  if(tab.count()==0)
+	    {
+	      char form1[MAX_FORM]; // tymczasowo tak, trzeba zmienic ana
+	      char* p;
+	      strcpy(form1,form);
+	      for(p=form1;*p;++p) *p=tolower(*p);
+	      p=form1;
+	      lem->ana(p,tab);
+	    }
+	  
+	  if (tab.count() == 0) 
+	    fputs(line, failedf);
+	  else 
+	    { // mamy jakies opisy w slowniku
+	      
+	      if(one_line)
+		{
+		  char* descp=desc;
+		  for (int i=0; i< tab.count(); ++i)
+		    {
+		      descp += sprintf(descp," %s%s,%s", output_field_prefix, tab[i].lemma(), tab[i].descr());
+		    }
+		  strcpy(outline,line);
+		  outline[strlen(outline)-1]='\0';
+		  strcat(outline,desc);
+		  strcat(outline,"\n");
+		  fputs(outline, outputf);
+		  if (copy_processed)
+		    fputs(line,outputf);
+		}
+	      else if(one_field)
+		{
+		  char* descp=desc;
+		  for (int i=0; i< tab.count(); ++i)
+		    if(i==0)
+		      descp += sprintf(descp," %s%s,%s", output_field_prefix, tab[i].lemma(), tab[i].descr());
+		    else
+		      {
+			if(strcmp(tab[i].lemma(),tab[i-1].lemma())==0)
+			  descp += sprintf(descp,",%s",tab[i].descr());
+			else
+			  descp += sprintf(descp,";%s,%s",tab[i].lemma(),tab[i].descr());
+		      }
+		  
+		  strcpy(outline,line);
+		  outline[strlen(outline)-1]='\0';
+		  strcat(outline,desc);
+		  strcat(outline,"\n");
+		  fputs(outline, outputf);
+		  if (copy_processed)
+		    fputs(line,outputf);
+		}
+	      else
+		{
+		  for (int i=0; i< tab.count(); ++i)
+		    {
+		      // kolejne opisy - kolejne linie.
+		      sprintf(desc, " %s%s,%s\n", output_field_prefix, tab[i].lemma(), tab[i].descr());
+		      strcpy(outline,line);
+		      outline[strlen(outline)-1]='\0';
+		      strcat(outline,desc);
+		      fputs(outline, outputf);
+		    }
+		  if (copy_processed)
+		    fputs(line,outputf);
+		}
+	    } 
+	}
+      
+      if(args.interactive_flag) 
+	fflush(outputf), fflush(failedf);
+      
+    }
+  cmdline_parser_free(&args);
+}
Index: _old/app/src/lib/Makefile
===================================================================
--- _old/app/src/lib/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/lib/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,21 @@
+PAR=-Wno-deprecated -m32 -O3
+PAR2=-c -Wno-deprecated -m32 -O3 -fpermissive
+# -static
+LIB_PATH=../lib
+COMMON_PATH=../common
+
+main: auttools.o word.o copy
+
+auttools.o: auttools.h auttools.cc
+	g++ $(PAR2) auttools.cc
+
+word.o: word.h word.cc
+	g++ $(PAR2) word.cc
+
+clean:
+	rm *.o
+
+copy:
+#ifdef UTT_LIB_DIR
+#	cp -r perl $(UTT_LIB_DIR)/
+#endif
Index: _old/app/src/lib/auttools.cc
===================================================================
--- _old/app/src/lib/auttools.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/lib/auttools.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,164 @@
+#include "auttools.h"
+//#include "/src/cpp-comm/plx/Plx.h"
+
+void fullform(const char* b, const char* d, char* f)
+{
+  int i,j=0;
+  int n1, n2=0;
+  bool g=false;
+  char s1[200], s2[200], temps[200];
+  while(d[j]>='0' && d[j]<='9')j++;
+  strncpy(temps,d,j); temps[j]='\0';
+  n1=atoi(temps);
+  i=j;
+  while(!ispunct(d[j]) || d[j]=='*') j++;
+  strncpy(s1,d+i,j-i);
+  s1[j-i]='\0';
+  if(d[j++]=='-')
+  {
+    i=j;
+    while(d[j]>='0' && d[j]<='9')j++;
+    strncpy(temps,d+i,j-i); temps[j]='\0';
+    n2=atoi(temps);
+    i=j;
+    while(!ispunct(d[j]) || d[j]=='*') j++;
+    strncpy(s2,d+i,j-i);
+    s2[j-i]='\0';
+    g=true;
+  }
+
+  int blen=strlen(b);
+  if(g)
+    if(n1+n2<=blen)
+    {
+      strcpy(f,s1);
+      strcat(f,b+n1);
+      f[strlen(f)-n2]='\0';
+      strcat(f,s2);
+    }
+    else
+      strcpy(f,"<ERR>");
+  else
+    if(n1<=blen)
+    {
+      strcpy(f,b);
+      f[strlen(f)-n1]='\0';
+      strcat(f,s1);
+    }
+    else
+      strcpy(f,"<ERR>");
+}
+
+void compose(char* stem, char* ending, char* form)
+{
+  bool suffix=true;
+  while(*stem)
+    if(*stem=='*')
+    {
+      strcpy(form,ending);
+      form+=strlen(ending);
+      suffix=false;
+      stem++;
+    }
+    else
+      *(form++)=*(stem++);
+  if(suffix)
+  {
+    strcpy(form,ending);
+    form+=strlen(ending);
+  }
+  *form='\0';
+}
+
+void autodescr(const char* f, const char* des, char* lemma, char* pos, char* attr)
+{
+  char lemd[MAXWORDLEN];
+  int o,l=strcspn(des,",");
+  strncpy(lemd,des,l);
+  lemd[l]='\0';
+  fullform(f,lemd,lemma);
+  o=l+1;
+  l=strcspn(des+o,"/:");
+  strncpy(pos,des+o,l);
+  pos[l]='\0';
+  o=o+l;
+  if(des[o]=='/')
+  {
+    o++;
+    strcpy(attr,des+o);
+  }
+  else
+    attr[0]='\0';
+}
+
+
+int common_prefix(const char* s, const char* t)
+{
+  int n=0;
+  while(*s==*t && *s!='\0')
+  { s++,t++;n++; }
+  return n;
+}
+
+int strdiff(const char* s, const char* t,
+            int& frontcut, char* prefix, int& endcut, char* suffix)
+{
+  int slen=strlen(s);
+  int tlen=strlen(t);
+  int ss, ss_max=0;                 /* ss - s shift */
+  int ts, ts_max=0;                 /* ts - t shift */
+  int common, common_max=0;
+  for(ss=0;ss<slen;ss++)
+    for(ts=0;ts<tlen;ts++)
+      if( (common=common_prefix(s+ss,t+ts))>common_max
+          && (common>4 || (ss==0 && ts==0 && common>1)) )
+      {
+        ss_max=ss;
+        ts_max=ts;
+        common_max=common;
+      }
+  //  print "--", tsmax,"\n"
+  printf("--%d\n", ts_max);
+  frontcut=ss_max;
+  strncpy(prefix,t,ts_max); prefix[ts_max]='\0';
+  endcut=slen-ss_max-common_max;
+  strcpy(suffix,t+ts_max+common_max);
+  return common_max;
+}
+
+void fprndiff(FILE* f, const char* s, const char* t)
+{
+  int frontcut,endcut;
+  char pref[MAXWORDLEN],suff[MAXWORDLEN];
+  strdiff(s,t,frontcut,pref,endcut,suff);
+  if(frontcut!=0 || pref[0]!='\0')
+    fprintf(f,"%d%s-%d%s",frontcut,pref,endcut,suff);
+  else
+    fprintf(f,"%d%s",endcut,suff);
+}
+
+void sprndiff(char* outstr, const char* s, const char* t)
+{
+  int frontcut,endcut;
+  char pref[MAXWORDLEN],suff[MAXWORDLEN];
+  strdiff(s,t,frontcut,pref,endcut,suff);
+  if(frontcut!=0 || pref[0]!='\0')
+    sprintf(outstr,"%d%s-%d%s",frontcut,pref,endcut,suff);
+  else
+    sprintf(outstr,"%d%s",endcut,suff);
+}
+
+
+void despos(const char* des, char* pos)
+{
+  int di=0;
+  int pi=0;
+  while(des[di]!=',' && des[di]!='\0') ++di;
+  if(des[di]==',')
+  {
+    ++di;
+    while(isupper(des[di])) pos[pi++]=des[di++];
+  }
+  pos[pi]='\0';
+}
+
Index: _old/app/src/lib/auttools.h
===================================================================
--- _old/app/src/lib/auttools.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/lib/auttools.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,39 @@
+
+#ifndef _Auttools_h
+#define _Auttools_h
+
+#include <stdio.h>
+#include <ctype.h>
+#include <string.h>
+#include <stdlib.h>
+
+/* #define ISALPHAG(c) ((c>='A' && c<='Z') || (c>='a' && c<='z') || \ */
+/*                       c=='¡' || c=='±' || c=='Æ' || c=='æ' || \ */
+/*                       c=='Ê' || c=='ê' || c=='£' || c=='³' || \ */
+/*                       c=='Ñ' || c=='ñ' || c=='Ó' || c=='ó' || \ */
+/*                       c=='Š' || c=='¶' || c=='¬' || c=='Œ' || \ */
+/*                       c=='¯' || c=='¿' || c=='*') */
+
+#define MAXWORDLEN 64
+
+extern void fullform(const char* b, const char* d,          // in
+                     char* f);                              // out
+
+extern void compose(char* stem, char* ending,               // in
+                    char* form);                            // out
+
+extern void autodescr(const char* f, const char* des,       // in
+                      char* lemma, char* pos, char* attr);  // out
+
+extern int strdiff(char* s, char* t,                        // in
+                   int& frontcut, char* prefix,             // out
+                   int& endcut, char* suffix);              // out
+
+extern void fprndiff(FILE* f, const char* s, const char* t);// in
+
+extern void sprndiff(char* outstr, const char* s, const char* t); // in
+
+extern void despos(const char* des,                           // in
+                   char* pos);                                // out
+
+#endif
Index: _old/app/src/lib/const.h
===================================================================
--- _old/app/src/lib/const.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/lib/const.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,24 @@
+
+
+
+// maksymalna dlugosc wyrazu
+#define  MAX_FORM 80
+
+// maksymalna dlugosc opisu
+#define MAX_DESC 80
+
+// maksymalna dlogosc lini w pliku przejsciowym
+#define MAX_LINE 1024
+
+// separator pol w pliku posrednim
+#define FIELD_SEP " \t\n"
+
+// maksymalna liczba alternatywnych opisow
+#define MAX_ALT 256
+
+// plik ze slownikiem dla guessa
+#define GUESS_DICT_FILE "slownik.fsa"
+
+// katalogi z plikami konfiguracyjnymi
+#define SYSTEM_CONFIG_DIR "/usr/local/etc/utt"
+#define USER_CONFIG_DIR "~/.utt" 
Index: _old/app/src/lib/iotools.h
===================================================================
--- _old/app/src/lib/iotools.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/lib/iotools.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,53 @@
+#include "const.h"
+#include <string.h>
+#include <stdio.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+
+// napisy zostaj na miejscu (w line), tylko wskazniki sa ustawian
+// i zara dopisywane zera s dopisywane
+
+inline
+int parsetok(char* line, int* a, int* b, char** c, char** d, char** e, char** f)
+{
+  char* field;
+  if((field=strtok(line,FIELD_SEP))!=NULL)
+    *a=atoi(field); // nie sprawdzana poprawnosc
+  else
+    return 0;
+  if((field=strtok(NULL,FIELD_SEP))!=NULL)
+    *b=atoi(field); // nie sprawdzana poprawnosc
+  else return 1;
+  if((*c=strtok(NULL,FIELD_SEP))==NULL) return 2;
+  if((*d=strtok(NULL,FIELD_SEP))==NULL) return 3;
+  if((*e=strtok(NULL,FIELD_SEP))==NULL) return 4;
+  if((*f=strtok(NULL,FIELD_SEP))==NULL) return 6;
+  return 6;
+}
+
+// napisy s kopiowane
+inline
+int scantok(const char* line, int* a, int* b, char* c, char* d, char* e=NULL, char* f=NULL)
+{
+  return sscanf(line," %d %d %s %s %s %s", a, b, c, d, e, f);
+}
+
+inline
+int printtok(char* line, int a, int b, char* c, char* d, char* e, char* f, char* parms)
+{
+  sprintf(line,"%04d %02d %s %s %s %s `%s\n", a, b, c, d, e, f, parms);
+}
+
+inline
+int printtok(char* line, int a, int b, char* c, char* d, char* e, char* f)
+{
+  sprintf(line,"%04d %02d %s %s %s %s\n", a, b, c, d, e, f);
+}
+
+inline
+int printtok(char* line, int a, int b, char* c, char* d)
+{
+  sprintf(line,"%04d %02d %s %s\n", a, b, c, d);
+}
Index: _old/app/src/lib/matchdescr.cc
===================================================================
--- _old/app/src/lib/matchdescr.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/lib/matchdescr.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,86 @@
+#include <ctype.h>
+#include <stdio.h>
+
+inline
+bool inline_matchattr(const char* a, const char* b)
+{
+  const char *p, *q; // pomocnicze wskazniki
+  while(*a && *b)
+  {
+    p=a; q=b; 
+    while(isupper(*p) && isupper(*q)) // rowny prefiks
+      if(*p==*q) ++p, ++q;
+      else if(*p<*q) // a jest mniejszy
+      {
+        // przesywamy a do nastepnego atr
+        a=p;
+        while(isupper(*a)) ++a; while(islower(*a)) ++a; 
+        goto end;
+      } 
+      else
+      {
+        // przesuwamy b do nastepnego atr
+        b=q;
+        while(isupper(*b)) ++b; while(islower(*b)) ++b; 
+        goto end;
+      }
+
+    if(islower(*p) && islower(*q)) // rowne atrybuty
+    {
+      a=p; b=q; // przesuwamy wskaznik, sprawdzamy wartosci
+      while(*a != *b)
+      {
+        if(*a > *b && !islower(*++b)) return false;
+        if(*a < *b && !islower(*++a)) return false;
+      }
+      // znaleziono rowna wartosc, przesywamy a i b do nast atr
+      while(isupper(*a)) ++a; while(islower(*a)) ++a; 
+      while(isupper(*b)) ++b; while(islower(*b)) ++b;
+      goto end;
+    }
+ 
+    if(islower(*p)) // a jest krotszy, czyli mniejszy
+    { // przesuwamy a do nastepnego atrybutu
+      a=p;
+      while(islower(*a)) ++a; 
+      goto end;
+    }
+
+    if(islower(*q)) // b jest krotszy, czyli mniejszy
+    { // przesuwamy b do nastepnego atrybutu
+      b=q;
+      while(islower(*b)) ++b; 
+      goto end;
+    }
+  end: ;
+  }
+  return true;
+}
+
+
+bool matchattr(const char* a, const char* b)
+{
+  return inline_matchattr(a,b);
+}
+
+bool matchdescr(const char* a, const char* b)
+{
+  while(isupper(*a) && isupper(*b) && *a==*b) ++a, ++b;
+  if(*a=='\0')
+    if(*b=='\0' || *b=='/') return true;
+    else return false;
+
+  if(*a=='/')
+    if(*b=='\0') return true;
+    else if(*b=='/') return inline_matchattr(++a, ++b);
+
+  return false;
+}
+
+
+int main()
+{
+  char a[100], b[100];
+  while(scanf("%s %s", a, b)==2)
+    printf("%s & %s = %d\n", a, b, matchdescr(a,b));
+}
Index: _old/app/src/lib/matchdescr.h
===================================================================
--- _old/app/src/lib/matchdescr.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/lib/matchdescr.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,10 @@
+
+// obie funkcje wymagaja by deskrypcje byly w postaci kanonicznej
+// obslugiwane sa tylko krotkie (jednoliterowe) atrybuty
+
+// test czy zgadzaja sie deskrypcje
+bool matchdescr(const char* a, const char* b);
+
+// test czy zgadaja sie same atrybuty (czyli to, co po ukosniku)
+bool matchattr(const char* a, const char* b);
+
Index: _old/app/src/lib/symtab.cc
===================================================================
--- _old/app/src/lib/symtab.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/lib/symtab.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,171 @@
+#include "symtab.h"
+#include <values.h>
+#include <stdio.h>
+#include <malloc.h>
+#include <stdlib.h>
+//---------------------------------------------------------------------------
+
+SymbolTable::SymbolTable(int n, int (*h)(const char*,int), const char* filename)
+             : _mx(n), _cnt(0), hash(h)
+{
+  _sz=first(n);
+  _key=new char*[_sz];
+  _defind=new int[_sz];
+  _hashind=new int[_sz];
+  _def=new char*[_mx];
+  for(int i=0; i<_sz; i++) _key[i]=NULL;
+  if(filename)
+    add_from_file(filename);
+}
+
+//---------------------------------------------------------------------------
+
+SymbolTable::SymbolTable(int n, const char* filename)
+             : _mx(n), _cnt(0), hash(hash1)
+{
+  _sz=first(n);
+  _key=new char*[_sz];
+  _defind=new int[_sz];
+  _hashind=new int[_sz];
+  _def=new char*[_mx];
+  for(int i=0; i<_sz; ++i) _key[i]=NULL;
+  if(filename)
+    add_from_file(filename);
+}
+
+//---------------------------------------------------------------------------
+
+SymbolTable::~SymbolTable()
+{
+  clear();
+  delete[] _key;
+  delete[] _defind;
+  delete[] _hashind;
+  delete[] _def;
+}
+
+//---------------------------------------------------------------------------
+
+void SymbolTable::clear()
+{
+  for(int i=0; i<_sz; ++i)
+    if(_key[i])
+      free(_key[i]);
+}
+
+//---------------------------------------------------------------------------
+
+bool SymbolTable::add_from_file(const char* filename)
+{
+  FILE* in=fopen(filename,"r");
+  char buf[MAXKEYLEN+1];
+
+  if(in)
+    while(fscanf(in,"%s",buf)==1)
+    {
+      if(strlen(buf)==MAXKEYLEN || add(buf)<0)
+        return false;
+    }
+  return true;
+}
+
+//---------------------------------------------------------------------------
+
+int SymbolTable::add(const char* s)
+{
+  if(_cnt<_mx)
+  {
+    int ind=hash(s,_sz);
+    while(_key[ind])
+      if(strcmp(_key[ind],s))
+        ind=++ind%_sz;
+      else
+        return _defind[ind];
+    _key[ind]=strdup(s);
+    _defind[ind]=_cnt;
+    _hashind[_cnt]=ind;
+    _def[_cnt]=_key[ind];
+    _cnt++;
+    return _cnt-1;
+  }
+  else
+    return -1;
+}
+
+//---------------------------------------------------------------------------
+
+int SymbolTable::operator[](const char* s)
+{
+  int ind=hash(s,_sz);
+  while(_key[ind])
+    if(strcmp(_key[ind],s)==0)
+      return _defind[ind];
+    else
+      ind=++ind % _sz;
+  return -1;
+}
+
+//---------------------------------------------------------------------------
+
+int SymbolTable::first(unsigned int n)
+{
+  int fi=n;
+  int bound=(n/2 < MAXKEYLEN)? n/2 : MAXKEYLEN;
+  bool found;
+  do
+  {
+    found=true;
+    if(fi++ == MAXINT) return -1;
+    for(int i=2; i<bound; i++)
+      if(fi%i==0) { found=false; break; }
+  } while(!found);
+  return fi;
+}
+
+float SymbolTable::search_rate()
+{
+  long s=0;
+  for(int i=0; i<_sz; i++)
+    if(_key[i])
+      s+=(i+_sz-hash(_key[i],_sz))%_sz+1;
+  return _cnt ? (float)s/(float)_cnt : 0;
+}
+
+//---------------------------------------------------------------------------
+
+int hash1(const char* s, int _sz)
+{
+  int l=strlen(s);
+  if(l>=4)
+    return abs((*((int*)(s+(l/2-2)))+(int)(*s * s[l-1])) % _sz);
+  else
+  {
+    int i=0;
+    strcpy((char*)&i,s);
+    return abs((i+(int)(*s * s[l-1])) % _sz);
+  }
+}
+
+//---------------------------------------------------------------------------
+
+int hash2(const char* s, int _sz)
+{
+  int l=strlen(s);
+  if(l>=6)
+  {
+    unsigned int i1,i2,i3;
+    strncpy((char*)&i1,s,sizeof(int));
+    strncpy((char*)&i2,s+(l/2-2),sizeof(int));
+    strncpy((char*)&i3,s+(l-4),sizeof(int));
+    return abs((i1+i2+i3) % _sz);
+  }
+  else
+  {
+    int i=0;
+    strncpy((char*)&i,s,sizeof(int));
+    return abs((i+(int)(*s * s[l-1])) % _sz);
+  }
+}
+
+//---------------------------------------------------------------------------
+
Index: _old/app/src/lib/symtab.h
===================================================================
--- _old/app/src/lib/symtab.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/lib/symtab.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,52 @@
+#ifndef _HashTable_h
+#define _HashTable_h
+//---------------------------------------------------------------------------
+#include <stddef.h>
+#include <string.h>
+//---------------------------------------------------------------------------
+int hash1(const char* s, int sz);
+int hash2(const char* s, int sz);
+//---------------------------------------------------------------------------
+
+class SymbolTable
+{
+  int _mx;
+  int _sz;
+  int _cnt;
+  char** _key;
+  char** _def;
+  int* _defind;
+  int* _hashind;        // s¹ tu redundancje
+
+public:
+  static const unsigned int MAXKEYLEN=2000;
+
+  SymbolTable(int n, int (*h)(const char*,int), const char* filename=NULL);
+  SymbolTable(int n, const char* filename=NULL);
+  ~SymbolTable();
+
+  void clear();
+
+  int (*hash)(const char*, int);
+
+  bool add_from_file(const char* filename);
+
+  int add(const char* s);
+  int operator[](const char* s);
+  const char* operator[](int i){if(i<0||i>=_cnt)return NULL;else return _def[i];}
+  int index(const char* s) { return this->operator[](s); };
+  int index(int i) { if(i<0||i>=_cnt) return -1; else return i; };
+  int hash_index(int i) { return _hashind[i]; }
+  const char* symbol(int i) { if(i<0||i>=_cnt)return NULL; else return _def[i];}
+
+  int capacity() { return _mx; }
+  int size() { return _sz; }
+  int count() { return _cnt; }
+  float search_rate();
+
+private:
+  static int first(unsigned int n);
+};
+
+//---------------------------------------------------------------------------
+#endif
Index: _old/app/src/lib/tft.h
===================================================================
--- _old/app/src/lib/tft.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/lib/tft.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,881 @@
+#ifndef _TFT_h
+#define _TFT_h
+//---------------------------------------------------------------------------
+#include <stddef.h>
+#include <iostream>
+#include <typeinfo>
+#include <string.h>
+
+#include <stdio.h>
+
+//#include "top.h"
+#include "ttrans.h"
+
+using namespace std;
+//---------------------------------------------------------------------------
+
+/// Klasa bazowa przetwornika skoñczonego.
+/**
+    \remark Po co ta klasa? Co dotyczy samych przej¶æ, przenie¶æ do TTrans,
+    resztê wcieliæ do TFT.
+*/
+class FT
+{
+public:
+  FT() : copy_default(false), print_mode(OO), ttn(0) {};
+
+//print mode
+  enum OUTPUT { II,                         ///< tylko symbole wej¶ciowe
+                OO,                         ///< tylko symbole wyj¶ciowe
+                IOIO,                       ///< symbol wyj¶ciowy po wej¶ciowym
+                OIOI,                       ///< symbol wyj¶ciowy przed wej¶ciowym
+                IIOO,                       ///< ca³e wej¶cie, potem ca³e wyj¶cie
+                OOII                        ///< ca³e wyj¶cie, potem ca³e wej¶cie
+
+              };
+
+/// maks d³ugo¶æ ¶cie¿ki
+  static const unsigned int ftMAXPATH=500;
+
+/// maks d³ugo¶æ opisu typu symbolu we/wy
+/**
+    \remark Przenie¶æ do TTrans
+*/
+  static const unsigned int ftTYPELEN=32;
+
+/// specjalny symbol dla warto¶ci 'epsilon'
+/**
+    \remark Przenie¶æ do TTrans
+*/
+  static const char ftEPSILON='~';
+
+/// specialny symbol dla warto¶ci 'default'
+/**
+    \remark Przenie¶æ do TTrans
+*/
+  static const char ftDEFAULT='@';
+
+/// domy¶lny symbol wyj¶ciowy (true-'@', flase-'~')
+/**
+    \remark Przenie¶æ do TTrans(???)
+*/
+  bool copy_default;
+
+/// tryb wyj¶cia
+  OUTPUT print_mode;
+
+/// false, je¶li automat nie ma przej¶æ
+  operator bool() { return (bool)ttn; };
+
+  virtual const char* intype() { return itype; };
+  virtual const char* outtype() { return otype; };
+
+protected:
+
+/// liczba elementów tablicy tt
+  unsigned long ttn;
+
+/// liczba stanów
+  unsigned long states;
+
+/// liczba przej¶æ
+  unsigned long transitions;
+
+/// typ symboli wej¶ciowych (napis)
+/**
+    \remark Przenie¶æ do TTrans(???)
+*/
+  char itype[ftTYPELEN];
+
+/// typ symboli wyj¶ciowych (napis)
+/**
+    \remark Przenie¶æ do TTrans(???)
+*/
+  char otype[ftTYPELEN];
+};
+
+//---------------------------------------------------------------------------
+
+/// Szablon przetwornika skoñczonego
+/**
+    \param I - typ symbolu wej¶ciowego
+    \param Ipass - typ, jaki ma byæ u¿yty przy przekazywaniu symbolu we jako parametru
+                   do funkcji (metody), równy \a I lub \a I&
+    \param O - typ symbolu wyj¶ciowego
+    \param Opass - typ, jaki ma byæ u¿yty przy przekazywaniu symbolu wy jako parametru
+                   do funkcji (metody), równy \a O lub \a O&
+    \param - typ przej¶cia, musi byæ podklas± TTrans
+*/
+template<class I, class Ipass, class O, class Opass, class TT>
+class TFT : public FT
+{
+
+
+public:
+
+  TFT() : FT(), tt(NULL) { setiotypes(); };
+
+/**
+\name Metody poziomu 1
+Poziom przej¶æ.
+*/
+
+//@{
+
+/// Test, czy przej¶cie \a t akceptuje symbol \a in.
+  bool accepts(long t, Ipass in) const;
+
+/// Test, czy lista przej¶æ dla aktualnego stanu jest kontynuowana po \a t.
+  bool continued(long t) const;
+
+/// Stan, do którego prowadzi przej¶cie \a t.
+/**
+    \pre !empty(t)
+*/
+  long next(long t) const;
+
+/// Symbol wej¶ciowy przej¶cia \a t.
+  Ipass input(long t) const;
+
+/// Symbol wyj¶ciowy przej¶cia \a t.
+  Opass output(long t) const;
+
+/// Zwraca \c true, je¶li symbolem we przej¶cia \a t jest epsilon.
+  bool epsi(long t) const;
+
+/// Zwraca \c true, je¶li symbolem we przej¶cia \a t jest symbol domy¶lny.
+  bool defi(long t) const;
+
+/// Zwraca \c true, je¶li symbolem wy przej¶cia \a t jest epsilon.
+  bool epso(long t) const;
+
+/// Zwraca \c true, je¶li symbolem wy przej¶cia \a t jest symbol domy¶lny.
+  bool defo(long t) const;
+
+/// Indeks przej¶cia przez \a in.
+  long tra(long t, Ipass in) const;
+
+/// Indeks przej¶cia przez \a in - non-deterministic.
+  long tra_nd(long t, Ipass in, long nth) const;
+
+//@}
+
+/**
+\name Poziom 2
+Poziom stanów. Stan (indeks stanu) = indeks jego pierwszego przej¶cia
+*/
+//@{
+/// Zwraca \c true je¶li stan \a s jest pusty (nie ma z niego przej¶æ).
+  bool empty(long s) const { return tt[s].empty(); }
+
+/// Zwraca \c true je¶li stan \a s jest stanem koñcowym.
+  bool final(long s) const { return tt[s].final(); }
+
+  long next(long t, Ipass in) const;
+
+//long trans(const I* si, I* so, long& olen) const;
+
+  long gtra(long s, const I* w, long maxpath=ftMAXPATH) const;
+
+//@}
+
+/**
+\name Poziom 3
+Poziom ...
+*/
+//@{
+  long cont(long s=-1, I* c=NULL) const;
+
+  long match(const I* w=NULL, long* p=NULL) const;
+
+  long match_nd(const I* w=NULL, long* p=NULL) const;
+
+  long lgstmatch(const I* w, long* p, long& plen, long maxpath=ftMAXPATH) const;
+
+  /*NOWE*/
+
+  long lgstpath(I*& buf, long*& path, long start=0) const;
+
+  long pref(I*& buf, I sep, long start=0) const;
+
+//@}
+
+protected:
+
+  TT* tt;                // tablica przej¶æ
+
+  long prn(const I* si, long* p, O* so) const;
+
+  void prntt(ostream& os);
+
+  void sort();
+
+  void setiotypes();     // NIE DZIA£A (dlaczego???)
+
+//  friend ostream& operator<<(ostream&,const CDFA&);
+//  friend istream& operator>>(istream&,CDFA&);
+
+private:
+  long prn_oo(const I* si, long* p, O* so) const;
+  long prn_ioio(const I* si, long* p, O* so) const;
+  long prn_oioi(const I* si, long* p, O* so) const;
+  long prn_iioo(const I* si, long* p, O* so) const;
+  long prn_ooii(const I* si, long* p, O* so) const;
+};
+
+
+//---------------------------------------------------------------------------
+//---------------------------------------------------------------------------
+
+/**
+    stan = indeks pierwszego przej¶cia
+
+    state(t) = stan, do którego nale¿y t
+
+    symbol zerowy = symbol s, dla którego (bool)s zwraca \c false,
+    w przypadku znaków - '\0'
+*/
+
+//---------------------------------------------------------------------------
+//---------------------------------------------------------------------------
+
+
+template <class I, class Ipass, class O, class Opass, class TT>
+inline
+bool TFT<I,Ipass,O,Opass,TT>::accepts(long t, Ipass in) const
+{ return tt[t].accepts(in); }
+
+/// Test whether the transition list continues after \a t.
+template <class I, class Ipass, class O, class Opass, class TT>
+inline
+bool TFT<I,Ipass,O,Opass,TT>::continued(long t) const
+{ return tt[t].continued(); }
+
+/**
+    \pre !empty(t)
+*/
+template <class I, class Ipass, class O, class Opass, class TT>
+inline
+long TFT<I,Ipass,O,Opass,TT>::next(long t) const
+{ return tt[t].next(); }
+
+template <class I, class Ipass, class O, class Opass, class TT>
+inline
+Ipass TFT<I,Ipass,O,Opass,TT>::input(long t) const
+{ return tt[t].in(); }
+
+template <class I, class Ipass, class O, class Opass, class TT>
+inline
+Opass TFT<I,Ipass,O,Opass,TT>::output(long t) const
+{ return tt[t].out(); }
+
+template <class I, class Ipass, class O, class Opass, class TT>
+inline
+bool TFT<I,Ipass,O,Opass,TT>::epsi(long t) const
+{ return tt[t].epsi(); }
+
+template <class I, class Ipass, class O, class Opass, class TT>
+inline
+bool TFT<I,Ipass,O,Opass,TT>::defi(long t) const
+{ return tt[t].defi(); }
+
+template <class I, class Ipass, class O, class Opass, class TT>
+inline
+bool TFT<I,Ipass,O,Opass,TT>::epso(long t) const
+{ return tt[t].epso(); }
+
+template <class I, class Ipass, class O, class Opass, class TT>
+inline
+bool TFT<I,Ipass,O,Opass,TT>::defo(long t) const
+{ return tt[t].defo(); }
+
+/**
+    \param +t - indeks przej¶cia
+    \param +in - symbol we
+    \return Indeks przj¶cia (>=\a t) dla bie¿±cego stanu, które
+    akceptuje symbol we \a in lub -1, je¶li nie ma takiego przej¶cia
+*/
+template <class I, class Ipass, class O, class Opass, class TT>
+long TFT<I,Ipass,O,Opass,TT>::tra(long t, Ipass in) const
+{
+  if(t<0 || t>=ttn)
+    return -1;
+
+  if(empty(t)) return -1;
+  while(!accepts(t,in))
+    if(continued(t))
+      t++;
+    else
+      return -1;
+  return t;
+}
+
+//---------------------------------------------------------------------------
+/// Indeks przej¶cia - wersja dla automatu niedeterministycznego.
+/**
+    \param +t  - indeks przej¶cia
+    \param +in - symbol we
+    \return Indeks przj¶cia (>=\a t) dla bie¿±cego stanu, które
+    akceptuje symbol we \a in lub -1, je¶li nie ma takiego przej¶cia
+    Je¶li nth==0, t1>=t, w przeciwnym razie t1>t.
+*/
+template <class I, class Ipass, class O, class Opass, class TT>
+long TFT<I,Ipass,O,Opass,TT>::tra_nd(long t, Ipass in, long nth) const
+{
+  if(t<0 || t>=ttn)
+    return -1;
+
+  if(nth)
+    if(continued(t))
+      t++;
+    else
+      return -1;
+  else
+  { if(empty(t)) return -1; }
+
+  while(!accepts(t,in))
+    if(continued(t))
+      t++;
+    else
+      return -1;
+
+  return t;
+}
+
+//}
+
+//---------------------------------------------------------------------------
+//----------------------------------------------------------------------------
+
+
+/// Funkcja przej¶cia.
+/**
+    \param t - stan
+    \param in - symbol we
+    \return Stan, do którego mo¿na przej¶æ z \a t po wp³ywem symbolu \a in
+    lub -1, je¶li nie ma przej¶cia przez \a in
+
+*/
+template <class I, class Ipass, class O, class Opass, class TT>
+long TFT<I,Ipass,O,Opass,TT>::next(long t, Ipass in) const
+{
+  if(t<0 || (unsigned long)t>=ttn)
+    return -1;
+
+  if(empty(t)) return -1;
+  while(!accepts(t,in))
+    if(continued(t))
+      t++;
+    else {
+      return -1;
+    }
+
+  return next(t);
+}
+
+//---------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
+/// Uogólniona funkcja przejscia.
+/**
+    \param +s - stan
+    \param +w - wskaŒnik pierwszego elementu ci±gu symboli we, zakoñczonego symbolem zerowym
+    \param maxpath maksymalna d³ugo¶æ ¶cie¿ki, domy¶lnie ftMAXPATH
+    \return stan osi±galny z \a s pod wp³ywem \a w (na ¶cie¿ce mog± siê pojawiæ
+    epsilon-przej¶cia
+*/
+template <class I, class Ipass, class O, class Opass, class TT>
+long TFT<I,Ipass,O,Opass,TT>::gtra(long s, const I* w, long maxpath) const
+{
+  if(s<0 || (unsigned long)s>=ttn)
+    return -1;
+
+  long i=0;
+  while(*w)
+  {
+    if(i>maxpath || empty(s)) return -1;
+    while(!accepts(s,*w))
+      if(continued(s))
+        s++;
+      else
+        return -1;
+    if(!epsi(s)) w++;
+    s=next(s);
+    i++;
+  }
+  return s;
+}
+
+//----------------------------------------------------------------------------
+
+/// Kontynuacja.
+/**
+...
+\param +s stan, je¶li -1 - poszukiwane jest nastêpne rozwi±zanie
+\param -c ci±g symboli we ze ¶cie¿ki prowadz±cej z \a s do
+       stanu koñcowego
+\return d³ugo¶æ ci±gu \a c (= d³ugo¶æ ¶cie¿ki)
+\remark DZIA£A TYLKO DLA ZNAKÓW!!!
+        EPSILON-PRZEJŠCIA NIEDOZWOLONE!!!
+*/
+template <class I, class Ipass, class O, class Opass, class TT>
+long TFT<I,Ipass,O,Opass,TT>::cont(long s, I* c) const
+{
+  static unsigned long path[ftMAXPATH]={0};
+  static unsigned long  i=0;
+  static bool more=false;
+
+  bool found=false;
+
+  if(s!=-1)
+  {
+    if(s<0 || (unsigned long)s>=ttn)
+      more=false;
+    else
+    {
+      i=0;
+      c[0]=0;
+      path[0]=s;
+      more=true;
+      if(final(s))
+        found=true;
+    }
+  }
+
+  while(more && !found)
+  {
+    if(!empty(path[i]) && i<ftMAXPATH)
+    {
+      path[i+1]=next(path[i]);
+      c[i]=input(path[i]);
+      i++;
+    }
+    else
+    {
+      do
+      {
+        if(i>0)
+          c[--i]=0;
+        else
+          more=false;
+      }while(more && !continued(path[i]));
+      path[i]=path[i]+1;
+    }
+    if(final(path[i]))
+    {
+      found=true;
+      c[i]=0;
+    }
+  }
+  return i;
+}
+
+//----------------------------------------------------------------------------
+/// Dopasowannie.
+/**
+    \remark Nie zaimplementowane.
+*/
+template <class I, class Ipass, class O, class Opass, class TT>
+long TFT<I,Ipass,O,Opass,TT>::match(const I* w, long* p) const
+{}
+
+//----------------------------------------------------------------------------
+/// Dopasowanie niedeterministyczne.
+/**
+    \param +w - wskaŒnik pierwszego elementu ci±gu symboli we, zakoñczonego symbolem zerowym,
+    je¶li NULL - poszukiwane jest nastêpne rozwi±zanie
+    \param -p ci±g przej¶æ zakoñczony -1
+    \return d³ugo¶æ dopasowania (PO CO?)
+*/
+template <class I, class Ipass, class O, class Opass, class TT>
+long TFT<I,Ipass,O,Opass,TT>::match_nd(const I* w, long* p) const
+{
+  static bool more=false;
+  static I *w0, *wc;
+  static long s=0, *p0, *pc, *pc_bound;
+
+  bool found=false;
+
+  if(w)
+  {
+    wc=w0=w;
+    pc=p0=p;
+    more=true;
+    pc_bound=pc+ftMAXPATH;
+    if(final(s=0))
+    {
+      *pc=-1; return 0;
+    }
+  }
+
+  while(more)
+  {
+    if(*wc && pc<pc_bound && (*pc=trand(s,*wc,0))>=0)
+    { if(!epsi(*pc)) wc++; s=next(*pc); pc++; }
+    else
+      while(true)
+      {
+        if(pc==p0) { more=false; return -1; }
+        if(!epsi(*(--pc))) wc--;
+        if((*pc=trand(*pc,*wc,1))>=0)
+        { if(!epsi(*pc)) wc++; s=next(*pc); pc++; break; }
+      }
+    if(final(s)) { *pc=-1; return wc-w0; }
+  }
+  return -1;
+}
+
+//----------------------------------------------------------------------------
+/// Najd³u¿sze dopasowanie.
+/**
+    \param +w wskaŒnik pierwszego elementu ci±gu symboli wej¶ciowych
+    \param -p ¶cie¿ka
+    \param -plen d³ugo¶æ ¶cie¿ki
+    \param +maxpath maks dd³ugo¶æ ¶cie¿ki, domy¶lnie FT::ftMAXPATH
+    \return d³ugo¶æ skonsumowanego wej¶cia
+*/
+template <class I, class Ipass, class O, class Opass, class TT>
+long TFT<I,Ipass,O,Opass,TT>
+        ::lgstmatch(const I* w, long* p, long& plen, long maxpath) const
+{
+  long s=0;
+  long t;
+  long i=0;
+  const char* w0=w;
+  long ilen=0;
+  while(*w && i<maxpath && (t=tra(s,*w))>=0)
+  {
+    if(!epsi(t)) w++;
+    s=next(t);
+    i++;
+    *(p++)=t;
+    if(final(s)) { plen=i; ilen=w-w0; }
+  }
+  *p=-1;
+  return ilen;
+}
+
+//----------------------------------------------------------------------------
+/// Najd³u¿sza ¶cie¿ka.
+/**
+    \param +buf  wskaŒnik pierwszego elementu ci±gu symboli wej¶ciowych
+    \param -buf  pozycja jeden za skonsumowanym prefiksem
+    \param +path wskaŒnik pierwszego elementu wektora przej¶æ
+    \param -path wskaŒnik jeden za ostatnim przej¶ciem
+    \return d³ugo¶æ skonsumowanego prefiksu (PO CO? LEPIEJ D£ ŠCIE¯KI)
+*/
+template <class I, class Ipass, class O, class Opass, class TT>
+long TFT<I,Ipass,O,Opass,TT>
+        ::lgstpath(I*& buf, long*& path, long start) const
+{
+  long s=start;
+  long t;
+  const char* buf0=buf;
+  const long* pathlimit=path+FT::ftMAXPATH;
+  while(*buf && path<pathlimit && (t=tra(s,*buf))>=0)
+  {
+    if(!epsi(t)) buf++;
+    s=next(t);
+    *(path++)=t;
+  }
+  return buf-buf0;
+}
+
+//----------------------------------------------------------------------------
+/// Najd³u¿szy prefiks.
+/**
+    \param +buf  wskaŒnik pierwszego elementu ci±gu symboli wej¶ciowych
+    \param -buf  pozycja jeden za skonsumowanym prefiksem
+    \param +sep  separator
+    \return stan po przej¶ciu przez \a sep
+    \remark Dzia³a tylko dla automatów deterministycznych, minimalnych, eps-wolnych,
+              gdzie d³. ¶cie¿ki == d³. dopasowania.
+*/
+template <class I, class Ipass, class O, class Opass, class TT>
+long TFT<I,Ipass,O,Opass,TT>
+        ::pref(I*& buf, I sep, long start) const
+{
+  static long pathtab[ftMAXPATH];
+  //  static long* path=pathtab;	
+  long* path=pathtab;
+  static bool more;
+
+  long s;
+  if(*buf)                     // pierwsze wywo³anie
+  {
+    if(!lgstpath(buf,path,start))
+      return -1;
+    --path;
+    more=true;
+  }
+  else                         // kolejne  wywo³anie
+    --buf,--path;
+  while(more)
+    if(path>=pathtab)
+      if((s=next(next(*path),sep))>=0) {
+        return s;
+      }
+      else
+        --buf, --path;
+    else
+    {
+      more=false;
+      return -1;
+    }
+  return -1;
+}
+
+//----------------------------------------------------------------------------
+
+/*
+template <class I, class Ipass, class O, class Opass, class TT>
+long TFT<I,Ipass,O,Opass,TT>::trans(const I* si, O* so, long& olen) const
+{
+  long p[ftMAXPATH];
+  long ilen;
+  long plen;
+  if((ilen=lgstmatch(si,p,plen))>0)
+    olen=prn(si,p,so);
+  else
+    ilen=olen=0;
+  return ilen;
+}
+*/
+//----------------------------------------------------------------------------
+
+template <class I, class Ipass, class O, class Opass, class TT>
+long TFT<I,Ipass,O,Opass,TT>::prn(const I* si, long* p, O* so) const
+{
+  switch(print_mode)
+  {
+    case OO: return prn_oo(si,p,so);
+    case IOIO: return prn_ioio(si,p,so);
+    case OIOI: return prn_oioi(si,p,so);
+    case IIOO: return prn_iioo(si,p,so);
+    case OOII: return prn_ooii(si,p,so);
+  }
+}
+
+//----------------------------------------------------------------------------
+
+template <class I, class Ipass, class O, class Opass, class TT>
+long TFT<I,Ipass,O,Opass,TT>::prn_oo(const I* si, long* p, O* so) const
+{
+  char* so0=so;
+  while(*p>=0)
+  {
+    long t=*p;
+    if(!epso(t))
+    {
+      if(defo(t))
+        *(so++)=*si;
+      else
+        *(so++)=output(t);
+    }
+    if(!epsi(t)) si++;
+    p++;
+
+  }
+  return so-so0;
+}
+
+//----------------------------------------------------------------------------
+
+
+template <class I, class Ipass, class O, class Opass, class TT>
+long TFT<I,Ipass,O,Opass,TT>::prn_ioio(const I* si, long* p, O* so) const
+{
+  char* so0=so;
+  while(*p>=0)
+  {
+    long t=*p;
+    if(!epsi(t))
+      *(so++)=*si;
+    if(!epso(t))
+      if(defo(t))
+        *(so++)=*si;
+      else
+        *(so++)=output(t);
+    if(!epsi(t)) si++;
+    p++;
+  }
+  return so-so0;
+}
+
+
+//----------------------------------------------------------------------------
+
+template <class I, class Ipass, class O, class Opass, class TT>
+long TFT<I,Ipass,O,Opass,TT>::prn_oioi(const I* si, long* p, O* so) const
+{
+  char* so0=so;
+  while(*p>=0)
+  {
+    long t=*p;
+    if(!epso(t))
+    {
+      if(defo(t))
+        *(so++)=*si;
+      else
+        *(so++)=output(t);
+    }
+    if(!epsi(t))
+      *(so++)=*(si++);
+    p++;
+  }
+  return so-so0;
+}
+
+//----------------------------------------------------------------------------
+
+template <class I, class Ipass, class O, class Opass, class TT>
+long TFT<I,Ipass,O,Opass,TT>::prn_iioo(const I* si, long* p, O* so) const
+{
+  const char* si0=si;
+  long* p0=p;
+  char* so0=so;
+  while(*p>=0)
+  {
+    long t=*p;
+    if(!epsi(t))
+    {
+      *(so++)=*si;
+      si++;
+    }
+    p++;
+  }
+  si=si0;
+  p=p0;
+  while(*p>=0)
+  {
+    long t=*p;
+    if(!epso(t))
+      if(defo(t))
+        *(so++)=*si;
+      else
+        *(so++)=output(t);
+    if(!epsi(t)) si++;
+    p++;
+  }
+  return so-so0;
+}
+
+//----------------------------------------------------------------------------
+
+template <class I, class Ipass, class O, class Opass, class TT>
+long TFT<I,Ipass,O,Opass,TT>::prn_ooii(const I* si, long* p, O* so) const
+{
+
+  const char* si0=si;
+  long* p0=p;
+  char* so0=so;
+  while(*p>=0)
+  {
+    long t=*p;
+    if(!epso(t))
+    {
+      if(defo(t))
+        *(so++)=*si;
+      else
+        *(so++)=output(t);
+    }
+    if(!epsi(t)) si++;
+    p++;
+  }
+  si=si0;
+  p=p0;
+  while(*p>=0)
+  {
+    long t=*p;
+    if(!epsi(t))
+      *(so++)=*(si++);
+    p++;
+  }
+  return so-so0;
+}
+
+//---------------------------------------------------------------------------
+
+template<class I, class Ipass, class O, class Opass, class TT>
+void TFT<I,Ipass,O,Opass,TT>::sort()
+{
+  long t=0;
+  while(t<ttn)
+  {
+    long t0=t;
+    long tn=1;
+    while(continued(t++)) tn++;
+    if(tn>1)
+    {
+      long eps=-1;
+      long def=-1;
+      for(int i=0; i<tn; i++)
+      {
+        if(defi(t0+i))
+          if(epsi(t0+i)) eps=i; else def=i;
+      }
+      if(eps>=0 && eps<tn-1)
+      {
+        TT temp=tt[t0+eps];
+        memmove(tt+t0+eps+1,tt+t0+eps,tn-eps-1);
+        tt[t-1]=temp;
+      }
+      if(def>eps) def--;
+      if(def>=0 && def<tn-1)
+      {
+        TT temp=tt[t0+def];
+        if(eps>=0)
+        {
+          memmove(tt+t0+def+1,tt+t0+def,tn-eps-2);
+          tt[t-2]=temp;
+        }
+        else
+        {
+          memmove(tt+t0+def+1,tt+t0+def,tn-eps-2);
+          tt[t-1]=temp;
+        }
+      }
+      while(t0<t-1)
+        tt[t0++].continued(true);
+      tt[t-1].continued(false);
+    }
+  }
+}
+
+//---------------------------------------------------------------------------
+
+template <class I, class Ipass, class O, class Opass, class TT>
+void TFT<I,Ipass,O,Opass,TT>::setiotypes()
+{
+  int i=0;
+  const char* it=typeid(I).name();
+  while(*it)
+    if(*it==' ')
+    { it++; continue; }
+    else
+      itype[i++]=*(it++);
+  itype[i]='\0';
+
+  i=0;
+  const char* ot=typeid(O).name();
+  while(*ot)
+    if(*ot==' ')
+    { ot++; continue; }
+    else
+      otype[i++]=*(ot++);
+  otype[i]='\0';
+};
+
+//---------------------------------------------------------------------------
+
+template <class I, class Ipass, class O, class Opass, class TT>
+void TFT<I,Ipass,O,Opass,TT>::prntt(ostream& os)
+{
+  for(long i=0; i<ttn; ++i)
+  {
+    os << i << ':';
+    os << tt[i];
+  }
+}
+
+#endif
Index: _old/app/src/lib/tfti.h
===================================================================
--- _old/app/src/lib/tfti.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/lib/tfti.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,527 @@
+#ifndef TFTiH
+#define TFTiH
+//---------------------------------------------------------------------------
+#include <fstream>
+#include <math.h>
+#include <iomanip>
+//#include <typeinfo.h>
+
+#include "tft.h"
+//---------------------------------------------------------------------------
+
+
+using namespace std;
+
+
+template<class I, class Ipass, class O, class Opass>
+class TFTi : public TFT<I,Ipass,O,Opass,TTrans_i<I,Ipass,O,Opass> >
+{
+public:
+  TFTi() : TFT<I,Ipass,O,Opass,TTrans_i<I,Ipass,O,Opass> >() {};
+  TFTi(const char* filename)
+  : TFT<I,Ipass,O,Opass,TTrans_i<I,Ipass,O,Opass> >() { load(filename); };
+
+  void read(const char* filename);
+  void read(istream& is=cin);
+  void write(const char* filename);
+  void write(ostream& os=cout);
+  void load(const char* filename);
+  void load(FILE* f=stdin);
+  void save(const char* filename);
+  void save(FILE* f=stdout);
+  void clear();
+  using TFT<I,Ipass,O,Opass,TTrans_i<I,Ipass,O,Opass> >::ttn;
+  using TFT<I,Ipass,O,Opass,TTrans_i<I,Ipass,O,Opass> >::states;
+  using TFT<I,Ipass,O,Opass,TTrans_i<I,Ipass,O,Opass> >::transitions;
+  using TFT<I,Ipass,O,Opass,TTrans_i<I,Ipass,O,Opass> >::itype;
+  using TFT<I,Ipass,O,Opass,TTrans_i<I,Ipass,O,Opass> >::ftTYPELEN;
+  using TFT<I,Ipass,O,Opass,TTrans_i<I,Ipass,O,Opass> >::otype;
+  using TFT<I,Ipass,O,Opass,TTrans_i<I,Ipass,O,Opass> >::tt;
+  using TFT<I,Ipass,O,Opass,TTrans_i<I,Ipass,O,Opass> >::copy_default;
+  using TFT<I,Ipass,O,Opass,TTrans_i<I,Ipass,O,Opass> >::print_mode;
+
+
+//  friend istream& operator>>(istream&, TFTi<I,Ipass,O,Opass>&);
+//  friend ostream& operator<<(ostream&, const TFTi<I,Ipass,O,Opass>&);
+};
+
+//---------------------------------------------------------------------------
+
+template<class I, class Ipass, class O, class Opass>
+void TFTi<I,Ipass,O,Opass>::read(const char* filename)
+{
+  ifstream is(filename);
+  if(!is) { fprintf(stderr,"Failed to open input file."); exit(1); }
+  read(is);
+}
+
+template<class I, class Ipass, class O, class Opass>
+void TFTi<I,Ipass,O,Opass>::read(istream& is)
+{
+  long *si;                             // state-index relation
+  long ci=0;                            // current index
+  char ch;                              // character read;
+  int empty=0;                          // no of states with 0 trans?
+  char intype[FT::ftTYPELEN];
+  char outtype[FT::ftTYPELEN];
+
+  clear();
+
+  is >> states >> transitions >> intype >> outtype;
+
+//  if(strcmp(intype,itype)!=0 ||
+//     strcmp(outtype,otype)!=0 && strcmp(outtype,"void")!=0)
+//    { is.clear(ios::badbit); goto end; };
+
+  while(is.peek()==' ' || is.peek()=='\t') is.get(ch);
+  while(is.peek()!='\n')
+  {
+    char s[20];
+    is >> s;
+    if(strcmp(s,"COPY")==0 && strcmp(intype,outtype)==0) copy_default=true;
+    else if(strcmp(s,"NOCOPY")==0) copy_default=false;
+    else if(strcmp(s,"II")==0) print_mode=FT::II;
+    else if(strcmp(s,"OO")==0) print_mode=FT::OO;
+    else if(strcmp(s,"IOIO")==0) print_mode=FT::IOIO;
+    else if(strcmp(s,"OIOI")==0) print_mode=FT::OIOI;
+    else if(strcmp(s,"IIOO")==0) print_mode=FT::IIOO;
+    else if(strcmp(s,"OIOI")==0) print_mode=FT::OIOI;
+    while(is.peek()==' ' || is.peek()=='\t') is.get(ch);
+  }
+
+  ttn=transitions+2;      // 1 state without trans., 1 additional
+  si=new long[states];
+  tt=new TTrans_i<I,Ipass,O,Opass>[ttn];
+
+  for(long cs=0;cs<states;cs++)
+  {
+    long tc;                             // transition counter
+    si[cs]=ci;
+    long cscheck;
+
+    if(!is) goto end;
+    while(is.peek()==' ' || is.peek()=='\t') is.get(ch);
+    is >> cscheck;
+    if(cs!=cscheck) goto end;
+
+    while(is.peek()==' ' || is.peek()=='\t') is.get(ch);
+
+    is.get(ch);
+    if(!is) goto end;
+    switch(ch)
+    {
+      case '-': tt[ci].final(false); break;
+      case '+': tt[ci].final(true); break;
+      default: goto end;
+    }
+    tc=0, tt[ci].continued(false);
+
+    while(is.peek()==' ' || is.peek()=='\t') is.get(ch);
+    while(is && is.peek()!='\n')
+    {
+      switch(is.peek())
+      {
+        case '~': tt[ci].epsi(true); tt[ci].defi(true); is.get(ch);
+                  break;
+        case '@': tt[ci].epsi(false); tt[ci].defi(true); is.get(ch);
+                  break;
+        default : tt[ci].geti(is);
+      }
+      if(!is) goto end;
+      if(is.peek()=='/')
+      {
+        is.get(ch);
+        switch(is.peek())
+        {
+          case '~': tt[ci].epso(true); tt[ci].defo(true); is.get(ch);
+                    break;
+          case '@': tt[ci].epso(false); tt[ci].defo(true); is.get(ch);
+                    break;
+          default : tt[ci].geto(is);
+        }
+      }
+      else
+      {
+        tt[ci].defo(true);
+        if(copy_default) tt[ci].epso(false); else tt[ci].epso(true);
+      }
+      if(!is) goto end;
+
+      unsigned long transition;
+      is >> transition;
+      tt[ci].next(transition);
+
+      tt[ci].continued(false);
+      tt[ci].empty(false);
+
+      if(tc>0) tt[ci-1].continued(true);
+      tc++,ci++;
+    }
+    if(tc==0)
+    {
+      if(++empty>2) { fprintf(stderr, "Nondeterministic automaton."); exit(1); }
+      tt[ci].empty(true);
+      ci++;
+    }
+    is.get(ch);
+    if(ch!='\n') { is.clear(ios::badbit); goto end; }
+  }
+
+  ttn=transitions+empty;
+  if(ttn!=ci) { is.clear(ios::badbit); goto end; };
+  for(long i=0;i<ttn;i++)
+    tt[i].next(si[tt[i].next()]);
+  delete[] si;
+  sort();
+
+end:
+  if(is.bad()) { fprintf(stderr,"Input error."); exit(1); }
+}
+
+//---------------------------------------------------------------------------
+
+template<class I, class Ipass, class O, class Opass>
+void TFTi<I,Ipass,O,Opass>::write(const char* filename)
+{
+  ofstream os(filename);
+  if(!os) err("Failed to open output file.");
+  write(os);
+}
+
+template<class I, class Ipass, class O, class Opass>
+void TFTi<I,Ipass,O,Opass>::write(ostream& os)
+{
+  os << states << ' ' << transitions << ' ';
+//  os << itype << ' ' << otype << ' ';
+  os << "char void";
+//  os << (copy_default ? "COPY" : "NOCOPY") << ' ';
+//  switch(print_mode)
+//  {
+//    case FT::II  : os << "II"; break;
+//    case FT::OO  : os << "OO"; break;
+//    case FT::IOIO: os << "IOIO"; break;
+//    case FT::OIOI: os << "OIOI"; break;
+//    case FT::IIOO: os << "IIOO"; break;
+//    case FT::OOII: os << "OOII";
+//  }
+  os << '\n';
+
+  long* si=new long[ttn];
+  long cs=0;
+  for(long i=0;i<ttn;i++)
+  {
+    si[i]=cs;
+    if(continued(i)==false) cs++;
+  }
+
+  int statefieldwidth=log10(cs+1);
+
+  bool first=true;
+  for(long i=0;i<ttn;i++)
+  {
+    if(first)
+    {
+      os << setw(statefieldwidth) << si[i] << " ";
+      if(final(i)) os << '+'; else os << '-';
+    }
+
+
+    if(!empty(i))
+    {
+      os << ' ';
+      if(epsi(i))
+        os << FT::ftEPSILON;
+      else
+      if(defi(i))
+        os << FT::ftDEFAULT;
+      else
+        os << input(i);
+
+      if(epso(i))
+      { if(copy_default) os << '/' << FT::ftEPSILON; }
+      else
+      if(defo(i))
+      { if(!copy_default) os << '/' << FT::ftDEFAULT; }
+      else
+      { os << '/' << output(i); }
+
+      if(strcmp(itype,"char")!=0 || strcmp(otype,"char")!=0)
+        os << ' ';
+      os << si[next(i)];
+    }
+    if(continued(i))
+      first=false;
+    else
+    { os << '\n'; first=true; }
+  }
+}
+
+//---------------------------------------------------------------------------
+
+template<class I, class Ipass, class O, class Opass>
+void TFTi<I,Ipass,O,Opass>::load(const char* filename)
+{
+  FILE* f;
+  if(*filename)
+    f=fopen(filename,"rb");
+  else
+    f=stdin;
+  if(!f) { fprintf(stderr, "Cannot open automaton file."); return; }
+  load(f);
+}
+
+template<class I, class Ipass, class O, class Opass>
+void TFTi<I,Ipass,O,Opass>::load(FILE* f)
+{
+
+  clear();
+
+  if(fread(&ttn,sizeof(ttn),1,f)!=1) { fprintf(stderr, "Binary input error."); return;}
+  if(fread(&states,sizeof(states),1,f)!=1) { fprintf(stderr, "Binary input error."); return;}
+  if(fread(&transitions,sizeof(transitions),1,f)!=1) { fprintf(stderr, "Binary input error."); return;}
+  if(fread(itype,sizeof(char),ftTYPELEN,f)!=ftTYPELEN) { fprintf(stderr, "Binary input error."); return;}
+  if(fread(otype,sizeof(char),ftTYPELEN,f)!=ftTYPELEN) { fprintf(stderr, "Binary input error."); return;}
+  if(fread(&copy_default,sizeof(copy_default),1,f)!=1) { fprintf(stderr, "Binary input error."); return;}
+  if(fread(&print_mode,sizeof(print_mode),1,f)!=1) { fprintf(stderr, "Binary input error."); return;}
+  if((tt=new TTrans_i<I,Ipass,O,Opass>[ttn])==NULL) { fprintf(stderr, "Cannot allocate memory for tt."); return;}
+  if(fread(tt,sizeof(TTrans_i<I,Ipass,O,Opass>),ttn,f)!=ttn) { fprintf(stderr, "Binary input error."); return; }
+  fclose(f);
+
+
+}
+
+//---------------------------------------------------------------------------
+
+template<class I, class Ipass, class O, class Opass>
+void TFTi<I,Ipass,O,Opass>::save(const char* filename)
+{
+  FILE* f;
+  if(*filename)
+    f=fopen(filename,"wb");
+  else
+    f=stdout;
+  if(!f) err("Cannot open file.");
+  save(f);
+}
+
+template<class I, class Ipass, class O, class Opass>
+void TFTi<I,Ipass,O,Opass>::save(FILE* f)
+{
+  if(fwrite(&ttn,sizeof(ttn),1,f)!=1) { fprintf(stderr,"Binary output error."); exit(1); }
+  if(fwrite(&states,sizeof(states),1,f)!=1) { fprintf(stderr,"Binary output error."); exit(1); }
+  if(fwrite(&transitions,sizeof(transitions),1,f)!=1) { fprintf(stderr,"Binary output error."); exit(1); }
+  if(fwrite(itype,sizeof(char),ftTYPELEN,f)!=ftTYPELEN) { fprintf(stderr,"Binary output error."); exit(1); }
+  if(fwrite(otype,sizeof(char),ftTYPELEN,f)!=ftTYPELEN) { fprintf(stderr,"Binary output error."); exit(1); }
+  if(fwrite(&copy_default,sizeof(copy_default),1,f)!=1) { fprintf(stderr,"Binary output error."); exit(1); }
+  if(fwrite(&print_mode,sizeof(print_mode),1,f)!=1) { fprintf(stderr,"Binary output error."); exit(1); }
+  if(fwrite(tt,sizeof(TTrans_i<I,Ipass,O,Opass>),ttn,f)!=ttn) { fprintf(stderr,"Binary output error."); exit(1); }
+  fclose(f);
+}
+
+//---------------------------------------------------------------------------
+
+template<class I, class Ipass, class O, class Opass>
+void TFTi<I,Ipass,O,Opass>::clear()
+{
+  if(tt) delete[] tt;
+  ttn=0;
+}
+
+//---------------------------------------------------------------------------
+/*
+template<class I, class Ipass, class O, class Opass>
+istream& operator>>(istream& is, TFTi<I,Ipass,O,Opass>& ft)
+{
+  long *si;                             // state-index relation
+  long ci=0;                            // current index
+  char ch;                              // character read;
+  int empty=0;                          // no of states with 0 trans?
+  char intype[FT::ftTYPELEN];
+  char outtype[FT::ftTYPELEN];
+
+  ft.clear();
+
+  is >> ft.states >> ft.transitions >> intype >> outtype;
+
+  if(strcmp(intype,ft.itype)!=0 ||
+     strcmp(outtype,ft.otype)!=0 && strcmp(outtype,"void")!=0)
+    { is.clear(ios::badbit); return is; };
+
+  while(is.peek()==' ' || is.peek()=='\t') is.get(ch);
+  while(is.peek()!='\n')
+  {
+    char s[20];
+    is >> s;
+    if(strcmp(s,"COPY")==0 && strcmp(intype,outtype)==0) ft.copy_default=true;
+    else if(strcmp(s,"NOCOPY")==0) ft.copy_default=false;
+    else if(strcmp(s,"II")==0) ft.print_mode=FT::II;
+    else if(strcmp(s,"OO")==0) ft.print_mode=FT::OO;
+    else if(strcmp(s,"IOIO")==0) ft.print_mode=FT::IOIO;
+    else if(strcmp(s,"OIOI")==0) ft.print_mode=FT::OIOI;
+    else if(strcmp(s,"IIOO")==0) ft.print_mode=FT::IIOO;
+    else if(strcmp(s,"OIOI")==0) ft.print_mode=FT::OIOI;
+    while(is.peek()==' ' || is.peek()=='\t') is.get(ch);
+  }
+
+  ft.ttn=ft.transitions+2;      // 1 state without trans., 1 additional
+  si=new long[ft.states];
+  ft.tt=new TTrans_i<I,Ipass,O,Opass>[ft.ttn];
+
+  for(long cs=0;cs<ft.states;cs++)
+  {
+    long tc;                             // transition counter
+    si[cs]=ci;
+    do is >> ch; while(ch!='+' && ch!='-');
+    switch(ch)
+    {
+      case '-': ft.tt[ci].final(false); break;
+      case '+': ft.tt[ci].final(true); break;
+      default: return is;
+    }
+    tc=0, ft.tt[ci].continued(false);
+    while((is.get(ch),ch==' '))
+    {
+      if(!is) return is;
+      switch(is.peek())
+      {
+        case '~': ft.tt[ci].epsi(true); ft.tt[ci].defi(true); is.get(ch);
+                  break;
+        case '@': ft.tt[ci].epsi(false); ft.tt[ci].defi(true); is.get(ch);
+                  break;
+        default : ft.tt[ci].geti(is);
+      }
+      if(!is) return is;
+      if(is.peek()=='/')
+      {
+        is.get(ch);
+        switch(is.peek())
+        {
+          case '~': ft.tt[ci].epso(true); ft.tt[ci].defo(true); is.get(ch);
+                    break;
+          case '@': ft.tt[ci].epso(false); ft.tt[ci].defo(true); is.get(ch);
+                    break;
+          default : ft.tt[ci].geto(is);
+        }
+      }
+      else
+      {
+        ft.tt[ci].defo(true);
+        if(ft.copy_default) ft.tt[ci].epso(false); else ft.tt[ci].epso(true);
+      }
+      if(!is) return is;
+
+      unsigned long transition;
+      is >> transition;
+      ft.tt[ci].next(transition);
+
+      ft.tt[ci].continued(false);
+
+      ft.tt[ci].empty(false);
+      if(tc>0) ft.tt[ci-1].continued(true);
+      tc++,ci++;
+    }
+    if(tc==0)
+    {
+      if(++empty>2) err("Nondeterministic automaton.");
+      ft.tt[ci].empty(true);
+      ci++;
+    }
+    if(ch!='\n') { is.clear(ios::badbit); return is; }
+  }
+
+  ft.ttn=ft.transitions+empty;
+  if(ft.ttn!=ci) { is.clear(ios::badbit); return is; };
+  for(long i=0;i<ft.ttn;i++)
+    ft.tt[i].next(si[ft.tt[i].next()]);
+  delete[] si;
+  ft.sort();
+  return is;
+}
+*/
+//---------------------------------------------------------------------------
+/*
+template<class I, class Ipass, class O, class Opass>
+ostream& operator<<(ostream& os, const TFTi<I,Ipass,O,Opass>& ft)
+{
+  os << ft.states << ' ' << ft.transitions << ' '
+     << ft.itype << ' ' << ft.otype << ' ';
+  os << (ft.copy_default ? "COPY" : "NOCOPY") << ' ';
+  switch(ft.print_mode)
+  {
+    case FT::II  : os << "II"; break;
+    case FT::OO  : os << "OO"; break;
+    case FT::IOIO: os << "IOIO"; break;
+    case FT::OIOI: os << "OIOI"; break;
+    case FT::IIOO: os << "IIOO"; break;
+    case FT::OOII: os << "OOII";
+  }
+  os << ' ' << '\n';
+
+  long* si=new long[ft.ttn];
+  long cs=0;
+  for(long i=0;i<ft.ttn;i++)
+  {
+    si[i]=cs;
+    if(ft.continued(i)==false) cs++;
+  }
+
+  bool first=true;
+  for(long i=0;i<ft.ttn;i++)
+  {
+    if(first)
+      if(ft.final(i)) os << '+'; else os << '-';
+
+    if(!ft.empty(i))
+    {
+      os << ' ';
+      if(ft.epsi(i))
+        os << FT::ftEPSILON;
+      else
+      if(ft.defi(i))
+        os << FT::ftDEFAULT;
+      else
+        os << ft.input(i);
+
+      if(ft.epso(i))
+      { if(ft.copy_default) os << '/' << FT::ftEPSILON; }
+      else
+      if(ft.defo(i))
+      { if(!ft.copy_default) os << '/' << FT::ftDEFAULT; }
+      else
+      { os << '/' << ft.output(i); }
+
+      if(strcmp(ft.itype,"char")!=0 || strcmp(ft.otype,"char")!=0)
+
+        os << ' ';
+      os << si[ft.next(i)];
+    }
+    if(ft.continued(i))
+      first=false;
+    else
+    { os << '\n'; first=true; }
+  }
+  return os;
+}
+*/
+//---------------------------------------------------------------------------
+//---------------------------------------------------------------------------
+
+template<class I, class O>
+class TFTiv : public TFTi<I,I,O,O>
+{
+public:
+  TFTiv() : TFTi<I,I,O,O>() {};
+  TFTiv(const char* filename) : TFTi<I,I,O,O>(filename) {};
+};
+
+//---------------------------------------------------------------------------
+
+template<class I, class O>
+class TFTir : public TFTi<I,I&,O,O&>
+{
+public:
+  TFTir() : TFTi<I,I,O,O>() {};
+};
+
+//---------------------------------------------------------------------------
+#endif
Index: _old/app/src/lib/ttrans.h
===================================================================
--- _old/app/src/lib/ttrans.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/lib/ttrans.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,207 @@
+#ifndef _TTransi_h
+#define _TTransi_h
+//---------------------------------------------------------------------------
+#include <iostream>
+//---------------------------------------------------------------------------
+
+
+using namespace std;
+
+//! The template for a transition with input and output symbols stored internally.
+/*!
+    A state is identified with the set of its outgoing transitions.
+    The state index is the index of the first transition for it.
+    A state with no outgoing transition is represented as an empty transition.
+*/
+template<class I, class Ipass, class O, class Opass>
+class TTrans_i
+{
+public:
+//private:
+//! Input symbol
+  I i;
+//! Output symbol
+  O o;
+
+public:
+
+//! state is final
+  static const unsigned char BITf=0x01;
+//! transition list is continued
+  static const unsigned char BITc=0x02;
+//! no transition
+  static const unsigned char BITe=0x04;
+//! epsilon input
+  static const unsigned char BITepsi=0x08;
+//! default input
+  static const unsigned char BITdefi=0x10;
+//! epsilon output
+  static const unsigned char BITepso=0x20;
+//! default output
+  static const unsigned char BITdefo=0x40;
+
+//! Flags
+  unsigned char flags;
+
+//! The index of the next state
+  long nxt;
+
+//! Input symbol.
+//! \return The input symbol of the transition.
+  Ipass in() const { return i; }
+
+//! Output symbol.
+//! \return The output symbol of the transition.
+  Opass out() const { return o; }
+
+//! Set the input symbol.
+//! \param in input symbol
+  void in(Ipass in) { i=in; }
+
+//! Set the output symbol.
+//! \param out output symbol
+  void out(Opass out) { o=out; }
+
+//! remark Is this needed?
+  I& iref() { return i; }
+
+//! remark Is this needed?
+  O& oref() { return o; }
+
+//! Test whether an input symbol is accepted.
+//! \remark Simplified. Should rely on a test function provided by the user.
+  bool accepts(Ipass in) { return defi() || in==i; }
+
+//! Next state.
+//! \return Destination state of the transition.
+  long next() const { return nxt; };
+
+//! Set the next state.
+//! \param t destination state of the transition
+  void next(long t) { nxt=t; };
+
+//! Is the state final?
+//! \return \c true if the state is final, false otherwise.
+  bool final() const { return flags&BITf; };
+
+//! Set the \b final flag.
+//! \param b \c true if the state is final, \c false otherwise.
+  void final(bool b) { if(b) flags|=BITf; else flags&=~BITf; };
+
+//! Is the transition list continued?
+//! \return \c true if the transition is not the last transition for the state,
+//! \c false otherwise.
+  bool continued() const { return flags&BITc; };
+
+//! Set the \b continuation flag.
+//! \param b \c true if the transition is not the last one for the state, \c false otherwise.
+  void continued(bool b) { if(b) flags|=BITc; else flags&=~BITc; };
+
+//! Is the transition empty?
+//! \return \c true if the transition is empty (represents a state with no outgoing transitions),
+//! \c false otherwise.
+  bool empty() const { return flags&BITe; };
+
+//! Set the \b empty flag.
+//! \param b \c true if the transition is empty, \c false otherwise.
+  void empty(bool b) { if(b) flags|=BITe; else flags&=~BITe; };
+
+  bool epsi() const { return flags&BITepsi; };
+  void epsi(bool b) { if(b) flags|=BITepsi; else flags&=~BITepsi; };
+
+  bool defi() const { return flags&BITdefi; };
+  void defi(bool b) { if(b) flags|=BITdefi; else flags&=~BITdefi; };
+
+  bool epso() const { return flags&BITepso; };
+  void epso(bool b) { if(b) flags|=BITepso; else flags&=~BITepso; };
+
+  bool defo() const { return flags&BITdefo; };
+  void defo(bool b) { if(b) flags|=BITdefo; else flags&=~BITdefo; };
+
+  void geti(istream&);
+  void geto(istream&);
+
+//  friend ostream& operator<<(ostream& os, const TTrans_i<I,Ipass,O,Opass>& t);
+
+};
+
+//---------------------------------------------------------------------------
+
+template<char>
+void getsym(istream& is, char& c)
+{
+  is >> c;
+  if(c=='\\')
+    {
+      is.get(c);
+      switch(c)
+      {
+        case 'n':c='\n';break;
+        case 't':c='\t';break;
+      }
+    }
+}
+
+template<class T>
+void getsym(istream& is, T& s)
+{ is >> s; }
+
+//---------------------------------------------------------------------------
+
+template<class I, class Ipass, class O, class Opass>
+void TTrans_i<I,Ipass,O,Opass>::geti(istream& is)
+{ getsym<I>(is,iref()); };
+
+template<class I, class Ipass, class O, class Opass>
+void TTrans_i<I,Ipass,O,Opass>::geto(istream& is)
+{ getsym<I>(is,oref()); };
+
+//---------------------------------------------------------------------------
+/*
+template<class I, class Ipass, class O, class Opass>
+ostream& operator<<(ostream& os, const TTrans_i<I,Ipass,O,Opass>& t)
+{
+  os << (t.final() ? '+' : '-');
+  os << ' ';
+
+  if(!t.empty())
+  {
+    if(t.defi())
+      os << (t.epsi() ? '~' : '@');
+    else
+      switch(t.in())
+      {
+        case ' ': os << "\\ "; break;
+        case '\n': os << "\\n"; break;
+        case '\t': os << "\\t"; break;
+        default:   os << t.in();
+      }
+
+    os << '/';
+
+    if(t.defo())
+      os << (t.epso() ? '~' : '@');
+    else
+      switch(t.out())
+      {
+        case ' ': os << "\\ "; break;
+        case '\n': os << "\\n"; break;
+        case '\t': os << "\\t"; break;
+        default:   os << t.out();
+      }
+
+    os << ' ' << t.next();
+  }
+
+  os << '\n';
+
+  if(!t.continued())
+    os << '\n';
+
+  return os;
+}
+*/
+
+//---------------------------------------------------------------------------
+#endif
+
Index: _old/app/src/lib/word.cc
===================================================================
--- _old/app/src/lib/word.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/lib/word.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,250 @@
+//---------------------------------------------------------------------------
+#include "word.h"
+#include "auttools.h"
+#include <istream>
+//---------------------------------------------------------------------------
+
+using namespace std;
+
+//---------------------------------------------------------------------------
+
+void Word::autodescr(const char* fo, const char* de)
+{
+  strcpy(f,fo);
+  //  len=strlen(f);
+
+  char lemd[MAXDESCRLEN];
+  int i=strcspn(de,",");
+  strncpy(lemd,de,i);
+  lemd[i]='\0';
+  if(isdigit(lemd[0]))
+    fullform(f,lemd,l);  // jeÂ¶li lemat zakodowany
+  else
+    strcpy(l,lemd);     // jeÂ¶li lemat w peÂ³nej postaci
+  strcpy(d,de+i+1);
+}
+
+//---------------------------------------------------------------------------
+bool Word::cmp_w(Word a, Word b) {
+  return (a.w_suf() > b.w_suf());
+}
+//---------------------------------------------------------------------------
+bool Word::cmp_w_rev(Word a, Word b) {
+  return (a.w_suf() < b.w_suf());
+}
+//---------------------------------------------------------------------------
+bool cmp_w_fun(Word a, Word b) {
+  return (a.w_suf() > b.w_suf());
+}
+//---------------------------------------------------------------------------
+bool cmp_w_rev_fun(Word a, Word b) {
+  return (a.w_suf() < b.w_suf());
+}
+//---------------------------------------------------------------------------
+
+istream& operator>>(istream& is, Word& w)
+{
+  char temp[Word::MAXLEN+1];
+  char c;
+
+  int i=0;
+  while(i<Word::MAXLEN && is.get(c) && isalpha(c)) temp[i++]=c;
+  if(i==Word::MAXLEN) {
+    fprintf(stderr, "To long word");
+  }
+  if(i==0) is.clear(ios::badbit);
+  temp[i]='\0';
+  if(is)
+    is.putback(c);
+  strcpy(w.f,temp);
+  //  w.len=i;
+  return is;
+}
+
+//---------------------------------------------------------------------------
+
+ostream& operator<<(ostream& os, Word& w)
+{
+  if(*(w.f))
+    os << "<W " << w.form()
+       << ";" << w.lemma()
+       << ',' << w.descr() << '>';
+  return os;
+}
+
+//---------------------------------------------------------------------------
+Words::~Words() {
+  //   for (int i=0; i<tab.size(); ++i)
+//     delete(tab[i]);
+}
+//---------------------------------------------------------------------------
+
+int Words::find(const char* word) {
+  for (int i=0; i<cnt; ++i) {
+    if (strcmp(word, tab[i].form()) == 0) {
+	return i;
+    }
+  }
+  return -1;
+}
+
+
+//---------------------------------------------------------------------------
+
+int Words::find(const char* word, const char* descr) {
+  for (int i=0; i<cnt; ++i) {
+    if ((strcmp(word, tab[i].form()) == 0) && (strcmp(descr, tab[i].descr()) == 0)) {
+	return i;
+    }
+  }
+  return -1;
+}
+
+//---------------------------------------------------------------------------
+/* zwraca index nastepnego wyniku, podczas pierwszego wywolania
+ * zwraca index wyniku o najwiekszej wadze, przy drugim wywolaniu
+ * wynik z druga najwyzsza waga, itd.
+ * Jezeli nie ma juz wynikow - zwraca -1.
+ */
+int Words::next() {
+  float max = -1;
+  int result = -1;
+  for (int i=0; i<cnt; ++i) {
+    float w = tab[i].w_suf();
+    if (w>max && !tab[i].returned) {
+      max = w;
+      result = i;
+    }
+  }
+  if (result != -1)
+    tab[result].returned = 1;
+  return result;
+}
+
+//---------------------------------------------------------------------------
+void Words::sort() {
+//  sort(tab.begin(), tab.end(), Word::cmp_w); //NIE DZIALA
+}
+
+//---------------------------------------------------------------------------
+void Words::sort_rev() {
+//  sort(tab.begin(), tab.end(), cmp_w_rev_fun); // NIE DZIALA
+}
+
+//---------------------------------------------------------------------------
+
+int Words::add(const char* fo)
+{
+  int i = find(fo);
+  if(i!=-1) {
+    return i;
+  }
+  
+  if (cnt>=tab.capacity()-1)
+    tab.resize(tab.size()*2);
+  
+
+  Word o;
+  o.form(fo);
+  o.w_suf(0.0);
+  tab.push_back(o);
+//  tab[cnt].form(fo);
+//  tab[cnt].w_suf(0.0);
+
+
+  //  if(cnt<MAX-1) {
+  /* tab.push_back(new Word());
+    tab[cnt]->form(fo);
+    tab[cnt]->w_suf(0.0);
+    tab[cnt]->w_pref(0.0);*/
+    return cnt++;
+    //  }
+    //return -1;
+}
+
+//---------------------------------------------------------------------------
+
+ //TYMCZASOWO TAK(DLA CORA)
+int Words::add(const char* fo, float weight)
+{
+  int i = find(fo);
+  if(i!=-1) {
+    return i;
+  }
+  
+  if (cnt>=tab.capacity()-1)
+    tab.resize(tab.size()*2);
+  
+  Word o;
+  o.form(fo);
+  o.w_suf(weight);
+  tab.push_back(o);
+//  tab[cnt].form(fo);
+//  tab[cnt].w_suf(weight);
+  
+    return cnt++;
+    //  }
+    //return -1;
+}
+
+//---------------------------------------------------------------------------
+
+int Words::add(const char* fo, const char* des)
+{
+  char d[Word::MAXDESCRLEN];
+  int l=strcspn(des,",");
+  int ok=1;
+  if( *(des+l) == ',' )
+    {
+      strcpy(d,des+l+1);
+      //  printf("\t%s->%s,\n", des, d);
+      int i=find(fo, d);
+      if(i!=-1)
+        return i;
+    }
+  else
+    ok=0;
+
+  if (cnt>=tab.capacity()-1)
+    tab.resize(tab.size()*2);
+
+  tab[cnt].form(fo);
+  if(ok)
+    tab[cnt].autodescr(fo, des);
+  else
+    tab[cnt].autodescr(fo, "?,?");
+  
+  tab[cnt].w_suf(0.0);
+  tab[cnt].returned = 0;
+  /*
+  //  if(cnt<MAX-1) {
+    tab.push_back(new Word());
+    tab[cnt]->form(fo);
+    tab[cnt]->autodescr(fo,des);
+    tab[cnt]->w_suf(0.0);
+    tab[cnt]->w_pref(0.0);
+    //    printf("ok!\n");*/
+    return cnt++;
+    //  }
+    //  printf("hm\n");
+  return -1;
+}
+
+//---------------------------------------------------------------------------
+void Words::prn(ostream& os)
+{
+  for(int i=0; i<count(); ++i)
+    os << "<W " << tab[i].lemma() << ',' << tab[i].descr() << ">";
+}
+
+//---------------------------------------------------------------------------
+
+ostream& operator<<(ostream& os, Words& tab)
+{
+  /*  for(int i=0; i<tab.count(); ++i)
+    os << i << ". " << tab[i] << '\n';
+    return os;*/
+}
+
+//---------------------------------------------------------------------------
+
Index: _old/app/src/lib/word.h
===================================================================
--- _old/app/src/lib/word.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/lib/word.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,161 @@
+//---------------------------------------------------------------------------
+#ifndef _Word_h
+#define _Word_h
+//---------------------------------------------------------------------------
+//#include "alphabet.h"
+//#include "erro.h"
+#include "const.h"
+#include <iostream>
+
+#include <string.h>
+
+#include <vector>
+//---------------------------------------------------------------------------
+
+using namespace std;
+
+
+
+class Word
+{
+public:
+  static const int MAXLEN=64;          // dac do global
+  static const int MAXDESCRLEN=80;     // dac do global
+
+private:
+  /// word form
+  char f[MAX_FORM];                // w wolnej chwili nazwy mozna zamienic na dluzsze
+
+  /// length
+  int _len_suf;  // dlugosc dopasowania koncowki...
+  //  int _len_pref; // ... i prefiksu
+
+  /// lemma
+  char l[MAX_FORM];
+
+  /// description
+  char d[MAX_DESC];
+
+  /// weight (probability)
+  float _w_suf; 
+  //  float _w_pref;
+public:
+  static bool cmp_w(Word a, Word b);
+  static bool cmp_w_rev(Word a, Word b);
+
+  Word() : _len_suf(-1) { *f='\0'; returned=0; };
+  Word(const char* fo, const char* des) : _len_suf(-1) { autodescr(fo,des); _w_suf=1.0; returned=0; };
+
+  Word(const Word& w);
+
+  char* form() { return f; }  // przywrocic const
+  char* lemma() { return l; } // przywrocic const
+  char* descr() { return d; }
+  float w_suf() { return _w_suf; };
+  int len_suf() { return _len_suf; }
+
+
+  void form(const char* s) { strcpy(f,s); }
+  void lemma(const char* s) { strcpy(l,s); }
+  void descr(const char* s) { strcpy(d,s); };
+  void w_suf(float x) { _w_suf=x; };
+  void len_suf(int n) { _len_suf=n; };
+
+  bool operator==(const Word& w);
+  bool operator!=(const Word& w);
+  int cmp(const Word&);
+  int cmpi(const Word&);
+
+  char* operator!() { return f; };
+
+  operator bool() { return _len_suf>0; };
+
+  char* str() { return f; }
+
+  void autodescr(const char* fo, const char* des);
+
+  friend istream& operator>>(istream& is, Word& m);
+  friend ostream& operator<<(ostream& os, Word& m);
+
+  bool returned;
+
+};
+
+
+inline Word::Word(const Word& word)
+{ strcpy(f,word.f); strcpy(l,word.l); strcpy(d,word.d); _len_suf=word._len_suf; _w_suf=word._w_suf; returned = 0; }
+
+//---------------------------------------------------------------------------
+
+inline bool Word::operator==(const Word& w)
+{return _len_suf==w._len_suf && 
+   !strcmp(f,w.f) && !strcmp(l,w.l) && !strcmp(d,w.d); }
+
+//---------------------------------------------------------------------------
+
+inline bool Word::operator!=(const Word& w)
+{return _len_suf!=w._len_suf || 
+   strcmp(f,w.f) || strcmp(l,w.l) || strcmp(d,w.d);}
+
+//---------------------------------------------------------------------------
+
+inline int Word::cmp(const Word& w) { return strcmp(f,w.f); }
+
+//---------------------------------------------------------------------------
+
+//inline int Word::cmpi(const Word& w) { return PL.cmpi(f,w.f); }
+
+//---------------------------------------------------------------------------
+
+
+
+
+bool cmp_w_fun(Word a, Word b);
+bool cmp_w_rev_fun(Word a, Word b);
+
+
+//---------------------------------------------------------------------------
+//---------------------------------------------------------------------------
+
+class Words
+{
+ private:
+  int find(const char* word);
+  int find(const char* word, const char* descr);
+ public:
+
+  static const int MAX=1024;
+
+  Words() : cnt(0) {tab.resize(MAX); };
+  ~Words();
+  Word& operator[](int i) { return tab[i]; }
+  int count() const { return cnt; }
+  void clear() { cnt=0; tab.clear(); }
+  int add(const char* fo);
+  int add(const char* fo, float weight);
+  int add(const char* fo, const char* des);
+
+  /* zwraca index nastepnego wyniku, podczas pierwszego wywolania
+   * zwraca index wyniku o najwiekszej wadze, przy drugim wywolaniu
+   * wynik z druga najwyzsza waga, itd.
+   * Jezeli nie ma juz wynikow - zwraca -1.
+   */
+  int next();
+
+  void sort();
+  void sort_rev();
+
+  void prn(ostream& os);
+
+//  friend class Lem;
+//  friend class AuxLem;
+  friend ostream& operator<<(ostream& os, Words& tab);
+  vector<Word> tab;
+  int cnt;
+
+};
+
+//---------------------------------------------------------------------------
+
+#endif
+
Index: _old/app/src/sen-nl/Makefile
===================================================================
--- _old/app/src/sen-nl/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/sen-nl/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,9 @@
+
+sen-nl:
+
+copy:
+ifdef UTT_BIN_DIR
+	cp sen-nl ${UTT_BIN_DIR}
+endif
+
+clean:
Index: _old/app/src/sen-nl/sen-nl
===================================================================
--- _old/app/src/sen-nl/sen-nl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/sen-nl/sen-nl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+sed -r '1 s/^(([0-9]+)[ \t][0-9]+[ \t].*)$/\2 00 BOS \*\n\1/;t;$! s/(([0-9]+)[ \t][0-9]+[ \t][[:alpha:]]+[ \t]+[[:print:]]*\\n.*)$/\2 00 EOS *\n\2 00 BOS *\n\1/; $ s/^(([0-9]+) .*)$/\1\n\2 00 EOS */'
Index: _old/app/src/tags/Makefile
===================================================================
--- _old/app/src/tags/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/tags/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,8 @@
+main:
+
+copy:
+ifdef UTT_BIN_DIR
+	cp *.tag2re ${UTT_BIN_DIR}
+endif
+
+clean:
Index: _old/app/src/tags/README
===================================================================
--- _old/app/src/tags/README	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/tags/README	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,5 @@
+In this directory files specific to different tag formats are stored.
+
+TAGSET.tag2re are command-line programs which translate a tag constraint 
+specification into a character-level regular expression matching 
+all tags in the TAGSET format meeting the specified constraint.
Index: _old/app/src/tags/ipi.tag2re
===================================================================
--- _old/app/src/tags/ipi.tag2re	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/tags/ipi.tag2re	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,1 @@
+#TODO
Index: _old/app/src/tok.c/Makefile
===================================================================
--- _old/app/src/tok.c/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/tok.c/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,37 @@
+PAR=-Wno-deprecated -O3
+PAR2=-c -Wno-deprecated -O3
+LIB_PATH=../lib
+CMDLINE_FILE='"../tok.c/cmdline.h"'
+
+
+tok: tok.o cmdline.c common_tok.o common.o
+	g++ $(PAR) -D _CMDLINE_FILE=$(CMDLINE_FILE) \
+	tok.c cmdline.c common.o common_tok.o -o tok
+
+tok.o: tok.c cmdline.h 
+	g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) tok.c
+
+common_tok.o: cmdline.h  common_tok.cc common_tok.h
+	g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) common_tok.cc
+
+common.o: $(COMMON_PATH)/cmdline_common.ggo $(COMMON_PATH)/common.cc \
+	$(COMMON_PATH)/common.h
+	g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) $(COMMON_PATH)/common.cc
+
+cmdline.ggo: cmdline_tok.ggo ../common/cmdline_common.ggo
+	cat cmdline_tok.ggo ../common/cmdline_common.ggo > cmdline.ggo
+
+cmdline.c cmdline.h: cmdline.ggo
+	gengetopt -i cmdline.ggo --conf-parser
+
+copy:
+ifdef UTT_BIN_DIR
+    cp tok ${UTT_BIN_DIR}/
+endif
+
+
+clean: clean.cmdline
+	rm *.o
+
+clean.cmdline:
+	rm cmdline.*
Index: _old/app/src/tok.c/cmdline_tok.ggo
===================================================================
--- _old/app/src/tok.c/cmdline_tok.ggo	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/tok.c/cmdline_tok.ggo	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,4 @@
+package "tok"
+version "0.1"
+
+
Index: _old/app/src/tok.c/common_tok.cc
===================================================================
--- _old/app/src/tok.c/common_tok.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/tok.c/common_tok.cc	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,27 @@
+#include <stdlib.h>
+#include <string.h>
+#include "common_tok.h"
+
+char dictionary[255];
+
+void process_tok_options(gengetopt_args_info args)
+{
+  if(args.dictionary_given)
+    strcpy(dictionary, args.dictionary_arg);
+  else {
+    char path[256];
+    sprintf(path, "/etc/utt/%s", DICT_FILE);
+    if (file_accessible(path) == 0)
+      strcpy(dictionary, path);
+    else {
+      sprintf(path, "%s/.utt/%s", getenv("HOME"), DICT_FILE);
+      if (file_accessible(path) == 0)
+	strcpy(dictionary, path);
+      else {
+	fprintf(stderr, "Cannot find dictionary!\n");
+	exit(1);
+      }
+    }
+  }
+
+}
Index: _old/app/src/tok.c/common_tok.h
===================================================================
--- _old/app/src/tok.c/common_tok.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/tok.c/common_tok.h	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,15 @@
+#ifndef __COMMON_TOK__H
+#define __COMMON_TOK__H
+
+#include <stdio.h>
+#include "../common/common.h"
+
+#include "cmdline.h"
+
+#define DICT_FILE "data/tok.bin"
+
+extern char dictionary[];
+
+extern void process_tok_options(gengetopt_args_info args);
+
+#endif
Index: _old/app/src/tok.c/tok.c
===================================================================
--- _old/app/src/tok.c/tok.c	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/tok.c/tok.c	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,83 @@
+
+#include <ctype.h>
+#include <stdio.h>
+#include <string.h>
+#include <locale.h>
+
+
+#include <stdlib.h>
+//#include "../lib/iotools.h"
+
+#include "cmdline.h"
+
+
+char buf[257];
+int filepos=0;
+char* tokstart;
+char* tokend;
+char tmp;
+char tag;
+
+
+gengetopt_args_info args;
+
+
+inline
+void printtoken(char tag)
+{
+  tmp=*tokend;
+  *tokend='\0';
+  printf("%04d %02d %c %s\n", filepos, tokend-tokstart, tag, tokstart);
+  *tokend=tmp;
+  filepos+=tokend-tokstart;
+  tokstart=tokend;
+  if(args.interactive_flag) fflush(stdout);
+}
+
+main(int argc, char** argv)
+{
+
+  if (cmdline_parser(argc, argv, &args) != 0)
+    exit(1);
+
+  printf("inter:%d\n",args.interactive_flag);
+
+  //  process_common_options(&args, argv[0]);
+  //  process_tok_options(args);
+
+  setlocale(LC_CTYPE,"");
+  setlocale(LC_COLLATE,"");
+
+  while(fgets(buf,256,stdin))
+  {
+
+    tokstart=tokend=buf;
+    while(*tokend)
+    {
+      char *prev=tokend;
+      ++tokend;
+      if(isalpha(*prev) && !isalpha(*tokend))
+         printtoken('W');
+      else if(isdigit(*prev) && !isdigit(*tokend))
+        printtoken('N');
+      else if(isspace(*prev))
+        {
+          switch(*prev)
+            {
+            case ' ': *prev='_'; break;
+            case '\t':*prev='t'; break;
+            case '\r':*prev='r'; break;
+            case '\f':*prev='f'; break;
+            case '\n':*prev='n';
+            }
+          if(!isspace(*tokend))
+            printtoken('S');
+        }
+      else if(ispunct(*prev))
+         printtoken('P');
+    }
+  }
+
+  cmdline_parser_free(&args);
+}
+
Index: _old/app/src/tok/Makefile
===================================================================
--- _old/app/src/tok/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/tok/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,6 @@
+tok:
+
+copy:
+ifdef UTT_BIN_DIR
+	cp tok ${UTT_BIN_DIR}
+endif
Index: _old/app/src/tok/tok
===================================================================
--- _old/app/src/tok/tok	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/app/src/tok/tok	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,125 @@
+#!/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 $max_form_length = 50;
+
+my $interactive=0;
+my $help;
+
+my $systemconfigfile='/usr/local/etc/utt/tok.conf';
+#my $userconfigfile="$ENV{'HOME'}/.utt/tok.conf";
+my $userconfigfile=home()."/.utt/tok.conf";
+
+#read configuration files###########################
+my $file;
+foreach $file ($systemconfigfile, $userconfigfile){
+	if(open(CONFIG, $file)){
+		while (<CONFIG>) {
+    			chomp;
+    			s/#.*//;
+			s/^\s+//;
+    			s/\s+$//;
+    			next unless length;
+    			my ($name, $value) = split(/\s*=\s*/, $_, 2);
+    			if(($name eq "interactive")or($name eq "i")){
+				$interactive=1;
+    			}
+    			elsif(($name eq "help")or($name eq "h")){
+				$help=1;
+    			}
+		}
+		close CONFIG;
+	}
+}
+#########################################################s
+
+GetOptions("interactive|i" => \$interactive,
+	   "help|h" => \$help);
+
+if($help)
+{
+    print <<'END'
+Usage: tok [OPTIONS]
+
+Options:
+   --interactive		Interactive (no output buffering).
+   --help -h			Help.
+END
+;
+    exit 0;
+}
+
+
+$| = $interactive;
+
+my $offset = 0;
+
+while(<>)
+{
+    1 while
+	/ [[:alpha:]]+   (?{seg('W',$&)})
+	| \d+            (?{seg('N',$&)})
+	| \s+            (?{seg('S',$&)})
+	| [[:punct:]]    (?{seg('P',$&)})
+	| .		 (?{seg('B',$&)})
+	/gxo;
+}
+
+#	| [^[:print:]]	 (?{seg("B",$&)})
+
+sub min {
+  my ($val1, $val2) = @_;
+  if($val1 < $val2) {
+  	return $val1;
+  }
+  else {
+  	return $val2;
+  }
+}
+
+
+sub seg
+{
+    my ($tag,$match) = @_;
+    my $length = length $match;
+    my $idx = 0;
+    while($idx < $length) {
+	my $l = min $max_form_length, $length - $idx;
+	my $m = substr $match, $idx, $l;
+    
+	printf "%04d %02d %s ", $offset + $idx, $l, $tag;
+    if($tag eq 'S')
+    {
+	for(my $i=0; $i<$l; ++$i)
+	{
+	    my $c = substr $m, $i, 1;
+	    print '_' if $c eq ' ';
+	    print '\n' if $c eq "\n";
+	    print '\t' if $c eq "\t";
+	    print '\r' if $c eq "\r";
+	    print '\f' if $c eq "\f";
+	}
+    }
+    elsif($tag eq 'B')
+    {
+	printf "\\x%02X", ord($m);
+    }
+    else
+    {
+	print $m;
+    }
+    print "\n";
+    $idx += $l;
+    } # while($idx < $length)
+    $offset += $length;
+} #sub seg
+
Index: _old/lang/Makefile
===================================================================
--- _old/lang/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/lang/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,40 @@
+
+CUR_DIR=$(shell pwd)
+
+#directory with dictionary source
+export UTT_DIC_SRC_HOME=${CUR_DIR}/src
+#directory with configuration files
+export UTT_DIC_CONF_HOME=${CUR_DIR}/conf
+#directory where compiled dictionaries will be placed
+export UTT_DIC_BIN=$(CUR_DIR)/dic
+#directory where distribution will be placed
+export UTT_DIC_OUTPUT=${CUR_DIR}
+
+export LANG_MODULES=pl_PL.ISO-8852-2 pl_PL.UTF-8
+
+# path to dictionary compiler
+DIC_COMPILER=../app/src/compiledic/compiledic
+
+
+
+.PHONY: compile
+compile:
+	#$DIC_COMPILER ...
+	
+
+
+.PHONY: distribute
+distribute: compile dist_tarball
+	@echo "Distribution ready!"
+	
+	
+.PHONY: dist_tarball
+dist_tarball:
+	cd dist && make tarball; cd ${CUR_DIR};
+	
+	
+.PHONY: dist_tarball_pl_PL.ISO-8859-2
+dist_tarball:
+	export DIC_LANG=pl_PL.ISO-8859-2 && \
+	cd dist && make tarball; cd ${CUR_DIR};
+	
Index: _old/lang/README
===================================================================
--- _old/lang/README	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/lang/README	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,1 @@
+the directory contains 
Index: _old/lang/README.developers
===================================================================
--- _old/lang/README.developers	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/lang/README.developers	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,10 @@
+To create dictionary distribution, use:
+    make dist_tarball
+or
+    make dist_tarball DIC_LANG=pl_PL.ISO-8859-2
+    
+The fisrt version will create tarball for all dictionaries, 
+the second only for selected language and encoding.
+The tarball file will be placed in current directory.
+
+Next distribution will be prepared soon.
Index: _old/lang/conf/pl_PL.ISO-8859-2/pl_PL.ISO-8859-2.sym
===================================================================
--- _old/lang/conf/pl_PL.ISO-8859-2/pl_PL.ISO-8859-2.sym	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/lang/conf/pl_PL.ISO-8859-2/pl_PL.ISO-8859-2.sym	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,8 @@
+lcase   a ± b c æ d e ê f g h i j k l ³ m n ñ o ó
+lcase   p q r s ¶ t u v w x y z Œ ¿ é ö ü ä
+ucase   A ¡ B C Æ D E Ê F G H I J K L £ M N Ñ O Ó
+ucase   P Q R S Š T U V W X Y Z ¬ ¯
+letter  lcase ucase
+digit   0 1 2 3 4 5 6 7 8 9
+punct   , . @ / ' ~ ; _ - + ? \ 
+all     letter digit signs sem
Index: _old/lang/conf/pl_PL.UTF-8/pl_PL.utf-8.sym
===================================================================
--- _old/lang/conf/pl_PL.UTF-8/pl_PL.utf-8.sym	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/lang/conf/pl_PL.UTF-8/pl_PL.utf-8.sym	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,9 @@
+lcase   a Ä
+ b c Ä d e Ä f g h i j k l Å m n Å o Ã³
+lcase   p q r s Å t u v w x y z Åº ÅŒ Ã© Ã¶ ÃŒ Ã€
+ucase   A Ä B C Ä D E Ä F G H I J K L Å M N Å O Ã
+ucase   P Q R S Å T U V W X Y Z Å¹ Å»
+letter  lcase ucase
+digit   0 1 2 3 4 5 6 7 8 9
+punct   , . @ / ' ~ ; _ - + ? \ 
+all     letter digit signs sem
Index: _old/lang/dist/Makefile
===================================================================
--- _old/lang/dist/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/lang/dist/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,37 @@
+
+# some variables
+
+# -----------------------------------------------------------
+# default task should display options
+.PHONY: default
+defaul:
+	@echo "Using: make tarball|rpm|deb"
+
+
+# -----------------------------------------------------------
+# this task will create tar.gz distribution
+.PHONY: tarball
+tarball:
+	cd tarball && make
+
+# -----------------------------------------------------------
+# this task should compile utt (if nesessery) and create rpm version
+.PHONY: rpm
+rpm:
+	@#we build rpm (see spec/README for details)
+	cd spec && make
+
+# -----------------------------------------------------------
+# this task should compile utt (if nesessery) and create deb version
+.PHONY: deb
+deb:
+	@#we build deb (see deb/README for details)
+	cd deb && make
+
+# -----------------------------------------------------------
+# this task should remove compiled files and directories
+.PHONY: clean
+clean:
+	# finally the line below should be uncomment
+	#rm -fr ${UTT_DIST_TMP}
+
Index: _old/lang/dist/tarball/Makefile
===================================================================
--- _old/lang/dist/tarball/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/lang/dist/tarball/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,41 @@
+# This makefile builds tarball distribution for utt dictionary.
+
+#
+# Some variables
+#
+DIR=$(shell pwd)
+
+# Common info about version and release
+_UTT_VER=$(shell cat ../../../app/dist/common/version.def)
+_UTT_REL=$(shell cat ../../../app/dist/common/release.def)
+
+# Temp vars
+_TARBALL_ROOT=$(DIR)/utt-$(_UTT_VER).$(_UTT_REL)
+_UTT_DIC_HOME=share/utt
+_TAR_FILE_NAME=utt.$(_UTT_VER)_$(_UTT_REL)
+
+
+#defualt task
+.PHONY: default
+default:
+	@echo Build directory: ${UTT_DIC_BIN}
+	@echo Output directory for tarball: ${UTT_DIC_OUTPUT}
+	mkdir -p ${_TARBALL_ROOT}/${_UTT_DIC_HOME}
+	if [[ -n "${DIC_LANG}" && -d ${UTT_DIC_BIN}/${DIC_LANG} ]]; \
+	then \
+	    echo "Tworze dystrybucje ${DIC_LANG}"; \
+	    mkdir -p ${_TARBALL_ROOT}/${_UTT_DIC_HOME}/${DIC_LANG}; \
+	    cp -fr ${UTT_DIC_BIN}/${DIC_LANG}/* ${_TARBALL_ROOT}/${_UTT_DIC_HOME}/${DIC_LANG}/; \
+	    cp -fr ${UTT_DIC_CONF_HOME}/${DIC_LANG}/* ${_TARBALL_ROOT}/${_UTT_DIC_HOME}/${DIC_LANG}/; \
+	    rm -rf ${_TARBALL_ROOT}/${_UTT_DIC_HOME}/${DIC_LANG}/.svn ; \
+	    tar -czf ${UTT_DIC_OUTPUT}/${_TAR_FILE_NAME}.${DIC_LANG}.tar.gz utt*; \
+	else \
+	    echo "Tworze pelna dystrybucje!"; \
+	    cp -fr ${UTT_DIC_BIN}/* ${_TARBALL_ROOT}/${_UTT_DIC_HOME}/; \
+	    cp -fr ${UTT_DIC_CONF_HOME}/* ${_TARBALL_ROOT}/${_UTT_DIC_HOME}/; \
+	    find ${_TARBALL_ROOT}/${_UTT_DIC_HOME} -type d -path '*/.svn' -exec rm -rf {} \; ; \
+	    tar -czf ${UTT_DIC_OUTPUT}/${_TAR_FILE_NAME}.all.tar.gz utt*; \
+	fi
+
+	rm -rf ${_TARBALL_ROOT}
+
Index: _old/nawszelkiwypadek/tools/cor_dic/makeLabels.pl
===================================================================
--- _old/nawszelkiwypadek/tools/cor_dic/makeLabels.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/nawszelkiwypadek/tools/cor_dic/makeLabels.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,11 @@
+#!/usr/bin/perl
+
+use locale;
+
+print "lcase	a ± b c æ d e ê f g h i j k l ³ m n ñ o ó p q r s ¶ t u v w x y z Œ ¿ é ö ü ä\n";
+print "ucase	A ¡ B C Æ D E Ê F G H I J K L £ M N Ñ O Ó P Q R S Š T U V W X Y Z ¬ ¯\n";
+print "letter	lcase ucase\n";
+print "digit	0 1 2 3 4 5 6 7 8 9\n";
+print "signs    , . @ \/ \'\n _";
+print "sem	~ ; - \\ \n";
+print "all	letter digit signs sem\n";
Index: _old/nawszelkiwypadek/tools/cor_dic/prep.pl
===================================================================
--- _old/nawszelkiwypadek/tools/cor_dic/prep.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/nawszelkiwypadek/tools/cor_dic/prep.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,67 @@
+#! /usr/bin/perl
+
+use locale;
+use strict;
+
+my $file = shift;
+
+if ($file eq "") {
+    print "Podaj nazwê pliku.\n";
+    exit(0);
+}
+
+
+`makeLabels.pl > labels.sym`;
+
+`lexmakelab labels`;
+
+print "Pobieram informacje ze s³ownika..........................";
+
+`cut -d \\; -f 1 <$file > temp1`;
+
+`sort -u < temp1 > temp2`;
+
+print "OK\n";
+
+print "Kompilujê automat........................................";
+
+`lexcomplex -l labels.lab -S labels.scl <temp2 > temp1`;
+
+print "OK\n";
+
+print "Usuwam epsilon-przejscia.................................";
+
+`fsmrmepsilon temp1> temp2`;
+
+print "OK\n";
+
+print "Determinizujê automat....................................";
+
+`fsmdeterminize temp2 > temp1`;
+
+print "OK\n";
+
+print "Minimalizujê automat.....................................";
+
+`fsmminimize temp1> temp2`;
+
+print "OK\n";
+
+print "Konwertujê automat do formatu fsa........................";
+
+`fsmprint -i labels.lab temp2> temp1`;
+
+`../fsm2aut temp1> temp2`;
+
+`../aut2fsa < temp2> cor.dic`;
+
+print "OK\n";
+
+print "Czyszczê pliki pomocnicze................................";
+
+`rm temp2`;
+`rm temp1`;
+`rm labels.*`;
+
+print "OK\n";
+
Index: _old/nawszelkiwypadek/tools/dist/Makefile
===================================================================
--- _old/nawszelkiwypadek/tools/dist/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/nawszelkiwypadek/tools/dist/Makefile	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,47 @@
+# main makefile
+
+BIN=bin
+SRC=src
+DIR=$(shell pwd)
+##############################
+# CONFIGURATION
+
+# UTT_BIN_DIR - directory for executables
+# UTT_SHARE_DIR - directory for data and stuff
+# UTT_DOC_DIR - directory for documentation
+
+# example (site installation)
+# UTT_BIN_DIR=/usr/local/bin
+# UTT_DOC_DIR=/usr/share/doc/utt
+
+UTT_BIN_DIR=~/utt/bin
+UTT_SHARE_DIR=~/.utt
+UTT_DOC_DIR=~/utt/doc
+UTT_LIB_DIR=$(UTT_SHARE_DIR)/lib
+##############################
+
+install: make_dirs install_dta install_lib #install_doc install_components
+	@echo "Installation completed successfully!"
+
+install_components:
+	cp -r bin/* $(UTT_BIN_DIR)/
+
+install_dta:
+	if [ -d data ]; then cp -r data/* $(UTT_SHARE_DIR)/; fi
+
+install_doc:
+	cp -r doc/* $(UTT_DOC_DIR)/
+
+install_lib:
+	cp -r lib/* $(UTT_LIB_DIR)/
+
+make_dirs:
+	#if [ -d $(UTT_BIN_DIR) ]; then true; else mkdir -p $(UTT_BIN_DIR); fi
+	if [ -d $(UTT_SHARE_DIR) ]; then true; else mkdir -p $(UTT_SHARE_DIR); fi
+	if [ -d $(UTT_LIB_DIR) ]; then true; else mkdir -p $(UTT_LIB_DIR); fi
+	#if [ -d $(UTT_DOC_DIR) ]; then true; else mkdir -p $(UTT_DOC_DIR); fi
+
+uninstall:
+	rm -r $(UTT_SHARE_DIR)
+	#rm -r $(UTT_BIN_DIR)
+	#rm -r $(UTT_DOC_DIR)
Index: _old/nawszelkiwypadek/tools/dist/README
===================================================================
--- _old/nawszelkiwypadek/tools/dist/README	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/nawszelkiwypadek/tools/dist/README	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,5 @@
+Instalacja:
+
+1) Przeniesc katalog .utt do swojego katalogu domowego.
+2) Dopisac do $PATH sciezke do katalogu bin.
+
Index: _old/nawszelkiwypadek/tools/fsm2aut
===================================================================
--- _old/nawszelkiwypadek/tools/fsm2aut	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/nawszelkiwypadek/tools/fsm2aut	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,44 @@
+#!/usr/bin/perl
+
+my $currstate=-1;
+my @states;
+my @final;
+my $tn=0;
+
+while(<>)
+{
+  if(/^\s*([0-9]+)\s+([0-9]+)\s+(.)(\s*)?$/)
+  {
+    push @{$states[$1]}, ($3, $2);
+    $#states=$2 if $#states<$2;
+    $tn++;
+  }
+  elsif(/^\s*([0-9]+)\s*$/)
+  {
+    $final[$1]=1;
+    $#states=$1 if $#states<$1;
+  }
+  else
+  {
+    die("Input error.");
+  }
+}
+
+print scalar(@states)," ",$tn," char void\n";
+
+my $i=0;
+my $width=int(log(@states+1)/log(10));
+foreach $stateref (@states)
+{
+  $f = ($final[$i]?"+":"-");
+  printf "%${width}d %s",$i++,$f;
+  while(@$stateref)
+  {
+    $c=shift @$stateref;
+    $s=shift @$stateref;
+    print " $c $s";
+  }
+  print "\n";
+}
+
+  
Index: _old/nawszelkiwypadek/tools/gue_dic/README
===================================================================
--- _old/nawszelkiwypadek/tools/gue_dic/README	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/nawszelkiwypadek/tools/gue_dic/README	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,28 @@
+How to prepare gue dictionary?
+
+1. Preparing input file.
+
+Lines in input file should look like this:
+
+prefix*suffix~weight;description
+
+where:
+prefix - is the prefix of a word
+suffix - is the suffix of a word
+weight - is the weight saying how importand information in this line is
+description - is a description of the word
+	(in any format - description will be in output of gue)
+
+
+2. Compiling a dictionary.
+
+Let's say we have input file named "dict.in".
+Commands compiling dictionary:
+
+prep_user_dict.pl < dict.in > dict.temp
+compile_user_dict.pl dict.temp
+
+Those should create file called "gue.bin" which is dictionary
+for gue component.
+
+Good luck.
Index: _old/nawszelkiwypadek/tools/gue_dic/attr.pm
===================================================================
--- _old/nawszelkiwypadek/tools/gue_dic/attr.pm	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/nawszelkiwypadek/tools/gue_dic/attr.pm	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,110 @@
+package attr;
+
+use locale;
+use strict;
+
+
+sub match(\@\@)
+{
+    my ($cat1,$avs1)= @{shift @_};
+    my ($cat2,$avs2)= @{shift @_};
+
+    if($cat1 ne $cat2)
+    {
+	return 0; 
+    }
+    else
+    {
+      ATTR:for my $attr (keys %$avs1)
+      {
+	  if($avs2->{$attr})
+	  {
+	      for my $val (keys %{$avs1->{$attr}})
+	      {
+		  next ATTR if $avs2->{$attr}->{$val};
+	      }
+	      return 0;
+	      last ATTR;
+	  }
+      }
+    }
+
+    return 1;
+}
+
+# funkcja parse
+# arg:     deskrypcja
+# warto¶æ: referencja do tablicy [<cat>, <avs>],
+#          gdzie <avs> jest referencja do hasza, zawierajacego pary
+#          atrybut=>hasz warto¶ci (pary warto¶æ=>1), czyli np.
+
+#         [
+#           'ADJ',
+#           {
+#             'KOLEDZY' => {
+#                            '<alojzy>' => 1,
+#                            '<karol>' => 1,
+#                            '<jan>' => 1
+#                          },
+#             'C' => {
+#                      'p' => 1,
+#                      'a' => 1,
+#                      'i' => 1
+#                    },
+#             'N' => {
+#                      'p' => 1
+#                    }
+#           }
+#         ];
+
+sub parse ($)
+{
+    my ($dstr)=@_;
+    my $avs={};
+    my ($cat,$attrlist) = split '/', $dstr;
+  attr:
+    while( $attrlist =~ /([[:upper:]]+)((?:[[:lower:]+?!*-]|<[^>\n]+>)+)/g )
+    {
+	my ($attrstr,$valstr)=($1,$2);
+	my %vals;
+	while($valstr =~ /[[:lower:]+?!*-]|<[^>\n]+>/g)
+	{
+	    my $val = $&;
+	    next attr if $val eq '*';
+	    $val =~ s/^<([[:lower:]])>$/$1/;
+	    $vals{$val}=1;
+	}
+	
+	$avs->{$attrstr} = \%vals; # dlaczego to dziala? %vals jest lokalne
+    }
+    [$cat, $avs];
+}
+
+# funkcja unparse
+# arg:     jak warto¶æ parse
+# warto¶æ: deskrypcja - napis
+
+sub unparse (\@)
+{
+    my ($cat,$avs)= @{shift @_};
+    my $dstr=$cat;
+    my @attrs = keys %$avs;
+    if(@attrs)
+    {
+	$dstr .= '/';
+	for my $attr ( sort @attrs )
+	{
+	    $dstr .= $attr . (join '', sort keys %{$avs->{$attr}});
+	}
+    }
+    $dstr;
+}
+
+
+sub canonize ($)
+{
+    unparse @{parse @_[0]} ;
+}
+
+
+1;
Index: _old/nawszelkiwypadek/tools/gue_dic/canon.pl
===================================================================
--- _old/nawszelkiwypadek/tools/gue_dic/canon.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/nawszelkiwypadek/tools/gue_dic/canon.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,9 @@
+#!/usr/bin/perl
+
+use locale;
+use attr;
+
+while (<>) {
+    s/,(.*)$/','.attr::canonize($1)/e;
+    print;
+}
Index: _old/nawszelkiwypadek/tools/gue_dic/compile_user_dict.pl
===================================================================
--- _old/nawszelkiwypadek/tools/gue_dic/compile_user_dict.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/nawszelkiwypadek/tools/gue_dic/compile_user_dict.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,197 @@
+#! /usr/bin/env perl
+
+use locale;
+#use strict;
+
+#
+##################################################
+$linesPerFile = 20000;
+
+if (@ARGV < 1) {
+    print "usage: prep_user_dict.pl dictionary_file\n";
+    exit;
+}
+
+$file = shift; # @ARGV;
+
+# Przygotowanie etykiet
+
+`makeLabels.pl > labels.sym`;
+
+`lexmakelab labels`;
+
+# Analiza pliku s³ownika
+
+
+print "Kanonizujê opisy.........................................";
+
+`canon.pl <$file >temp1`;
+
+print "OK\n";
+
+print "Sortujê plik.............................................";
+
+`sort -t \\~ -k1,1 -k2,2nr <temp1 > temp2`;
+
+print "OK\n";
+
+print "Minimalizujê plik s³ownika...............................";
+
+#`rmDup.pl < temp2 > temp1`;
+#`rmDup2.pl < temp1 > temp2`;
+
+`cp temp1 temp2`;
+
+`rm temp1`;
+
+print "OK\n";
+
+print "Czyszczê pliki...........................................";
+
+`sed -r "s/([[:punct:]])/[\\1]/g" < temp2 > temp1`;
+
+`cp temp1 temp2`;
+`rm temp1`;
+
+print "OK\n";
+
+#dzielimy plik na wiele czê¶ci, uruchamiamy lexcomplex dla ka¿dej
+#czê¶ci osobno, nastêpnie ³±czymy to za pomoc± programu fsmunion
+
+print "Dzielê s³ownik na mniejsze czê¶ci........................";
+
+open(IN, "./temp2");
+
+$lineCount = 0;
+$fileCount = 0;
+
+`mkdir LemTEMP`;
+
+open(FILE, ">LemTEMP/slo_0");
+
+while (<IN>) {
+
+    if (++$lineCount >= $linesPerFile) {
+	$fileCount++;
+	$lineCount = 0;
+
+	close(FILE);
+#	print "Tworzê nowy plik tymczasowy: slo_".$fileCount."\n";
+	open(FILE, ">LemTEMP/slo_".$fileCount);
+    }
+
+    print(FILE $_);
+}
+
+print "OK\n";
+
+print "Tworzê automaty po¶rednie";
+
+#32 kropki, fileCount plikow
+$filesPerDot = $fileCount/32;
+$files=$filesPerDot;
+$dots=0;
+
+for ($i=0; $i<=$fileCount; $i++) {
+
+    if ($files >= $filesPerDot) {
+	$files = 0;
+	print ".";
+	$dots++;
+    }
+    $files++;
+
+    $command = "lexcomplex -l labels.lab -S labels.scl < LemTEMP/slo_".$i." > LemTEMP/slownik_".$i.".fsm";
+
+    `$command`;
+
+}
+if ($dots < 32) {
+    for ($i=0; $i<32 - $dots; $i++) {
+	print ".";
+    }
+}
+
+print "OK\n";
+
+`rm LemTEMP/slo_*`;
+
+print "Tworzê automat koñcowy";
+
+#35 kropek...
+$filesPerDot = $fileCount/35;
+$files=$filesPerDot;
+$dots=0;
+
+`cp LemTEMP/slownik_0.fsm slownik1.fsm`;
+
+for ($i=1; $i<=$filecount; $i++) {
+
+    if ($files >= $filesPerDot) {
+	$files = 0;
+	print ".";
+	$dots++;
+    }
+    $files++;
+
+    $command = "fsmunion LemTEMP/slownik_".$i." slownik1.fsm > slownik2.fsm";
+
+    `$command`;
+
+    `mv slownik2.fsm slownik1.fsm`;
+}
+
+if ($dots < 35) {
+    for ($i=0; $i<35 - $dots; $i++) {
+	print ".";
+    }
+}
+
+`fsmunion LemTEMP/* > slownik1.fsm`;
+
+print "OK\n";
+
+print "Usuwam epsilon-przejscia.................................";
+
+`fsmrmepsilon slownik1.fsm > slownik2.fsm`;
+
+`rm slownik1.fsm`;
+
+print "OK\n";
+
+print "Determinizujê automat....................................";
+
+`fsmdeterminize slownik2.fsm > slownik1.fsm`;
+
+`rm slownik2.fsm`;
+
+print "OK\n";
+
+print "Minimalizujê automat.....................................";
+
+`fsmminimize slownik1.fsm > slownik.fsm`;
+
+`rm slownik1.fsm`;
+
+print "OK\n";
+
+print "Konwertujê automat do formatu fsa........................";
+
+`fsmprint -i labels.lab slownik.fsm > slownik.txt`;
+
+`../fsm2aut slownik.txt > slownik.aut`;
+
+`../aut2fsa < slownik.aut > gue.bin`;
+
+print "OK\n";
+
+print "Czyszczê pliki pomocnicze................................";
+
+`rm LemTEMP/*`;
+`rmdir LemTEMP`;
+`rm temp2`;
+`rm slownik.fsm`;
+`rm slownik.txt`;
+`rm slownik.aut`;
+
+print "OK\n";
Index: _old/nawszelkiwypadek/tools/gue_dic/count_prefs.pl
===================================================================
--- _old/nawszelkiwypadek/tools/gue_dic/count_prefs.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/nawszelkiwypadek/tools/gue_dic/count_prefs.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,86 @@
+#! /usr/bin/perl
+
+use locale;
+use strict;
+
+my @prefs;
+
+sub addPref {
+
+    my $pref = shift;
+    my $desc = shift;
+    my $i;
+    for ($i=0; $i< @prefs; ++$i) {
+	my @tab = @{$prefs[$i]};
+      	if (${@{$prefs[$i]}}[0] =~ /^$pref/) {
+     	    ${@{$prefs[$i]}}[1]{$desc}++;
+	    return;
+	}
+    }
+    my @new;
+    my %hash;
+
+    $hash{$desc}++;
+    push(@new, $pref);
+    push(@new, \%hash);
+
+    push(@prefs, \@new);
+}
+
+sub printPrefs {
+
+    my $i;
+    for $i (@prefs) {
+	my @tab = @$i;
+#	print $tab[0]."\t";
+	my $pref = $tab[0];
+	my %hash = %{$tab[1]};
+	my @keys = keys(%hash);
+#	print(@keys."\n");
+	my $sum = 0;
+	my $key;
+	for $key (@keys) {
+	    $sum += $hash{$key};
+	}
+	for $key (@keys) {
+	    print $pref."\t";
+	    print $key."\t";
+	    print $hash{$key}."\t";
+	    print $sum."\n";
+	}
+    }
+}
+
+if (@ARGV < 2) {
+    print "USAGE: count_prefs.pl MIN_PREF_LEN MAX_PREF_LEN\n";
+    exit;
+}
+
+my $MIN = shift;
+my $MAX = shift;
+my $PART = shift;
+
+if ($MIN > $MAX) {
+    print "MIN_PREF_LEN > MAX_PREF_LEN! ($MIN > $MAX)\n";
+    exit;
+}
+my $begin = "";
+while (<>) {
+    my $len = $MIN;
+    $_ =~ /(\w+);(.*)$/;
+    my $pref = $1;
+    my $desc = $2;
+    if ($begin eq "")  {
+	$begin = substr($pref, 0, $MIN);
+    }
+    if ($pref !~ /^$begin.*/) {
+ 	printPrefs();
+	undef(@prefs);
+	$begin = "";
+    }
+    while ($len <= $MAX) {
+	addPref(substr($pref, 0, $len++), $desc);
+    }
+}
+
+printPrefs();
Index: _old/nawszelkiwypadek/tools/gue_dic/cut_prefs.pl
===================================================================
--- _old/nawszelkiwypadek/tools/gue_dic/cut_prefs.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/nawszelkiwypadek/tools/gue_dic/cut_prefs.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,60 @@
+#! /usr/bin/perl
+
+use locale;
+use strict;
+
+if (@ARGV < 3) {
+    print "USAGE: cut_prefs.pl CUT_OFF TOTAL_PER ABS_CUT\n\n";
+    print "Obcina wpisy ma³o wa¿ne, opis nie jest uwzglêdniany\n";
+    print "je¿eli zachodzi jeden z warunków:\n";
+    print " - jezeli liczba wystapien danego opisu jest mniejsza\n";
+    print "   od \$CUT_OFF*(liczba wystapien poprzedniego opisu)\n";
+    print " - jezeli liczba wystapien danego opisu jest mniejsza\n";
+    print "   od \$TOTAL_PER*(suma wszystkich wystapien)\n";
+    print " - jezeli liczba wystapien danego opisu jest mniejsza\n";
+    print "   od \$ABS_CUT\n";
+    exit;
+}
+
+# jezeli liczba wystapien danego opisu jest mniejsza
+# od $CUT_OFF*(liczba wystapien poprzedniego opisu) - opis nie jest uwzgledniany
+my $CUT_OFF = shift;
+
+# jezeli liczba wystapien danego opisu jest mniejsza
+# od $TOTAL_PER*(suma wszystkich wystapien) - opis nie jest uwzgledniany
+my $TOTAL_PER = shift;
+
+# jezeli liczba wystapien danego opisu jest mniejsza
+# od $ABS_CUT - opis nie jest uwzgledniany
+my $ABS_CUT = shift;
+
+my $pref = "";
+my $oldPref = " ";
+my $countTotal = -1;
+my $count = -1;
+
+while (<>) {
+
+    if (($count == -1) && ($_ =~ /^$oldPref\t.*/)) {
+	next;
+    }
+
+    if ($pref =~ //) {
+	$_ =~ /^(\w+)\t.+\t(\d+)\t(\d+)/;
+	$pref = $1;
+	$count = $2;
+	$countTotal = $3;
+#  	print "\$pref=$pref\t\$count=$count\t\$countTotal=$countTotal\n";
+    }
+    $_ =~ /\w+\t.+\t(\d+)\t\d+/;
+    my $c = $1;
+#     print "\$c=$c\t\$CUT_OFF*\$count=$CUT_OFF*$count\t\$TOTAL_PER*\$countTotal=".$TOTAL_PER*$countTotal."\n";
+    if (($CUT_OFF*$count < $c) && ($TOTAL_PER*$countTotal < $c) && ($ABS_CUT < $c)) {
+	$count = $c;
+	print $_;
+    } else {
+	$count = -1;
+	$oldPref = $pref;
+	$pref = "";
+    }
+}
Index: _old/nawszelkiwypadek/tools/gue_dic/labels.lab
===================================================================
--- _old/nawszelkiwypadek/tools/gue_dic/labels.lab	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/nawszelkiwypadek/tools/gue_dic/labels.lab	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,95 @@
+<epsilon>	0
+a	1
+±	2
+b	3
+c	4
+æ	5
+d	6
+e	7
+ê	8
+f	9
+g	10
+h	11
+i	12
+j	13
+k	14
+l	15
+³	16
+m	17
+n	18
+ñ	19
+o	20
+ó	21
+p	22
+q	23
+r	24
+s	25
+¶	26
+t	27
+u	28
+v	29
+w	30
+x	31
+y	32
+z	33
+Œ	34
+¿	35
+é	36
+ö	37
+ü	38
+ä	39
+A	40
+¡	41
+B	42
+C	43
+Æ	44
+D	45
+E	46
+Ê	47
+F	48
+G	49
+H	50
+I	51
+J	52
+K	53
+L	54
+£	55
+M	56
+N	57
+Ñ	58
+O	59
+Ó	60
+P	61
+Q	62
+R	63
+S	64
+Š	65
+T	66
+U	67
+V	68
+W	69
+X	70
+Y	71
+Z	72
+¬	73
+¯	74
+0	75
+1	76
+2	77
+3	78
+4	79
+5	80
+6	81
+7	82
+8	83
+9	84
+,	85
+.	86
+@	87
+/	88
+'	89
+_	90
+~	91
+;	92
+-	93
+\	94
Index: _old/nawszelkiwypadek/tools/gue_dic/labels.scl
===================================================================
--- _old/nawszelkiwypadek/tools/gue_dic/labels.scl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/nawszelkiwypadek/tools/gue_dic/labels.scl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,356 @@
+lcase	1
+lcase	2
+lcase	3
+lcase	4
+lcase	5
+lcase	6
+lcase	7
+lcase	8
+lcase	9
+lcase	10
+lcase	11
+lcase	12
+lcase	13
+lcase	14
+lcase	15
+lcase	16
+lcase	17
+lcase	18
+lcase	19
+lcase	20
+lcase	21
+lcase	22
+lcase	23
+lcase	24
+lcase	25
+lcase	26
+lcase	27
+lcase	28
+lcase	29
+lcase	30
+lcase	31
+lcase	32
+lcase	33
+lcase	34
+lcase	35
+lcase	36
+lcase	37
+lcase	38
+lcase	39
+sem	91
+sem	92
+sem	93
+sem	94
+<sigma>	1
+<sigma>	2
+<sigma>	3
+<sigma>	4
+<sigma>	5
+<sigma>	6
+<sigma>	7
+<sigma>	8
+<sigma>	9
+<sigma>	10
+<sigma>	11
+<sigma>	12
+<sigma>	13
+<sigma>	14
+<sigma>	15
+<sigma>	16
+<sigma>	17
+<sigma>	18
+<sigma>	19
+<sigma>	20
+<sigma>	21
+<sigma>	22
+<sigma>	23
+<sigma>	24
+<sigma>	25
+<sigma>	26
+<sigma>	27
+<sigma>	28
+<sigma>	29
+<sigma>	30
+<sigma>	31
+<sigma>	32
+<sigma>	33
+<sigma>	34
+<sigma>	35
+<sigma>	36
+<sigma>	37
+<sigma>	38
+<sigma>	39
+<sigma>	40
+<sigma>	41
+<sigma>	42
+<sigma>	43
+<sigma>	44
+<sigma>	45
+<sigma>	46
+<sigma>	47
+<sigma>	48
+<sigma>	49
+<sigma>	50
+<sigma>	51
+<sigma>	52
+<sigma>	53
+<sigma>	54
+<sigma>	55
+<sigma>	56
+<sigma>	57
+<sigma>	58
+<sigma>	59
+<sigma>	60
+<sigma>	61
+<sigma>	62
+<sigma>	63
+<sigma>	64
+<sigma>	65
+<sigma>	66
+<sigma>	67
+<sigma>	68
+<sigma>	69
+<sigma>	70
+<sigma>	71
+<sigma>	72
+<sigma>	73
+<sigma>	74
+<sigma>	75
+<sigma>	76
+<sigma>	77
+<sigma>	78
+<sigma>	79
+<sigma>	80
+<sigma>	81
+<sigma>	82
+<sigma>	83
+<sigma>	84
+<sigma>	85
+<sigma>	86
+<sigma>	87
+<sigma>	88
+<sigma>	89
+<sigma>	90
+<sigma>	91
+<sigma>	92
+<sigma>	93
+<sigma>	94
+ucase	40
+ucase	41
+ucase	42
+ucase	43
+ucase	44
+ucase	45
+ucase	46
+ucase	47
+ucase	48
+ucase	49
+ucase	50
+ucase	51
+ucase	52
+ucase	53
+ucase	54
+ucase	55
+ucase	56
+ucase	57
+ucase	58
+ucase	59
+ucase	60
+ucase	61
+ucase	62
+ucase	63
+ucase	64
+ucase	65
+ucase	66
+ucase	67
+ucase	68
+ucase	69
+ucase	70
+ucase	71
+ucase	72
+ucase	73
+ucase	74
+letter	1
+letter	2
+letter	3
+letter	4
+letter	5
+letter	6
+letter	7
+letter	8
+letter	9
+letter	10
+letter	11
+letter	12
+letter	13
+letter	14
+letter	15
+letter	16
+letter	17
+letter	18
+letter	19
+letter	20
+letter	21
+letter	22
+letter	23
+letter	24
+letter	25
+letter	26
+letter	27
+letter	28
+letter	29
+letter	30
+letter	31
+letter	32
+letter	33
+letter	34
+letter	35
+letter	36
+letter	37
+letter	38
+letter	39
+letter	40
+letter	41
+letter	42
+letter	43
+letter	44
+letter	45
+letter	46
+letter	47
+letter	48
+letter	49
+letter	50
+letter	51
+letter	52
+letter	53
+letter	54
+letter	55
+letter	56
+letter	57
+letter	58
+letter	59
+letter	60
+letter	61
+letter	62
+letter	63
+letter	64
+letter	65
+letter	66
+letter	67
+letter	68
+letter	69
+letter	70
+letter	71
+letter	72
+letter	73
+letter	74
+all	1
+all	2
+all	3
+all	4
+all	5
+all	6
+all	7
+all	8
+all	9
+all	10
+all	11
+all	12
+all	13
+all	14
+all	15
+all	16
+all	17
+all	18
+all	19
+all	20
+all	21
+all	22
+all	23
+all	24
+all	25
+all	26
+all	27
+all	28
+all	29
+all	30
+all	31
+all	32
+all	33
+all	34
+all	35
+all	36
+all	37
+all	38
+all	39
+all	40
+all	41
+all	42
+all	43
+all	44
+all	45
+all	46
+all	47
+all	48
+all	49
+all	50
+all	51
+all	52
+all	53
+all	54
+all	55
+all	56
+all	57
+all	58
+all	59
+all	60
+all	61
+all	62
+all	63
+all	64
+all	65
+all	66
+all	67
+all	68
+all	69
+all	70
+all	71
+all	72
+all	73
+all	74
+all	75
+all	76
+all	77
+all	78
+all	79
+all	80
+all	81
+all	82
+all	83
+all	84
+all	85
+all	86
+all	87
+all	88
+all	89
+all	90
+all	91
+all	92
+all	93
+all	94
+digit	75
+digit	76
+digit	77
+digit	78
+digit	79
+digit	80
+digit	81
+digit	82
+digit	83
+digit	84
+signs	85
+signs	86
+signs	87
+signs	88
+signs	89
+signs	90
Index: _old/nawszelkiwypadek/tools/gue_dic/labels.sym
===================================================================
--- _old/nawszelkiwypadek/tools/gue_dic/labels.sym	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/nawszelkiwypadek/tools/gue_dic/labels.sym	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,7 @@
+lcase	a ± b c æ d e ê f g h i j k l ³ m n ñ o ó p q r s ¶ t u v w x y z Œ ¿ é ö ü ä
+ucase	A ¡ B C Æ D E Ê F G H I J K L £ M N Ñ O Ó P Q R S Š T U V W X Y Z ¬ ¯
+letter	lcase ucase
+digit	0 1 2 3 4 5 6 7 8 9
+signs    , . @ / ' _
+sem	~ ; - \ 
+all	letter digit signs sem
Index: _old/nawszelkiwypadek/tools/gue_dic/makeLabels.pl
===================================================================
--- _old/nawszelkiwypadek/tools/gue_dic/makeLabels.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/nawszelkiwypadek/tools/gue_dic/makeLabels.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,11 @@
+#!/usr/bin/perl
+
+use locale;
+
+print "lcase	a ± b c æ d e ê f g h i j k l ³ m n ñ o ó p q r s ¶ t u v w x y z Œ ¿ é ö ü ä\n";
+print "ucase	A ¡ B C Æ D E Ê F G H I J K L £ M N Ñ O Ó P Q R S Š T U V W X Y Z ¬ ¯\n";
+print "letter	lcase ucase\n";
+print "digit	0 1 2 3 4 5 6 7 8 9\n";
+print "signs    , . @ \/ \' _\n";
+print "sem	~ ; - \\ \n";
+print "all	letter digit signs sem\n";
Index: _old/nawszelkiwypadek/tools/gue_dic/prep.pl
===================================================================
--- _old/nawszelkiwypadek/tools/gue_dic/prep.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/nawszelkiwypadek/tools/gue_dic/prep.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,213 @@
+#! /usr/bin/perl
+
+use locale;
+
+$linesPerFile = 20000;
+
+if (@ARGV < 1) {
+    print "usage: prep.pl dictionary_file\n";
+    exit;
+}
+
+$file = shift; # @ARGV;
+$kind = shift;
+
+if ($kind eq "") {
+    $kind="suf";
+}
+
+# Przygotowanie etykiet
+
+`makeLabels.pl > labels.sym`;
+
+`lexmakelab labels`;
+
+# Analiza pliku s³ownika
+
+
+print "Kanonizujê opisy.........................................";
+
+`canon.pl <$file >temp2`;
+
+print "OK\n";
+
+print "Analizuje prefiksy.......................................";
+
+`count_prefs.pl 2 4 < temp2 > prefs`;
+`sort -k1,1 -k3,3nr prefs > prefsS`;
+`cut_prefs.pl 0.5 0.01 100 prefsS > prefs`;
+`rm prefsS`;
+
+print "OK\n";
+
+print "Analizujê plik s³ownika";
+
+if ($kind eq "pre") {
+    print "(pre).............................";
+    `stat_pre.pl temp2 > temp1`;
+} else {
+    print "(suf).............................";
+    `stat.pl prefs < temp2 > temp1`;
+}
+
+print "OK\n";
+
+# zmniejszamy plik...
+
+print "Sortujê plik.............................................";
+
+`sort -t \\~ -k1,1 -k2,2nr <temp1 > temp2`;
+
+print "OK\n";
+
+print "Minimalizujê plik s³ownika...............................";
+
+`rmDup.pl < temp2 > temp1`;
+#`rmDup2.pl < temp1 > temp2`;
+
+`cp temp1 temp2`;
+
+`rm temp1`;
+
+print "OK\n";
+
+#dzielimy plik na wiele czê¶ci, uruchamiamy lexcomplex dla ka¿dej
+#czê¶ci osobno, nastêpnie ³±czymy to za pomoc± programu fsmunion
+
+print "Dzielê s³ownik na mniejsze czê¶ci........................";
+
+open(IN, "./temp2");
+
+$lineCount = 0;
+$fileCount = 0;
+
+`mkdir LemTEMP`;
+
+open(FILE, ">LemTEMP/slo_0");
+
+while (<IN>) {
+
+    if (++$lineCount >= $linesPerFile) {
+	$fileCount++;
+	$lineCount = 0;
+
+	close(FILE);
+#	print "Tworzê nowy plik tymczasowy: slo_".$fileCount."\n";
+	open(FILE, ">LemTEMP/slo_".$fileCount);
+    }
+
+    print(FILE $_);
+}
+
+print "OK\n";
+
+print "Tworzê automaty po¶rednie";
+
+#32 kropki, fileCount plikow
+$filesPerDot = $fileCount/32;
+$files=$filesPerDot;
+$dots=0;
+
+for ($i=0; $i<=$fileCount; $i++) {
+
+    if ($files >= $filesPerDot) {
+	$files = 0;
+	print ".";
+	$dots++;
+    }
+    $files++;
+
+    $command = "lexcomplex -l labels.lab -S labels.scl < LemTEMP/slo_".$i." > LemTEMP/slownik_".$i.".fsm";
+
+    `$command`;
+
+}
+if ($dots < 32) {
+    for ($i=0; $i<32 - $dots; $i++) {
+	print ".";
+    }
+}
+
+print "OK\n";
+
+`rm LemTEMP/slo_*`;
+
+print "Tworzê automat koñcowy";
+
+#35 kropek...
+$filesPerDot = $fileCount/35;
+$files=$filesPerDot;
+$dots=0;
+
+`cp LemTEMP/slownik_0.fsm slownik1.fsm`;
+
+for ($i=1; $i<=$filecount; $i++) {
+
+    if ($files >= $filesPerDot) {
+	$files = 0;
+	print ".";
+	$dots++;
+    }
+    $files++;
+
+    $command = "fsmunion LemTEMP/slownik_".$i." slownik1.fsm > slownik2.fsm";
+
+    `$command`;
+
+    `mv slownik2.fsm slownik1.fsm`;
+}
+
+if ($dots < 35) {
+    for ($i=0; $i<35 - $dots; $i++) {
+	print ".";
+    }
+}
+
+`fsmunion LemTEMP/* > slownik1.fsm`;
+
+print "OK\n";
+
+print "Usuwam epsilon-przejscia.................................";
+
+`fsmrmepsilon slownik1.fsm > slownik2.fsm`;
+
+`rm slownik1.fsm`;
+
+print "OK\n";
+
+print "Determinizujê automat....................................";
+
+`fsmdeterminize slownik2.fsm > slownik1.fsm`;
+
+`rm slownik2.fsm`;
+
+print "OK\n";
+
+print "Minimalizujê automat.....................................";
+
+`fsmminimize slownik1.fsm > slownik.fsm`;
+
+`rm slownik1.fsm`;
+
+print "OK\n";
+
+print "Konwertujê automat do formatu fsa........................";
+
+`fsmprint -i labels.lab slownik.fsm > slownik.txt`;
+
+`../fsm2aut slownik.txt > slownik.aut`;
+
+`../aut2fsa < slownik.aut > gue.bin`;
+
+print "OK\n";
+
+print "Czyszczê pliki pomocnicze................................";
+
+`rm LemTEMP/*`;
+`rmdir LemTEMP`;
+`rm temp2`;
+`rm slownik.fsm`;
+`rm slownik.txt`;
+`rm slownik.aut`;
+
+print "OK\n";
Index: _old/nawszelkiwypadek/tools/gue_dic/prep_user_dict.pl
===================================================================
--- _old/nawszelkiwypadek/tools/gue_dic/prep_user_dict.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/nawszelkiwypadek/tools/gue_dic/prep_user_dict.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,31 @@
+#! /usr/bin/env perl
+
+use locale;
+use strict;
+
+##################################################
+# Skrypt transformuje s³ownik u¿ytkownika        #
+# do s³ownika rozumianego przez gue.             #
+# Format wej¶ciowy:                              #
+# pref*kon~waga;opis                             #
+# Format wyj¶ciowy:                              #
+# nok_pref~waga;opis                             #
+#                                                #
+# Prefiks mo¿e byæ pusty, koñcówka te¿           #
+##################################################
+
+while (<>) {
+    /^(\w*)\*(\w*)(~.*)$/;
+    my $pref = $1;
+    my $kon = $2;
+    my $desc = $3;
+
+    print reverse(split("",$kon));
+
+    if ($pref != "") {
+	print "_$pref";
+    }
+    print "$desc\n";
+
+
+}
Index: _old/nawszelkiwypadek/tools/gue_dic/rmDup.pl
===================================================================
--- _old/nawszelkiwypadek/tools/gue_dic/rmDup.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/nawszelkiwypadek/tools/gue_dic/rmDup.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,55 @@
+#!/usr/bin/perl
+
+# Usuwa zbêdne powtórzenia scie¿ek
+
+use locale;
+
+#if (@ARGV < 1) {
+#    print "USAGE: remDup.pl num\n\tGdzie \"num\" jest ilo¶ci± powtórzeñ, które zostawiamy\n";
+#    exit(0);
+#}
+
+
+
+#ilo¶æ powtórzeñ, które zostawiamy
+$max = 10;
+
+# przyjmujemy, ze na wej¶ciu znajduje siê plik posortowany,
+# po koñcówkach oraz po prawdopodobieñstwie
+
+$line = <>;
+
+while (($line !~ m/^$/) || ($line =~ m/^\n$/)) {
+
+    $count = 0;
+
+    while ($line =~ m/^\n$/) {
+	$line = <>;
+    }
+
+    $line =~ /^([^~]+)~.*/;
+    $theEnd = $1;
+    $end = $1;
+
+    while (($end =~ m/$theEnd/) && ($count++ < $max)) {
+	print $line;
+	$line = <>;
+	$line =~ /^([^~]+)~.*/;
+	$end = $1;
+    }
+
+    # tutaj mamy dwie mo¿liwo¶ci:
+    # 1. wypisali¶my ju¿ max lini - musimy wywaliæ kolejne linie, które
+    # zawieraj± koñcówkê theEnd,
+    # 2. pasuj±cych lini by³o mniej ni¿ max, wtedy nic nie musimy robiæ
+    # - w zmiennej line znajduje siê kolejna linia...
+
+    if ($count == $max + 1) {
+	while ($oldEnd =~ m/$theEnd/) {
+	    $line = <>;
+	    $line =~ /^([^~]+)~.*/;
+	    $oldEnd = $1;
+	}
+    }
+
+}
Index: _old/nawszelkiwypadek/tools/gue_dic/stat.pl
===================================================================
--- _old/nawszelkiwypadek/tools/gue_dic/stat.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/nawszelkiwypadek/tools/gue_dic/stat.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,165 @@
+#! /usr/bin/perl
+
+use locale;
+
+######################################################
+# na wej¶ciu znajduje siê plik zawieraj±cy linie     #
+# postaci:                                           #
+# slowo;opis                                         #
+#                                                    #
+# na wyj¶ciu ma siê znaleŒæ plik zawieraj±cy linie:  #
+# koñcówka(rev);prawdopodobieñstwo;opis              #
+# gdzie:                                             #
+# - koñcówka(rev) jest koñcówk± wyrazu zapisan±      #
+#   w odwrotnej kolejno¶ci, dla ka¿dego wyrazu       #
+#   w s³owniku wypisujemy koñcówki o d³ugo¶ciach     #
+#   od 1 do d³ugo¶ci wyrazu,                         #
+# - prawdopodobieñstwo jest prawdopodobieñstwem      #
+#   wyst±pienia danego opisu dla danej koñcówki      #
+#   (obliczonym na podstwie statystycznej analizy    #
+#   s³ownika), np: 250 oznacza, ze opis popjawia sie #
+#   1 raz na 4 wyst±pienia koñcówki.                 #
+#   Zapisana zostaje odwrotno¶æ prawdopodobieñstwa   #
+#   aby scie¿ka najbardziej prawdopodobna mia³a      #
+#   najmniejszy koszt.                               #
+######################################################
+
+######
+#STALE
+#
+# Jak bardzo prawdopodobna musi byæ dana ¶cie¿ka, aby
+# braæ j± pod uwagê? (w promilach)
+$MIN_PROB = 0;
+#
+# Maksymalna ilo¶æ powtórzeñ danej koñcówki (brane od
+# najbardziej prawdopodbnej w dó³
+$MAX_PATH = 10;
+#
+# Znak odzielajacy koncowke od prefiksu
+$PREF_SIGN = '_';
+######
+# Zmienne globalne
+# 
+# Tablica okreslajaca, ktore prefiksy nalezy uwzlednic
+# w wyjsciowym pliku.
+# Klucz - ciag znakow prefiks$PREF_SIGNopis.
+#  Wartosc: 1 - jezeli nalezy uwzglednic, 0 w przeciwnym przypadku
+my %prefs;
+#
+# maksymalna dlugosc analizowanego prefiksu
+my $MAX_PREF = 0;
+######
+
+###########################################################
+# FUNKCJE
+
+# wczytuje prefiksy do tablicy hashowej
+# parametry:
+# - nazwa pliku, z ktorego nalezy pobrac prefiksy
+#   Plik w formacie:
+#   prefiks\topis...\n
+sub load_prefs {
+
+    my $file = shift;
+    open(IN, $file);
+
+    while (<IN>) {
+	$_ =~ /^(\w+)\t([^\t]+)\t/;
+	my $key = "$1$PREF_SIGN$2";
+	my $len = length($1);
+	if ($len > $MAX_PREF) {
+	    $MAX_PREF = $len;
+	}
+	$prefs{$key} = 1;
+    }
+}
+
+###########################################################
+
+# Jezeli podano parametr to jest to nazwa pliku z prefiksami
+
+if (@ARGV > 0) {
+#    print "Laduje prefiksy ($ARGV[0])\n";
+    load_prefs(shift);
+#     print "Zaladowane:\n";
+#     for $key (keys(%prefs)) {
+# 	print "$key\t$prefs{$key}\n";
+#     }
+#     print "++++++++++++++++++++++++++++++++++++++++++++++++++\n";
+}
+
+@input = <>;
+
+#$max = 0;
+
+#for $m (@input) {
+#    $m =~ /(\w+);.*$/;
+#    if (length($1) > $max) {
+#	$max = length($1);
+#    }
+#}
+
+$n = 2; #$max; 
+
+$go = 1;
+
+while ($go) {
+
+    my %koncowki;
+    my $sumy;
+ 
+    $go = 0;
+    for $m (@input) {
+	if ($m =~ /(\w{$n});(.*)$/) {
+	    $go = 1;
+	    my $ending = $1;
+	    my $desc = $2;
+	    for (my $i=$MAX_PREF; $i>0; $i--) {
+		$m =~ /^(\w{$i}).*/;
+		my $key = "$1$PREF_SIGN$desc";
+		if ($prefs{$key} == 1) {
+		    $ending .= "$PREF_SIGN$1";
+		    last;
+		}
+	    }
+	    $koncowki{$ending.";".$desc}++;
+	    $sumy{$ending}++;
+	}
+    }
+
+    print "\n";
+ 
+    for $koncowka (keys %koncowki) {
+	$koncowka =~ /^(.*);(.*)$/;
+	my $ending = $1;
+	my $opis = $2;
+	$p = $koncowki{$koncowka} / $sumy{$ending};
+        $p *= 1000;                     #wartosc w promilach
+
+	if ($p <= $MIN_PROB) {
+	    next;
+	}
+
+	#if ($p == 1000) {
+	#    $p--;
+	#}
+
+        #$p = 1000 - $p;                 #odwrotnosc
+	my $old = $2;
+	$ending =~ /^(\w+)$PREF_SIGN(\w+)/;
+
+	my $rev = reverse($1);
+
+	if ($2 !~ /^$old$/) {
+	    $rev .= "$PREF_SIGN$2";
+	}
+
+	# opakowujemy znak '-' znakami [] ;) dla lextools
+	$opis =~ s/-/\[-\]/;
+
+	printf "%s~%.0f;%s\n", $rev, $p, $opis;
+    }
+
+  $n++;
+
+}
Index: _old/nawszelkiwypadek/tools/gue_dic/stat_pre.pl
===================================================================
--- _old/nawszelkiwypadek/tools/gue_dic/stat_pre.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/nawszelkiwypadek/tools/gue_dic/stat_pre.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,95 @@
+#! /usr/bin/perl
+
+use locale;
+
+######################################################
+# na wej¶ciu znajduje siê plik zawieraj±cy linie     #
+# postaci:                                           #
+# slowo;opis                                         #
+#                                                    #
+# na wyj¶ciu ma siê znaleŒæ plik zawieraj±cy linie:  #
+# koñcówka(rev);prawdopodobieñstwo;opis              #
+# gdzie:                                             #
+# - koñcówka(rev) jest koñcówk± wyrazu zapisan±      #
+#   w odwrotnej kolejno¶ci, dla ka¿dego wyrazu       #
+#   w s³owniku wypisujemy koñcówki o d³ugo¶ciach     #
+#   od 1 do d³ugo¶ci wyrazu,                         #
+# - prawdopodobieñstwo jest prawdopodobieñstwem      #
+#   wyst±pienia danego opisu dla danej koñcówki      #
+#   (obliczonym na podstwie statystycznej analizy    #
+#   s³ownika), np: 250 oznacza, ze opis popjawia sie #
+#   1 raz na 4 wyst±pienia koñcówki.                 #
+#   Zapisana zostaje odwrotno¶æ prawdopodobieñstwa   #
+#   aby scie¿ka najbardziej prawdopodobna mia³a      #
+#   najmniejszy koszt.                               #
+######################################################
+
+######
+#STALE
+#
+# Jak bardzo prawdopodobna musi byæ dana ¶cie¿ka, aby
+# braæ j± pod uwagê? (w promilach)
+$MIN_PROB = 0;
+#
+# Maksymalna ilo¶æ powtórzeñ danej koñcówki (brane od
+# najbardziej prawdopodbnej w dó³
+$MAX_PATH = 10;
+#
+######
+
+@input = <>;
+
+#$max = 0;
+
+#for $m (@input) {
+#    $m =~ /(\w+);.*$/;
+#    if (length($1) > $max) {
+#	$max = length($1);
+#    }
+#}
+
+$n = 1; #$max; 
+
+$go = 1;
+
+while ($n<7) {
+
+    my %prefiksy;
+    my $sumy;
+ 
+    $go = 0;
+    for $m (@input) {
+	if ($m =~ /^(\w{$n})\w*;(.*)$/) {
+	    $go = 1;
+	    $prefiksy{$1.";".$2}++;
+	    $sumy{$1}++;
+	}
+    }
+
+    print "\n";
+ 
+    for $prefiks (keys %prefiksy) {
+	$prefiks =~ /^(.*);(.*)$/;
+	$p = $prefiksy{$prefiks} / $sumy{$1};
+        $p *= 1000;                     #wartosc w promilach
+
+	if ($p <= $MIN_PROB) {
+	    next;
+	}
+
+	#if ($p == 1000) {
+	#    $p--;
+	#}
+
+        $p = 1000 - $p;                 #odwrotnosc
+#	$rev = reverse($1);
+	# opakowujemy znak '-' znakami [] ;)
+	$opis = $2;
+	$opis =~ s/-/\[-\]/;
+
+	printf "%s~%.0f;%s\n", $1, $p, $opis;
+    }
+
+  $n++;
+
+}
Index: _old/nawszelkiwypadek/tools/lem_dic/makeLabels.pl
===================================================================
--- _old/nawszelkiwypadek/tools/lem_dic/makeLabels.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/nawszelkiwypadek/tools/lem_dic/makeLabels.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,11 @@
+#!/usr/bin/perl
+
+use locale;
+
+print "lcase	a ± b c æ d e ê f g h i j k l ³ m n ñ o ó p q r s ¶ t u v w x y z Œ ¿ é ö ü ä\n";
+print "ucase	A ¡ B C Æ D E Ê F G H I J K L £ M N Ñ O Ó P Q R S Š T U V W X Y Z ¬ ¯\n";
+print "letter	lcase ucase\n";
+print "digit	0 1 2 3 4 5 6 7 8 9\n";
+print "signs    , . @ \/ \'\n";
+print "sem	~ ; _ - + ? \\ \n";
+print "all	letter digit signs sem\n";
Index: _old/nawszelkiwypadek/tools/lem_dic/prep.pl
===================================================================
--- _old/nawszelkiwypadek/tools/lem_dic/prep.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/nawszelkiwypadek/tools/lem_dic/prep.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,75 @@
+#! /usr/bin/perl
+
+use locale;
+use strict;
+
+my $file = shift;
+my $filename;
+
+if ($file eq "") {
+    print "Podaj nazwê pliku.\n";
+    exit(1);
+}
+
+if ($file =~ /(.*)\.dic/)
+{
+    $filename = $1;
+}
+else
+{
+    print "The input file must have .dic extension.";
+    exit(1);
+}
+
+`makeLabels.pl > labels.sym`;
+
+`lexmakelab labels`;
+
+print "Kanonizujê opisy.........................................";
+
+#`canon.pl <$file >temp2`;
+
+print "Kompilujê automat........................................";
+
+`lexcomplex -l labels.lab -S labels.scl <$file > temp1`;
+
+print "OK\n";
+
+print "Usuwam epsilon-przejscia.................................";
+
+`fsmrmepsilon temp1> temp2`;
+
+print "OK\n";
+
+print "Determinizujê automat....................................";
+
+`fsmdeterminize temp2 > temp1`;
+
+print "OK\n";
+
+print "Minimalizujê automat.....................................";
+
+`fsmminimize temp1> temp2`;
+
+print "OK\n";
+
+print "Konwertujê automat do formatu fsa........................";
+
+`fsmprint -i labels.lab temp2> temp1`;
+
+`cp temp1 pofsmprint`;
+
+`../fsm2aut temp1> temp2`;
+
+`./aut2fsa.nowy < temp2> $filename.bin`;
+
+print "OK\n";
+
+print "Czyszczê pliki pomocnicze................................";
+
+`rm temp2`;
+`rm temp1`;
+#`rm labels.*`;
+
+print "OK\n";
+
Index: _old/www/authors.php
===================================================================
--- _old/www/authors.php	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/www/authors.php	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,10 @@
+<?php
+require_once 'locale.php';
+require_once 'cmn_frame.php';
+
+$title = '<title>UAM Text Tools - '.AUTHORS_TITLE."</title>\n";
+$context = AUTHORS_CONTENT;
+
+getMainPage($title, $context);
+
+?>
Index: _old/www/cmn_frame.php
===================================================================
--- _old/www/cmn_frame.php	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/www/cmn_frame.php	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,57 @@
+<?php
+
+require_once 'locale.php';
+
+function getMainPage($header, $content) {
+  echo "<html><head>\n";
+  echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-2\">\n";
+  echo "<link type='text/css' href='css/utt.css' rel='stylesheet'>\n";
+  echo "<script type=\"text/javascript\" src=\"js/menu.js\"></script>\n";
+  if(isset($header)) {
+	# jesli pominieto znacznik tytulu - dodajemy sami
+	if (stristr($header, '<title>') === false) {
+	  	echo '<title>'.DEFAULT_PAGE_TITLE."</title>\n";
+	}
+    echo $header;
+  }
+  else {
+  	echo '<title>'.DEFAULT_PAGE_TITLE."</title>\n";
+  }
+  echo "</head>\n";
+  echo "<body>\n";
+  echo "<table class=\"page_table\">\n";
+  echo "<tr>\n";
+  echo "  <td class=\"page_title\" colspan=\"3\">".PAGE_HEADER."</td>\n";
+  echo "</tr>\n";
+  echo "<tr>\n";
+  echo "  <td class=\"page_menu\">\n";
+  echo "    <table class=\"main_menu\" align=\"center\" cellspacing=\"1\">\n";
+  $menu = array("index.php" => MENU_MAIN_PAGE,
+  		        "help.php" => MENU_HELP,
+				"licence.php" => MENU_LICENSE,
+				"authors.php" => MENU_AUTHORS,
+				"down.php" => MENU_DOWNLOADS);
+
+  foreach($menu as $page=>$descr) {
+	  echo "      <tr>\n";
+	  echo "        <td class=\"main_menu_cell\"\n";
+	  echo "			   onMouseOver=\"return menu_select_element(this, true);\"\n";
+	  echo "			   onMouseOut=\"return menu_select_element(this, false);\"\n";
+	  echo "			   onClick=\"window.location='".$page."'; return true;\"\n";
+	  echo "        >\n";
+	  echo          $descr."\n";
+	  echo "        </td>\n";
+	  echo "      </tr>\n";
+  }
+  echo "      </table>\n";
+  echo "	</td>\n";
+  echo "    <td class=\"page_content\">\n";
+  echo $content;
+  echo "	</td>\n";
+  echo "    <td class=\"page_left_margin\">&nbsp;</td>\n";
+  echo "  </tr>\n";
+  echo "</table>\n";
+  echo "</body></html>\n";
+}
+
+?>
Index: _old/www/css/utt.css
===================================================================
--- _old/www/css/utt.css	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/www/css/utt.css	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,105 @@
+BODY {
+  FONT-FAMILY: Verdana, Arial, Helvetica;
+  FONT-SIZE: 13px;
+  background-color: #CCFF99;
+/*
+#FFF8DC pomaranczowy
+#F5F5DC be¿owy
+#F0F8FF jasnoniebieski
+
+  font-style: italic;
+  font-weight: bold;
+  text-decoration: underline;
+*/
+}
+
+.page_table {
+  width: 100%;
+  border: 0px solid black;
+  margin-top: 30px;
+}
+
+.page_title {
+  text-align: center;
+  font-size: 30px;
+  font-weight: bold;
+  padding-bottom: 20px;
+}
+
+.page_menu {
+  width: 20%;
+  vertical-align: top;
+}
+
+.main_menu {
+ border: 0 solid black;
+ width: 80%;
+}
+
+.main_menu_cell {
+  border-width:2px;
+  border-style: outset;
+/*  text-align: center; */
+/*  margin-left: 200px; */
+  padding-left: 10px;
+  font-weight: bold;
+  color: #006600; /*#336600;*/
+  text-decoration: none;
+  font-family: monospace;
+}
+
+.page_content {
+  vertical-align: top;
+  padding: 10px;
+  background-color: #FFFFFF;
+  height: 400px;
+}
+
+.page_left_margin {
+  width: 10%;
+}
+
+.distribution {
+/*  padding: 30px; */
+/*  margin: 30px; */
+  border-spacing: 10px;
+}
+
+.distribution .app, .distribution .dict {
+  border-spacing: 10px;
+}
+
+.distribution .product {
+/*  background-color: #CCCC66;*/
+  font-size: larger;
+  text-transform: capitalize;
+  font-weight: bold;
+}
+
+.distribution .product td {
+  border-bottom: solid 2px #669933;
+}
+
+.distribution .dist_type {
+/*  background-color: orange; */
+  font-family: Courier New; /* monospace;*/
+  text-transform: uppercase;
+  font-size: smaller;
+  border-bottom: solid 1px #669933;
+  width: 30%;
+}
+
+.distribution .dist_item {
+  font-size: smaller;
+  vertical-align: top;
+}
+
+.distribution .dist_item img {
+  width: 16px;
+  vertical-align: bottom;
+}
+
+.distribution .dist_item a {
+  text-decoration: none;
+  color: blue;
+}
Index: _old/www/dbconst.php
===================================================================
--- _old/www/dbconst.php	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/www/dbconst.php	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,9 @@
+<?php
+
+define('DB_HOST', 'mysql.amu.edu.pl');
+define('DB_NAME', 'utt');
+define('DB_USER', 'utt');
+define('DB_PASSWD', 'bazadanych');
+define('DB_CHARSET', 'utf8');
+
+?>
Index: _old/www/down.php
===================================================================
--- _old/www/down.php	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/www/down.php	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,92 @@
+<?php
+require_once 'locale.php';
+require_once 'cmn_frame.php';
+
+$archiwa = array('utt' => array(),
+                 'utt-dict' => array()
+                );
+
+$dn = "files/";
+if ($dh = opendir($dn)) {
+	while (($file = readdir($dh)) !== false) {
+		if(true == is_file($dn.$file)) {
+			if(preg_match('/^utt\-dict\-.+?\.(.+)$/', $file, $dopasowania)) {
+				$arch_type = $dopasowania[1];
+				if(! array_key_exists($arch_type, $archiwa['utt-dict'])) {
+                   $archiwa['utt-dict'][$arch_type] = array();
+				}
+				$archiwa['utt-dict'][$arch_type][] = $file;
+			}
+			else if(preg_match('/^utt\-\d.+?\.(.+)$/', $file, $dopasowania)) {
+				$arch_type = $dopasowania[1];
+				if(! array_key_exists($arch_type, $archiwa['utt'])) {
+                   $archiwa['utt'][$arch_type] = array();
+				}
+				$archiwa['utt'][$arch_type][] = $file;
+			}
+		} // if is file
+	} // while
+	closedir($dh);
+} // if opendir
+//print_r($archiwa);
+
+$title = '<title>UAM Text Tools - '.DOWNLOAD_SELECTFILE_PAGE_TITLE."</title>\n";
+
+$content = "<p>".DOWNLOAD_SELECTFILE_CAPTION.":</p>\n";
+$content .= '<table class="distribution" width="100%">';
+# aplikacja
+$content .= '<tr class="product"><td>'.DOWNLOAD_SELECTFILE_APP_CAPTION."</td></tr>\n";
+$content .= '<tr><td>';
+if(count(array_keys($archiwa['utt'])) > 0) {
+	$content .= '<table class="app" width="100%">';
+	$content .= "\n";
+	foreach (array_keys($archiwa['utt']) as $dist_type) {
+		$content .= '<tr><td class="dist_type">'.DOWNLOAD_SELECTFILE_DISTRIBUTION_TYPE." $dist_type</td><td>&nbsp;</td></tr>\n";
+		$content .= "<tr><td colspan='2'>\n<table width='100%'>";
+		$arr = $archiwa['utt'][$dist_type];
+		rsort($arr);
+		foreach($arr as $app) {
+			$content .= "<tr>\n<td class=\"dist_item\">\n";
+			$content .= "<a href=\"down_form.php?filename=".$app."\">";
+			$content .= "<img src=\"im/down.jpg\" border=\"0\" />";
+			$content .= $app."</a> (".(filesize($dn.$app)/1024)." KB)\n";
+			$content .= "</td></tr>\n";
+		}
+		$content .= "</table>\n</td></tr>\n";
+	}
+	$content .= "</table>\n";
+}
+else {
+	$content .= DOWNLOAD_SELECTFILE_NO_FILE."\n";
+}
+
+# slowniki
+$content .= '<tr class="product"><td>'.DOWNLOAD_SELECTFILE_DICT_CAPTION."</td></tr>\n";
+$content .= '<tr><td>';
+if(count(array_keys($archiwa['utt-dict'])) > 0) {
+	$content .= '<table class="dict" width="100%">';
+	$content .= "\n";
+	foreach (array_keys($archiwa['utt-dict']) as $dist_type) {
+		$content .= '<tr><td class="dist_type">'.DOWNLOAD_SELECTFILE_DISTRIBUTION_TYPE." $dist_type</td><td>&nbsp;</td></tr>\n";
+		$content .= "<tr><td colspan='2'>\n<table width='100%'>";
+		$arr = $archiwa['utt-dict'][$dist_type];
+		rsort($arr);
+		foreach($arr as $dict) {
+			$content .= "<tr>\n<td class=\"dist_item\">\n";
+			$content .= "<a href=\"down_form.php?filename=".$dict."\">";
+			$content .= "<img src=\"im/down.jpg\" border=\"0\" />";
+			$content .= $dict."</a> (".(filesize($dn.$dict)/1024)." KB)\n";
+			$content .= "</td></tr>\n";
+		}
+		$content .= "</table>\n</td></tr>\n";
+	}
+	$content .= "</table>\n";
+}
+else {
+	$content .= DOWNLOAD_SELECTFILE_NO_FILE."\n";
+}
+$content .= '</td></tr></table>';
+$content .= "\n";
+
+getMainPage($title, $content);
+?>
Index: _old/www/down_form.php
===================================================================
--- _old/www/down_form.php	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/www/down_form.php	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,24 @@
+<?php
+require_once 'locale.php';
+require_once 'cmn_frame.php';
+
+  if(isset($_GET['filename'])) {
+	$title = '<title>UAM Text Tools - '.DOWNLOAD_FORM_PAGE_TITLE."</title>\n";
+
+	$content = "<h3>".DOWNLOAD_FORM_CAPTION."</h3>\n".
+	    "<table border='1' align='center'><form action='down_thanks.php' method='post'>\n".
+	  	"<tr><td>".DOWNLOAD_FORM_FIELD_FIRSTNAME.":</td><td><input type='text' name='_firstname' value=''></td></tr>\n".
+	  	"<tr><td>".DOWNLOAD_FORM_FIELD_NAME.":</td><td><input type='text' name='_name' value=''></td></tr>\n".
+	  	"<tr><td>".DOWNLOAD_FORM_FIELD_ORGANIZATION.":</td><td><input type='text' name='_organization' value=''></td></tr>\n".
+	  	"<tr><td>".DOWNLOAD_FORM_FIELD_COUNTRY.":</td><td><input type='text' name='_country' value=''></td></tr>\n".
+	  	"<tr><td>".DOWNLOAD_FORM_FIELD_EMAIL.":</td><td><input type='text' name='_email' value=''></td></tr>\n".
+	  	"<tr><td colspan='2' align=\"center\">\n".
+	  	        "<input type='submit' value='".DOWNLOAD_FORM_FIELD_NEXT." &gt;'></td></tr>\n".
+	    "<input type=\"hidden\" name='_filename' value=\"".$_GET['filename']."\">\n".
+	  	"</form></table>\n";
+	getMainPage($title, $content);
+  }
+  else {
+    header('Location: http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/down.php');
+  }
+?>
Index: _old/www/down_thanks.php
===================================================================
--- _old/www/down_thanks.php	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/www/down_thanks.php	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,63 @@
+<?php
+
+  require_once 'locale.php';
+  require_once 'dbconst.php';
+  require_once 'cmn_frame.php';
+
+function _wu($text) {
+  return iconv("cp1250", "utf-8", $text);
+}
+
+function save_user() {
+  $firstname = isset($_POST['_firstname']) ? _wu($_POST['_firstname']) : 'NULL';
+  $name = isset($_POST['_name']) ? _wu($_POST['_name']) : 'NULL';
+  $organization = isset($_POST['_organization']) ? _wu($_POST['_organization']) : 'NULL';
+  $country = isset($_POST['_country']) ? _wu($_POST['_country']) : 'NULL';
+  $email = isset($_POST['_email']) ? _wu($_POST['_email']) : 'NULL';
+  $ip = $_SERVER['REMOTE_ADDR'];
+  $filename = _wu($_POST['_filename']);
+  $now = date("Y-m-d H:i:s");
+
+  $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWD)
+          or die (DB_ERROR.': '.mysql_error().' ('.mysql_errno().')');
+
+  mysql_select_db (DB_NAME)
+  or die (DB_ERROR.': '.mysql_error().' ('.mysql_errno().')');
+
+  /* Ustawiamy kodowanie */
+  mysql_query("SET NAMES '".DB_CHARSET."'")
+  or die (DB_ERROR.': '.mysql_error().' ('.mysql_errno().')');
+
+  $sql = "INSERT INTO `utt_downloaders`(`firstname`, `name`, ".
+  	   	 		 "`organization`, `country`, `email`, ".
+  				 "`ip`, `filename`, `date`) ".
+  	     "VALUES('$firstname', '$name', ".
+				 "'$organization', '$country', '$email', ".
+				 "'$ip', '$filename', '$now')";
+//echo "Execute query: $sql<br />\n";
+  mysql_query($sql)
+  or die(DB_ERROR.': '.mysql_error().' ('.mysql_errno().')');
+
+  mysql_close($link);
+}
+
+
+// main part
+//  print_r($_SERVER);
+//  print_r($_POST);
+  if(isset($_POST['_filename'])) {
+    save_user();
+    $head = '<title>UAM Text Tools - '.DOWNLOAD_THANKS_PAGE_TITLE."</title>\n";
+    $head .= "<meta HTTP-EQUIV=\"REFRESH\" content=\"5; url=files/".$_POST['_filename']."\">\n";
+	$content = DOWNLOAD_THANKS_CAPTION."<br />\n".
+    		   "<br />".DOWNLOAD_THANKS_EXTRA_LINK.
+			   " <a href=\"files/".$_POST['_filename']."\">".$_POST['_filename']."</a>.<br />\n".
+			   "<a href=index.php>".DOWNLOAD_THANKS_MAINPAGE_LINK."</a>\n";
+
+     getMainPage($head, $content);
+  }
+  else {
+    header('Location: http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/down.php');
+  }
+
+?>
Index: _old/www/help.php
===================================================================
--- _old/www/help.php	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/www/help.php	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,10 @@
+<?php
+require_once 'locale.php';
+require_once 'cmn_frame.php';
+
+$title = '<title>UAM Text Tools - '.HELP_PAGE_TITLE."</title>\n";
+$context = HELP_PAGE_CONTENT;
+
+getMainPage($title, $context);
+
+?>
Index: _old/www/index.php
===================================================================
--- _old/www/index.php	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/www/index.php	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,10 @@
+<?php
+require_once 'locale.php';
+require_once 'cmn_frame.php';
+
+$title = '<title>UAM Text Tools - '.MAIN_PAGE_TITLE."</title>\n";
+$context = "<p><img src=\"im/uam.jpg\" title=\"God³o UAM\" alt=\"uam logo\" align=\"right\" /></p>\n".MAIN_PAGE_CONTENT;
+
+getMainPage($title, $context);
+
+?>
Index: _old/www/js/menu.js
===================================================================
--- _old/www/js/menu.js	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/www/js/menu.js	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,13 @@
+function menu_select_element(el_menu, is_selected) {
+
+  if(is_selected) {
+    el_menu.style.background = '#00FF66';
+    el_menu.style.cursor = 'hand';  // for IE
+    el_menu.style.cursor = 'pointer';
+  }
+  else {
+    el_menu.style.background = '#CCFF99';
+    el_menu.style.cursor = 'default';
+  }
+  return true;
+}
Index: _old/www/lang/locale.en
===================================================================
--- _old/www/lang/locale.en	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/www/lang/locale.en	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,6 @@
+<?php
+/**
+ * Plik z etykietami po angielsku.
+ */
+
+?>
Index: _old/www/lang/locale.pl
===================================================================
--- _old/www/lang/locale.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/www/lang/locale.pl	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,83 @@
+<?php
+/**
+ * Plik z etykietami po polsku.
+ */
+
+# komunikaty o bledach
+define('DB_ERROR', 'B³±d bazy danych');
+
+# elementy wspolne dla stron
+define('DEFAULT_PAGE_TITLE', 'UAM Text Tools Homepage');
+define('PAGE_HEADER', 'UAM Text Tools');
+define('MENU_MAIN_PAGE', 'Strona g³ówna');
+define('MENU_HELP', 'Pomoc');
+define('MENU_LICENSE', 'Licencja');
+define('MENU_AUTHORS', 'O autorach');
+define('MENU_DOWNLOADS', 'Do pobrania');
+define('MENU_DOWNLOAD_LINK', 'Pobierz plik');
+
+# strona glowna
+define('MAIN_PAGE_TITLE', 'Strona g³ówna');
+define('MAIN_PAGE_CONTENT', "<p>\n".
+	  	 "Witamy na naszej stronie.\n".
+	  	 "</p>\n".
+	  	 "<p>O stronie<br />\n".
+	     "Budowanie stron, ze wzglêdu na to, ¿e ka¿da przegl±darka na swój specyficzny sposób reaguje na niektóre polecenia, nie jest wcale proste. Nie wystarczy tylko tworzyæ zgodnie ze standardami, ale trzeba tak¿e zatroszczyæ siê o to, ¿eby w starszych przegl±darkach, ci±gle u¿ywanych (przede wszystkim Internet Explorer), strona prezentowa³a siê dobrze.</p>\n".
+	  	 "<p>Celem powstania tej strony by³o zebranie wszystkich aktualnych informacji dotycz±cych jêzyków HTML, XHTML, CSS oraz DOM w jednym miejscu. Znajdziesz tutaj zarówno informacje typowe, z oficjalnych specyfikacji, ale tak¿e, w formie ciekawostki, liczne rozszerzenia przegl±darek.</p>\n".
+	  	 "<p>W chwili obecnej znajduj± siê tutaj informacje o 119 znacznikach HTML oraz 187 atrybutach stylów. W przysz³o¶ci systematycznie bêd± dodawane polecenia ze specyfikacji XHTML 2.0, Web Applications 1.0 oraz CSS 3.0</p>\n".
+	  	 "<p>Polecane: Profesjonalne tworzenie stron www</p>\n");
+
+# O autorach
+define('AUTHORS_TITLE', 'O autorach');
+define('AUTHORS_CONTENT', "<p>Tu bêdziemy my!</p>\n");
+
+# Do pobrania 1/3
+define('DOWNLOAD_SELECTFILE_PAGE_TITLE', 'Do pobrania 1/3');
+define('DOWNLOAD_SELECTFILE_CAPTION', 'Dostêpne w archiwum pliki');
+define('DOWNLOAD_SELECTFILE_NO_FILE', '<strong>B³±d!</strong> Nie znaleziono ¿adnego pliku!');
+define('DOWNLOAD_SELECTFILE_APP_CAPTION', 'Dostêpne wersje narzêdzi UTT');
+define('DOWNLOAD_SELECTFILE_DICT_CAPTION', 'Dostêpne wersje s³owników');
+define('DOWNLOAD_SELECTFILE_DISTRIBUTION_TYPE', 'Dystrybucja');
+
+# Do pobrania 2/3
+define('DOWNLOAD_FORM_PAGE_TITLE', 'Do pobrania 2/3');
+define('DOWNLOAD_FORM_CAPTION', 'Przed pobraniem pliku wype³nij poni¿szy formularz');
+define('DOWNLOAD_FORM_FIELD_FIRSTNAME', 'Imiê');
+define('DOWNLOAD_FORM_FIELD_NAME', 'Nazwisko');
+define('DOWNLOAD_FORM_FIELD_ORGANIZATION', 'Organizacja');
+define('DOWNLOAD_FORM_FIELD_COUNTRY', 'Kraj');
+define('DOWNLOAD_FORM_FIELD_EMAIL', 'Adres emailowy');
+define('DOWNLOAD_FORM_FIELD_NEXT', 'Dalej');
+
+# Do pobrania 3/3
+define('DOWNLOAD_THANKS_PAGE_TITLE', 'Do pobrania 3/3');
+define('DOWNLOAD_THANKS_CAPTION', 'Dziêkujemy za zainteresowanie narzêdziami UTT!');
+define('DOWNLOAD_THANKS_EXTRA_LINK', 'Je¶li pobieranie pliku nie rozpoczê³o siê automatycznie, kliknij link');
+define('DOWNLOAD_THANKS_MAINPAGE_LINK', 'Wróæ do Strony g³ównej');
+
+# Pomoc
+define('HELP_PAGE_TITLE', 'Pomoc');
+define('HELP_PAGE_CONTENT', "<p>\n".
+	  "Pomocy!!!
+	  </p>
+	  <p>O stronie<br />
+	     Budowanie stron, ze wzglêdu na to, ¿e ka¿da przegl±darka na swój specyficzny sposób reaguje na niektóre polecenia, nie jest wcale proste. Nie wystarczy tylko tworzyæ zgodnie ze standardami, ale trzeba tak¿e zatroszczyæ siê o to, ¿eby w starszych przegl±darkach, ci±gle u¿ywanych (przede wszystkim Internet Explorer), strona prezentowa³a siê dobrze.</p>
+	  <p>Celem powstania tej strony by³o zebranie wszystkich aktualnych informacji dotycz±cych jêzyków HTML, XHTML, CSS oraz DOM w jednym miejscu. Znajdziesz tutaj zarówno informacje typowe, z oficjalnych specyfikacji, ale tak¿e, w formie ciekawostki, liczne rozszerzenia przegl±darek.</p>
+	  <p>W chwili obecnej znajduj± siê tutaj informacje o 119 znacznikach HTML oraz 187 atrybutach stylów. W przysz³o¶ci systematycznie bêd± dodawane polecenia ze specyfikacji XHTML 2.0, Web Applications 1.0 oraz CSS 3.0</p>
+	  <p>Polecane: Profesjonalne tworzenie stron www</p>
+	  <p>O stronie<br />
+	     Budowanie stron, ze wzglêdu na to, ¿e ka¿da przegl±darka na swój specyficzny sposób reaguje na niektóre polecenia, nie jest wcale proste. Nie wystarczy tylko tworzyæ zgodnie ze standardami, ale trzeba tak¿e zatroszczyæ siê o to, ¿eby w starszych przegl±darkach, ci±gle u¿ywanych (przede wszystkim Internet Explorer), strona prezentowa³a siê dobrze.</p>
+	  <p>Celem powstania tej strony by³o zebranie wszystkich aktualnych informacji dotycz±cych jêzyków HTML, XHTML, CSS oraz DOM w jednym miejscu. Znajdziesz tutaj zarówno informacje typowe, z oficjalnych specyfikacji, ale tak¿e, w formie ciekawostki, liczne rozszerzenia przegl±darek.</p>
+	  <p>W chwili obecnej znajduj± siê tutaj informacje o 119 znacznikach HTML oraz 187 atrybutach stylów. W przysz³o¶ci systematycznie bêd± dodawane polecenia ze specyfikacji XHTML 2.0, Web Applications 1.0 oraz CSS 3.0</p>
+	  <p>Polecane: Profesjonalne tworzenie stron www</p>
+	  <p>O stronie<br />
+	     Budowanie stron, ze wzglêdu na to, ¿e ka¿da przegl±darka na swój specyficzny sposób reaguje na niektóre polecenia, nie jest wcale proste. Nie wystarczy tylko tworzyæ zgodnie ze standardami, ale trzeba tak¿e zatroszczyæ siê o to, ¿eby w starszych przegl±darkach, ci±gle u¿ywanych (przede wszystkim Internet Explorer), strona prezentowa³a siê dobrze.</p>
+	  <p>Celem powstania tej strony by³o zebranie wszystkich aktualnych informacji dotycz±cych jêzyków HTML, XHTML, CSS oraz DOM w jednym miejscu. Znajdziesz tutaj zarówno informacje typowe, z oficjalnych specyfikacji, ale tak¿e, w formie ciekawostki, liczne rozszerzenia przegl±darek.</p>
+	  <p>W chwili obecnej znajduj± siê tutaj informacje o 119 znacznikach HTML oraz 187 atrybutach stylów. W przysz³o¶ci systematycznie bêd± dodawane polecenia ze specyfikacji XHTML 2.0, Web Applications 1.0 oraz CSS 3.0</p>
+	  <p>Polecane: Profesjonalne tworzenie stron www</p>\n");
+
+# Licencja
+define('LICENSE_PAGE_TITLE', 'Licencja');
+define('LICENSE_PAGE_CONTENT', "<p>UTeTe jest debe¶ciarskie!</p>\n");
+
+?>
Index: _old/www/licence.php
===================================================================
--- _old/www/licence.php	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/www/licence.php	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,10 @@
+<?php
+require_once 'locale.php';
+require_once 'cmn_frame.php';
+
+$title = '<title>UAM Text Tools - '.LICENSE_PAGE_TITLE."</title>\n";
+$context = LICENSE_PAGE_CONTENT;
+
+getMainPage($title, $context);
+
+?>
Index: _old/www/locale.php
===================================================================
--- _old/www/locale.php	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
+++ _old/www/locale.php	(revision 57728c1d40118b66361f4d949f1ad6409070f9c6)
@@ -0,0 +1,5 @@
+<?php
+  include "lang/locale.pl";
+//  include "lang/locale.en";
+
+?>
Index: p/Makefile
===================================================================
--- app/Makefile	(revision adb4c8d65ba8b406a1703d1c091bcf1af4bdfb3c)
+++ 	(revision )
@@ -1,151 +1,0 @@
-# main makefile
-
-# ******************************
-# * Local variables
-# ******************************
-CUR_DIR=$(shell pwd)
-SRC_DIR=$(CUR_DIR)/src
-OUTPUT_DIR=$(CUR_DIR)/output
-
-# ******************************
-# * Global for make globals
-# ******************************
-
-export UTT_DIR=${OUTPUT_DIR}
-
-# executables
-export UTT_BIN_DIR=${UTT_DIR}/bin
-# configuration files
-export UTT_CONF_DIR=${UTT_DIR}/etc/utt
-# language/encoding specific stuff
-# any extra files for some programs, like: weights.kor, cats.dgc, gram.dgc, etc.
-export UTT_LANG_DIR=${UTT_DIR}/share/utt
-# some files like ser.l.template, terms.m4
-export UTT_LIB_DIR=${UTT_DIR}/lib/utt
-# stuff like documantation (man, info), docs: FAQ, COPYRIGHT, NEWS, README
-export UTT_SHARE_DIR=${UTT_DIR}/share
-
-##############################
-
-# list of components to be included in the distribution
-COMPONENTS = compiledic cor dgp fla gph grp gue kon kor kot lem mar rm12 rs12 sen-l sen-nl ser tags tok.l unfla
-
-##############################
-
-# ------------------------------------------------------------------
-# sekcja kompilacji (kompiluje i wgrywa do OUTPUT_DIR)
-# ------------------------------------------------------------------
-.PHONY: compile
-compile: dirs components
-	@echo "Make compiled successfully!"
-
-.PHONY: dirs
-dirs:
-	if [ -d ${UTT_DIR} ]; then rm -r ${UTT_DIR}; fi
-	mkdir -p ${UTT_DIR}
-	mkdir -p ${UTT_BIN_DIR}
-	mkdir -p ${UTT_CONF_DIR}
-	mkdir -p ${UTT_LANG_DIR}
-	mkdir -p ${UTT_LIB_DIR}
-	mkdir -p ${UTT_SHARE_DIR}/utt
-	mkdir -p ${UTT_SHARE_DIR}/doc/utt
-	mkdir -p ${UTT_SHARE_DIR}/info
-	mkdir -p ${UTT_SHARE_DIR}/man/man3
-
-.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
-
-
-# ------------------------------------------------------------------
-# sekcja sprzatania (kasuje binaria z katalogow SRC/COMPONENTS)
-# ------------------------------------------------------------------
-.PHONY: clean
-clean: clean_components clean_doc clean_dist
-	@echo "All files cleaned successfully!"
-
-.PHONY: clean_components
-clean_components:
-	@for cmp in $(COMPONENTS); do \
-		cd $(SRC_DIR)/$$cmp && make clean ; cd $(CUR_DIR); \
-	done
-	cd $(SRC_DIR)/lib && make clean; cd $(CUR_DIR);
-
-.PHONY: clean_doc
-clean_doc:
-	cd $(CUR_DIR)/doc && make clean; cd $(CUR_DIR)
-
-.PHONY: clean_dist
-clean_dist:
-
-
-# ------------------------------------------------------------------
-# sekcja przygotowania paczki (programow wraz z dodatkowymi plikami)
-# ------------------------------------------------------------------
-.PHONY: build
-build: compile build_conf build_share build_lib build_doc
-	@echo "All files builded successfully!"
-
-.PHONY: build_conf
-build_conf:
-	cp $(CUR_DIR)/conf/*.conf $(UTT_CONF_DIR)/
-
-.PHONY: build_lib
-build_lib:
-	cp $(CUR_DIR)/lib/* $(UTT_LIB_DIR)/
-
-.PHONY: build_doc
-build_doc:
-	cd $(CUR_DIR)/doc && make && make copy; cd $(CUR_DIR)
-
-.PHONY: build_share
-build_share:
-	cp $(CUR_DIR)/share/* $(UTT_LANG_DIR)/
-
-
-# ------------------------------------------------------------------
-# sekcja tworzenia dystrybucji (tarballa, rpm, deb)
-# ------------------------------------------------------------------
-.PHONY: distribute
-distribute: build dist_tarball dist_rpm
-	@echo "All distributions created successfully!"
-
-.PHONY: dist_tarball
-dist_tarball: build
-	cd $(CUR_DIR)/dist && make tarball; cd $(CUR_DIR)
-
-.PHONY: dist_rpm
-dist_rpm: build
-	cd $(CUR_DIR)/dist && make rpm; cd $(CUR_DIR)
-
-.PHONY: dist_deb
-dist_deb: build
-	cd $(CUR_DIR)/dist && make deb; cd $(CUR_DIR)
-
-
-# ------------------------------------------------------------------
-# sekcja testowania (kasuje tarballa z TARBALL_TEST_DIR,
-# kompiluje, robi paczke,
-# tworzy tarballa i wgrywa go do TARBALL_TEST_DIR)
-# ------------------------------------------------------------------
-#install: all
-#	cd ${UTT_DIR} && make install; cd ${CUR_DIR}
-
-#uninstall:
-#	cd ${UTT_DIR} && make uninstall; cd ${DIR}
-
-#reinstall:
-#	cd ${UTT_DIR} && make reinstall; cd ${DIR}
-
-#dist: all
-#	tar -czvf $(UTT_DIST_NAME).tgz $(UTT_DIR)
-
-
-#clean_dist:
-#	if [ -d $(UTT_DIST_DIR) ]; then rm -r $(UTT_DIST_DIR); else true; fi
-#	if [ -f $(UTT_DIST_FILE).tar.bz2 ]; then rm $(UTT_DIST_FILE).tar.bz2; else true; fi
-#	if [ -f $(UTT_DIST_PMDB_FILE).tar.bz2 ]; then rm $(UTT_DIST_PMDB_FILE).tar.bz2; else true; fi
Index: p/README.developers
===================================================================
--- app/README.developers	(revision dbde463201fcd201b02716f5185307b0ea53a801)
+++ 	(revision )
@@ -1,25 +1,0 @@
-TO COMPILE UTT YOU WILL NEED:
-make
-gengetopt
-g++
-flex
-
-TO RUN UTT PROGRAMS YOU WILL NEED:
-
-perl module File::HomeDir
-
-COMMANDS TO BE RUN IN THIS DIRECTORY:
-
-% make
-
-compiles all the components, moves all files destinated for
-distribution in the directory [the value of UTT_DIR_NAME variable in
-Makefile] (currently utt-0.9)
-
-% make install
-
-installes the package in your system in the directory ~/.utt
-
-% make dist_tarball
-
-prepares distribution file named ${UTT_DIR_NAME}.tgz (currently utt-0.9.tgz)
Index: p/TODO
===================================================================
--- app/TODO	(revision 42163698fec4be6090db91fd8fcb977b8065a8c7)
+++ 	(revision )
@@ -1,25 +1,0 @@
-BARDZO WAZNE:
-*
-* instalka slownikow
-* programy maja wykrywac brak slownikow -> "No language module installed"
-  na podst zmiennej language w utt.conf, "Cannot open dict...." gdy po prostu
-  nie znajdzie pliku slownika 
-* tresc na stronie
-* statyczne laczenie bibl 32-bit (miejsce kompilacji)
-* przemyslec sposob wybierania jezyka / slownika po zainstalowaniu roznych dystrybucji [PK, TO]
-* gue nie sortuje wynikow, opcja weights dziala na odwrot
-* kor nie wykonuje zamian <jednalitera> -> <dwielitery>, np. ÅŒ rz
-
-WAZNE:
-* zamienic kota na lepszego (Kubis) [TO]
-* sen - unikac dwukrotnego wstawiania BOSow i EOSow [TO]
-* polaczyc sen'y [TO]
-* generowanie i sprawdzanie zaleznosci dla tarballa [PK]
-* Zadania zwiazane z rozbudowa ser (src/ser/TODO).
-* Nowa funkcjonalnosc dla kot? con? - kazde zdanie w nowym wierszu
-* opcja info w dgp powinna miec domyslna wartosc d lub h
-* przyspieszyc process_seg() -> obliczanie prefiksow pol z opcji -s i -S raz na poczatku programu, a nie w kolko
-* kor: nie dziala opcja distance
-* zunifikowac opcje cor i kor
-* uporzadkowac sprawe zaleznosci miedzy modulem jezykowym a wyborem tagow (tag2re)
- 
Index: p/conf/Makefile
===================================================================
--- app/conf/Makefile	(revision f1563c0f0270f57e03d1fba3f2ce99a3828b3b8c)
+++ 	(revision )
@@ -1,8 +1,0 @@
-main:
-
-copy:
-ifdef UTT_CONF_DIR
-	cp *.conf ${UTT_CONF_DIR}
-endif
-
-clean:
Index: p/conf/compiledic.conf
===================================================================
--- app/conf/compiledic.conf	(revision adb4c8d65ba8b406a1703d1c091bcf1af4bdfb3c)
+++ 	(revision )
@@ -1,13 +1,0 @@
-# ************************************************************
-# * This file was created automatically during installation. *
-# * If you don't need do not change it.                      *
-# *                                                          *
-# * UAM Text Tools                                           *
-# * Adam Mickiewicz University, Poland                       *
-# * http://utt.amu.edu.pl                                    *
-# ************************************************************
-#
-# All lines must looks like:
-# parameter_name [=] value
-#
-symbols = PATH_PREFIX/share/utt/pl_PL.ISO-8859-2/pl_PL.ISO-8859-2.sym
Index: p/conf/cor.conf
===================================================================
--- app/conf/cor.conf	(revision adb4c8d65ba8b406a1703d1c091bcf1af4bdfb3c)
+++ 	(revision )
@@ -1,14 +1,0 @@
-# ************************************************************
-# * This file was created automatically during installation. *
-# * If you don't need do not change it.                      *
-# *                                                          *
-# * UAM Text Tools                                           *
-# * Adam Mickiewicz University, Poland                       *
-# * http://utt.amu.edu.pl                                    *
-# ************************************************************
-#
-# All lines must looks like:
-# parameter_name [=] value
-#
-dictionary-home = PATH_PREFIX/share/utt
-process = W
Index: p/conf/dgc.conf
===================================================================
--- app/conf/dgc.conf	(revision 3748bd1db46143a281581cb44dc804da0190cbc2)
+++ 	(revision )
@@ -1,15 +1,0 @@
-# ************************************************************
-# * This file was created automatically during installation. *
-# * If you don't need do not change it.                      *
-# *                                                          *
-# * UAM Text Tools                                           *
-# * Adam Mickiewicz University, Poland                       *
-# * http://utt.amu.edu.pl                                    *
-# ************************************************************
-#
-# All lines must looks like:
-# parameter_name [=] value
-#
-categories = PATH_PREFIX/share/utt/cats.dgc
-grammar = PATH_PREFIX/share/utt/gram.dgc
-outputfile = PATH_PREFIX/share/utt/gram.dgp
Index: p/conf/dgp.conf
===================================================================
--- app/conf/dgp.conf	(revision 3748bd1db46143a281581cb44dc804da0190cbc2)
+++ 	(revision )
@@ -1,18 +1,0 @@
-# ************************************************************
-# * This file was created automatically during installation. *
-# * If you don't need do not change it.                      *
-# *                                                          *
-# * UAM Text Tools                                           *
-# * Adam Mickiewicz University, Poland                       *
-# * http://utt.amu.edu.pl                                    *
-# ************************************************************
-#
-# All lines must looks like:
-# parameter_name [=] value
-#
-
-grammar = PATH_PREFIX/share/utt/gram.dgp
-process = W
-process = BOS
-process = EOS
-info = d
Index: p/conf/gph.conf
===================================================================
--- app/conf/gph.conf	(revision 3748bd1db46143a281581cb44dc804da0190cbc2)
+++ 	(revision )
@@ -1,16 +1,0 @@
-# ************************************************************
-# * This file was created automatically during installation. *
-# * If you don't need do not change it.                      *
-# *                                                          *
-# * UAM Text Tools                                           *
-# * Adam Mickiewicz University, Poland                       *
-# * http://utt.amu.edu.pl                                    *
-# ************************************************************
-#
-# All lines must looks like:
-# parameter_name [=] value
-#
-process = W
-process = BOS
-process = EOS
-reset = BOS
Index: p/conf/grp.conf
===================================================================
--- app/conf/grp.conf	(revision a8ac59af2452f29bd79529f6c244991b527ba4ef)
+++ 	(revision )
@@ -1,15 +1,0 @@
-# ************************************************************
-# * This file was created automatically during installation. *
-# * If you don't need do not change it.                      *
-# *                                                          *
-# * UAM Text Tools                                           *
-# * Adam Mickiewicz University, Poland                       *
-# * http://utt.amu.edu.pl                                    *
-# ************************************************************
-#
-# All lines must looks like:
-# parameter_name [=] value
-#
-macros = PATH_PREFIX/lib/utt/terms.m4
-tags=uam
-
Index: p/conf/gue.conf
===================================================================
--- app/conf/gue.conf	(revision 6ac84d8bba375e6caf620f62d632c4fb07aa95d4)
+++ 	(revision )
@@ -1,14 +1,0 @@
-# ************************************************************
-# * This file was created automatically during installation. *
-# * If you don't need do not change it.                      *
-# *                                                          *
-# * UAM Text Tools                                           *
-# * Adam Mickiewicz University, Poland                       *
-# * http://utt.amu.edu.pl                                    *
-# ************************************************************
-#
-# All lines must looks like:
-# parameter_name [=] value
-#
-dictionary-home = PATH_PREFIX/share/utt
-process = W
Index: p/conf/kor.conf
===================================================================
--- app/conf/kor.conf	(revision 19760efd7bb36c499d7149474a4898332fa60a7c)
+++ 	(revision )
@@ -1,16 +1,0 @@
-# ************************************************************
-# * This file was created automatically during installation. *
-# * If you don't need do not change it.                      *
-# *                                                          *
-# * UAM Text Tools                                           *
-# * Adam Mickiewicz University, Poland                       *
-# * http://utt.amu.edu.pl                                    *
-# ************************************************************
-#
-# All lines must looks like:
-# parameter_name [=] value
-#
-dictionary-home = PATH_PREFIX/share/utt
-weights = PATH_PREFIX/share/utt/weights.kor
-threshold = 1.0
-process=W
Index: p/conf/lem.conf
===================================================================
--- app/conf/lem.conf	(revision adb4c8d65ba8b406a1703d1c091bcf1af4bdfb3c)
+++ 	(revision )
@@ -1,14 +1,0 @@
-# ************************************************************
-# * This file was created automatically during installation. *
-# * If you don't need do not change it.                      *
-# *                                                          *
-# * UAM Text Tools                                           *
-# * Adam Mickiewicz University, Poland                       *
-# * http://utt.amu.edu.pl                                    *
-# ************************************************************
-#
-# All lines must looks like:
-# parameter_name [=] value
-#
-dictionary-home = PATH_PREFIX/share/utt
-process = W
Index: p/conf/mar.conf
===================================================================
--- app/conf/mar.conf	(revision a8ac59af2452f29bd79529f6c244991b527ba4ef)
+++ 	(revision )
@@ -1,15 +1,0 @@
-# ************************************************************
-# * This file was created automatically during installation. *
-# * If you don't need do not change it.                      *
-# *                                                          *
-# * UAM Text Tools                                           *
-# * Adam Mickiewicz University, Poland                       *
-# * http://utt.amu.edu.pl                                    *
-# ************************************************************
-#
-# All lines must looks like:
-# parameter_name [=] value
-#
-macros = PATH_PREFIX/lib/utt/terms.m4
-tags=uam
-
Index: p/conf/ser.conf
===================================================================
--- app/conf/ser.conf	(revision 19760efd7bb36c499d7149474a4898332fa60a7c)
+++ 	(revision )
@@ -1,15 +1,0 @@
-# ************************************************************
-# * This file was created automatically during installation. *
-# * If you don't need do not change it.                      *
-# *                                                          *
-# * UAM Text Tools                                           *
-# * Adam Mickiewicz University, Poland                       *
-# * http://utt.amu.edu.pl                                    *
-# ************************************************************
-#
-# All lines must looks like:
-# parameter_name [=] value
-#
-macros = PATH_PREFIX/lib/utt/terms.m4
-flex-template = PATH_PREFIX/lib/utt/ser.l.template
-tags=uam
Index: p/conf/utt.conf
===================================================================
--- app/conf/utt.conf	(revision a5fdde96132cd61c3f2e6d56c426c96b741427c8)
+++ 	(revision )
@@ -1,14 +1,0 @@
-# ************************************************************
-# * This file was created automatically during installation. *
-# * If you don't need do not change it.                      *
-# *                                                          *
-# * UAM Text Tools                                           *
-# * Adam Mickiewicz University, Poland                       *
-# * http://utt.amu.edu.pl                                    *
-# ************************************************************
-#
-# All lines must looks like:
-# parameter_name [=] value
-#
-# user locale (dictionary)
-language = pl_PL.ISO-8859-2
Index: p/dist/Makefile
===================================================================
--- app/dist/Makefile	(revision b2647ded51d1c3f8e4a856396ea16c7afd54b9e6)
+++ 	(revision )
@@ -1,46 +1,0 @@
-
-# some variables
-
-# path, where all nessesary files are placed 
-# (they will be processed for making distribution)
-export UTT_DIST_DIR=$(UTT_DIR)
-# path, where distribution package will be placed
-export UTT_DIST_OUTPUT=$(UTT_DIR)/..
-#temp path for making distribution
-export UTT_DIST_TMP=$(shell pwd)/dist_tmp
-
-
-# -----------------------------------------------------------
-# default task should display options
-.PHONY: default
-defaul:
-	@echo "Using: make tarball|rpm|deb"
-
-
-# -----------------------------------------------------------
-# this task should compile utt (if nesessery) and create tar.gz version
-.PHONY: tarball
-tarball:
-	cd tarball && make
-
-# -----------------------------------------------------------
-# this task should compile utt (if nesessery) and create rpm version
-.PHONY: rpm
-rpm:
-	@#we build rpm (see spec/README for details)
-	cd spec && make
-
-# -----------------------------------------------------------
-# this task should compile utt (if nesessery) and create deb version
-.PHONY: deb
-deb:
-	@#we build deb (see deb/README for details)
-	cd deb && make
-
-# -----------------------------------------------------------
-# this task should remove compiled files and directories
-.PHONY: clean
-clean:
-	# finally the line below should be uncomment
-	rm -fr ${UTT_DIST_TMP}
-
Index: p/dist/common/check_dependenties.pl
===================================================================
--- app/dist/common/check_dependenties.pl	(revision 317d53bd6b4ec4df8111471dcbae7ed20b5a461a)
+++ 	(revision )
@@ -1,15 +1,0 @@
-
-while(<STDIN>) {
-	chomp;
-	$app = $_;
-	$path = `which $app 2>/dev/null`;
-	$err = $?;
-	print $app.": ";
-	if($err != 0) {
-		print "failed ($err)\n";
-	}
-	else {
-		print $path;
-	}
-}
-
Index: p/dist/common/description.def
===================================================================
--- app/dist/common/description.def	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,1 +1,0 @@
-I put here some description.
Index: p/dist/common/description.pl.def
===================================================================
--- app/dist/common/description.pl.def	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,1 +1,0 @@
-Tu umieszczÄ opis po polsku.
Index: p/dist/common/find_perl_deps.pl
===================================================================
--- app/dist/common/find_perl_deps.pl	(revision 317d53bd6b4ec4df8111471dcbae7ed20b5a461a)
+++ 	(revision )
@@ -1,29 +1,0 @@
-
-
-while(<STDIN>) {
-	chomp;
-    # najpierw nazwa pliku zrodlowego out
-    if($_ =~ /^[^:]*\:\s*(.*)$/) {
-	my $line = $1;
-#	print "TEXT: $line\n";
-	# teraz tylko samo polecenie
-	if($line =~ /\`\s*(.+)\s*\`/) {
-	    my $cmd = $1;
-#	    print "CMD: $cmd\n";
-	    # teraz splitujemy potoki
-	    my @progs = split(/\s*\|\s*/, $cmd);
-	    foreach (@progs) {
-#		print "$_\n";
-		# ucinamy agrumenty programu
-		# oraz linie, zawierajace nie-programy (--replace, $tmpfile_x, /g, \\, itp.)
-		if($_ =~ /^([^\$\\\/\s\']+)(\s.*)?$/) {
-		    my $app = $1;
-#		    print "APP: $app\n";
-#		    my $res = `which $app`;
-#		    print "WYNIK: $res\n";
-		    print "$app\n";
-		}
-	    } # foreach
-	}
-    }
-}
Index: p/dist/common/find_rpm_deps.sh
===================================================================
--- app/dist/common/find_rpm_deps.sh	(revision 317d53bd6b4ec4df8111471dcbae7ed20b5a461a)
+++ 	(revision )
@@ -1,16 +1,0 @@
-#!/bin/sh
-
-# sprawdzamy czy podano argument
-if test $# -lt 1; then echo RPM file name expected!; exit -1; fi
-
-# sprawdzamy czy to plik, potem, czy rpm
-if test -f $1; \
-then 
-    if test "rpm" = `ls $1 | tail -c 4`; \
-    then
-        rpm -q -R -p $1; \
-    else echo "It's not a RPM file!"; \
-    fi
-else echo RPM file not found!; \
-fi
-
Index: p/dist/common/make_deps.sh
===================================================================
--- app/dist/common/make_deps.sh	(revision 317d53bd6b4ec4df8111471dcbae7ed20b5a461a)
+++ 	(revision )
@@ -1,3 +1,0 @@
-#!/bin/sh
-
-grep -r -e "\`" ../../src | grep -v -e "\.svn\/" | perl find_perl_deps.pl | sort | uniq > dep_list.txt
Index: p/dist/common/prepare_conf.sh
===================================================================
--- app/dist/common/prepare_conf.sh	(revision 9b57c4d68c64c1eecf74b8d771c0471c586fa063)
+++ 	(revision )
@@ -1,14 +1,0 @@
-#!/bin/sh
-
-if test 3 -ne $#
-then
-	echo "Usage: " `basename $0` src_conf_dir dest_conf_dir replacement
-else
-	POLEC="s/PATH_PREFIX/$3/g"
-
-	for FN in `ls $1/*.conf`
-	do
-	    BN=`basename ${FN}`
-	    sed ${POLEC} ${FN} > $2/${BN}
-	done
-fi
Index: p/dist/common/release.def
===================================================================
--- app/dist/common/release.def	(revision 0214596e4d70b25df913a24f19d50cb0f1b4a69f)
+++ 	(revision )
@@ -1,1 +1,0 @@
-2
Index: p/dist/common/version.def
===================================================================
--- app/dist/common/version.def	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,1 +1,0 @@
-0.9
Index: p/dist/deb/Makefile
===================================================================
--- app/dist/deb/Makefile	(revision d593c5e768abb663835cfc216a133cf5ce86c8c6)
+++ 	(revision )
@@ -1,86 +1,0 @@
-#default task
-
-DIR=$(shell pwd)
-
-ifndef UTT_DIST_DIR
-	UTT_DIST_DIR=${DIR}
-endif
-
-ifndef UTT_DIST_OUTPUT
-	UTT_DIST_OUTPUT=${DIR}
-endif
-
-# here there're few properties
-_PRODUCT_NAME=utt
-_UTT_VER=$(shell cat ../common/version.def)
-_UTT_REL=$(shell cat ../common/release.def)
-_DEB_FROOT=$(DIR)/deb_root
-_UTT_DIR=${_DEB_FROOT}/usr/local/$(_PRODUCT_NAME).$(_UTT_VER)-$(_UTT_REL)
-
-.PHONY: default
-default: make_control make_postinst make_prerm
-	# first, we prepare some directory structure
-	mkdir -p $(_DEB_FROOT)/DEBIAN
-	mkdir -p $(_UTT_DIR)
-
-	# next, we copy deb package files
-	mv ./control $(_DEB_FROOT)/DEBIAN/
-	mv ./postinst $(_DEB_FROOT)/DEBIAN/
-	mv ./prerm $(_DEB_FROOT)/DEBIAN/
-	cd ${_DEB_FROOT} && tar -cvvf control.tar.gz DEBIAN/
-	cd ${DIR};
-	rm -fr ${_DEB_FROOT}/DEBIAN/
-
-	# we copy all necessery files (binaries)
-	cp -r ${UTT_DIST_DIR}/* ${_UTT_DIR}/
-	cp ./changelog ${_UTT_DIR}/share/doc/$(_PRODUCT_NAME)/
-#	gzip --best $(_DEB_ROOT)/usr/share/doc/$(_PRODUCT_NAME)/changelog
-	cp ./changelog.Debian $(_UTT_DIR)/share/doc/$(_PRODUCT_NAME)/
-#	gzip --best $(_DEB_ROOT)/usr/share/doc/$(_PRODUCT_NAME)/changelog.Debian
-	cp ../files/* ${_UTT_DIR}/share/doc/${_PRODUCT_NAME}/
-	cp ../common/utt_make_config.pl ${_UTT_DIR}/bin/
-	chmod 755 ${_UTT_DIR}/bin/utt_make_config.pl
-	
-
-
-#	# next we make man/doc archives
-#	gzip --best $(_DEB_ROOT)/usr/share/man/man1/$(_PRODUCT_NAME).1
-
-	find $(_DEB_FROOT) -type d | xargs chmod 755   # this is necessary on Debian Woody, don't ask me why
-
-	# finally, we buid deb package
-	fakeroot dpkg-deb --build $(_DEB_FROOT)
-	mv $(_DEB_FROOT).deb $(_PRODUCT_NAME)_$(_UTT_VER)-$(_UTT_REL).all.deb
-	rm -rf ${_DEB_FROOT}
-	
-
-
-.PHONY: make_control
-make_control:
-	echo "Package: $(_PRODUCT_NAME)" > control
-	echo "Version: $(_UTT_VER)" >> control
-	echo "Section: web" >> control
-	echo "Priority: optional" >> control
-	echo "Architecture: all" >> control
-	echo "Essential: no" >> control
-
-	echo "Depends: " >> control
-# here we read this information from file ../common/requirements.def
-	#libwww-perl, acme-base (>= 1.2)         <= wymagania pakietowe
-
-	echo "Pre-Depends: perl" >> control
-
-	echo "Maintainer: Adam Mickiewicz University" >> control
-	echo "Provides: $(_PRODUCT_NAME)" >> control
-	echo -n "Description: " >> control
-	cat ../common/description.def >> control
-
-.PHONY: make_postinst
-make_postinst:
-	echo "#!/bin/sh" > postinst
-	echo "$(_INSTALL_DIR)/create_utt_config.pl" >> postinst
-	echo "rm -f $(_INSTALL_DIR)/create_utt_config.pl" >> postinst
-
-.PHONY: make_prerm
-make_prerm:
-	echo "#!/bin/sh" > prerm
Index: p/dist/deb/README
===================================================================
--- app/dist/deb/README	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,3 +1,0 @@
-This directory contains files necessery to create deb package.
-
-apt-get install dpkg-dev debhelper devscripts fakeroot linda
Index: p/dist/files/COPYRIGHT
===================================================================
--- app/dist/files/COPYRIGHT	(revision a4d0da553f29bc0fd967ebb3e0e910e46b1f4439)
+++ 	(revision )
@@ -1,8 +1,0 @@
-Copyright (C)  2005 - 2008 Tomasz Obrebski, Michal Stolarski, Justyna Walkowska, Pawel Konieczka
-
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.2
-or any later version published by the Free Software Foundation;
-with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
-Texts. A copy of the license is included in the section entitled ââGNU
-Free Documentation Licenseââ.
Index: p/dist/files/LICENCE
===================================================================
--- app/dist/files/LICENCE	(revision a4d0da553f29bc0fd967ebb3e0e910e46b1f4439)
+++ 	(revision )
@@ -1,264 +1,0 @@
-GNU Free Documentation License
-Version 1.2, November 2002
-Copyright (c) 2000,2001,2002 Free Software Foundation, Inc.
-51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
-
-Everyone is permitted to copy and distribute verbatim copies
-of this license document, but changing it is not allowed.
-
- 0. PREAMBLE
- The purpose of this License is to make a manual, textbook, or other functional and
- useful document free in the sense of freedom: to assure everyone the effective freedom
- to copy and redistribute it, with or without modifying it, either commercially or noncommercially.
- Secondarily, this License preserves for the author and publisher a way
- to get credit for their work, while not being considered responsible for modifications
- made by others.
- This License is a kind of âcopyleftâ, which means that derivative works of the document
- must themselves be free in the same sense. It complements the GNU General Public
- License, which is a copyleft license designed for free software.
- We have designed this License in order to use it for manuals for free software, because
- free software needs free documentation: a free program should come with manuals
- providing the same freedoms that the software does. But this License is not limited to
- software manuals; it can be used for any textual work, regardless of subject matter or
- whether it is published as a printed book. We recommend this License principally for
- works whose purpose is instruction or reference.
- 1. APPLICABILITY AND DEFINITIONS
- This License applies to any manual or other work, in any medium, that contains a
- notice placed by the copyright holder saying it can be distributed under the terms
- of this License. Such a notice grants a world-wide, royalty-free license, unlimited in
- duration, to use that work under the conditions stated herein. The âDocumentâ,
- below, refers to any such manual or work. Any member of the public is a licensee, and
- is addressed as âyouâ. You accept the license if you copy, modify or distribute the work
- in a way requiring permission under copyright law.
- A âModified Versionâ of the Document means any work containing the Document or
- a portion of it, either copied verbatim, or with modifications and/or translated into
- another language.
- A âSecondary Sectionâ is a named appendix or a front-matter section of the Document
- that deals exclusively with the relationship of the publishers or authors of the Document
- to the Documentâs overall subject (or to related matters) and contains nothing that
- could fall directly within that overall subject. (Thus, if the Document is in part a
- textbook of mathematics, a Secondary Section may not explain any mathematics.) The
- relationship could be a matter of historical connection with the subject or with related
- matters, or of legal, commercial, philosophical, ethical or political position regarding
- them.
- The âInvariant Sectionsâ are certain Secondary Sections whose titles are designated, as
- being those of Invariant Sections, in the notice that says that the Document is released
- under this License. If a section does not fit the above definition of Secondary then it is
- not allowed to be designated as Invariant. The Document may contain zero Invariant
- Sections. If the Document does not identify any Invariant Sections then there are none.
- The âCover Textsâ are certain short passages of text that are listed, as Front-Cover
- Texts or Back-Cover Texts, in the notice that says that the Document is released under
- this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may
- be at most 25 words.
- A âTransparentâ copy of the Document means a machine-readable copy, represented
- in a format whose specification is available to the general public, that is suitable for
- revising the document straightforwardly with generic text editors or (for images composed
- of pixels) generic paint programs or (for drawings) some widely available drawing
- editor, and that is suitable for input to text formatters or for automatic translation to
- a variety of formats suitable for input to text formatters. A copy made in an otherwise
- Transparent file format whose markup, or absence of markup, has been arranged to
- thwart or discourage subsequent modification by readers is not Transparent. An image
- format is not Transparent if used for any substantial amount of text. A copy that is
- not âTransparentâ is called âOpaqueâ.
- Examples of suitable formats for Transparent copies include plain ascii without
- markup, Texinfo input format, LaTEX input format, SGML or XML using a publicly
- available DTD, and standard-conforming simple HTML, PostScript or PDF designed
- for human modification. Examples of transparent image formats include PNG, XCF
- and JPG. Opaque formats include proprietary formats that can be read and edited
- only by proprietary word processors, SGML or XML for which the DTD and/or
- processing tools are not generally available, and the machine-generated HTML,
- PostScript or PDF produced by some word processors for output purposes only.
- The âTitle Pageâ means, for a printed book, the title page itself, plus such following
- pages as are needed to hold, legibly, the material this License requires to appear in the
- title page. For works in formats which do not have any title page as such, âTitle Pageâ
- means the text near the most prominent appearance of the workâs title, preceding the
- beginning of the body of the text.
- A section âEntitled XYZâ means a named subunit of the Document whose title either
- is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in
- another language. (Here XYZ stands for a specific section name mentioned below, such
- as âAcknowledgementsâ, âDedicationsâ, âEndorsementsâ, or âHistoryâ.) To âPreserve
- the Titleâ of such a section when you modify the Document means that it remains a
- section âEntitled XYZâ according to this definition.
- The Document may include Warranty Disclaimers next to the notice which states that
- this License applies to the Document. These Warranty Disclaimers are considered to
- be included by reference in this License, but only as regards disclaiming warranties:
- any other implication that these Warranty Disclaimers may have is void and has no
- effect on the meaning of this License.
- 2. VERBATIM COPYING
- You may copy and distribute the Document in any medium, either commercially or
- noncommercially, provided that this License, the copyright notices, and the license
- notice saying this License applies to the Document are reproduced in all copies, and
- that you add no other conditions whatsoever to those of this License. You may not use
- technical measures to obstruct or control the reading or further copying of the copies
- you make or distribute. However, you may accept compensation in exchange for copies.
- If you distribute a large enough number of copies you must also follow the conditions
- in section 3.
- You may also lend copies, under the same conditions stated above, and you may publicly
- display copies.
- 3. COPYING IN QUANTITY
- If you publish printed copies (or copies in media that commonly have printed covers) of
- the Document, numbering more than 100, and the Documentâs license notice requires
- Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all
- these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
- the back cover. Both covers must also clearly and legibly identify you as the publisher
- of these copies. The front cover must present the full title with all words of the title
- equally prominent and visible. You may add other material on the covers in addition.
- Copying with changes limited to the covers, as long as they preserve the title of the
- Document and satisfy these conditions, can be treated as verbatim copying in other
- respects.
- If the required texts for either cover are too voluminous to fit legibly, you should put
- the first ones listed (as many as fit reasonably) on the actual cover, and continue the
- rest onto adjacent pages.
- If you publish or distribute Opaque copies of the Document numbering more than 100,
- you must either include a machine-readable Transparent copy along with each Opaque
- copy, or state in or with each Opaque copy a computer-network location from which
- the general network-using public has access to download using public-standard network
- protocols a complete Transparent copy of the Document, free of added material. If
- you use the latter option, you must take reasonably prudent steps, when you begin
- distribution of Opaque copies in quantity, to ensure that this Transparent copy will
- remain thus accessible at the stated location until at least one year after the last time
- you distribute an Opaque copy (directly or through your agents or retailers) of that
- edition to the public.
- It is requested, but not required, that you contact the authors of the Document well
- before redistributing any large number of copies, to give them a chance to provide you
- with an updated version of the Document.
- 4. MODIFICATIONS
- You may copy and distribute a Modified Version of the Document under the conditions
- of sections 2 and 3 above, provided that you release the Modified Version under precisely
- this License, with the Modified Version filling the role of the Document, thus licensing
- distribution and modification of the Modified Version to whoever possesses a copy of
- it. In addition, you must do these things in the Modified Version:
- A. Use in the Title Page (and on the covers, if any) a title distinct from that of the
- Document, and from those of previous versions (which should, if there were any,
- be listed in the History section of the Document). You may use the same title as
- a previous version if the original publisher of that version gives permission.
- B. List on the Title Page, as authors, one or more persons or entities responsible for
- authorship of the modifications in the Modified Version, together with at least five
- of the principal authors of the Document (all of its principal authors, if it has fewer
- than five), unless they release you from this requirement.
- C. State on the Title page the name of the publisher of the Modified Version, as the
- publisher.
- D. Preserve all the copyright notices of the Document.
- E. Add an appropriate copyright notice for your modifications adjacent to the other
- copyright notices.
- F. Include, immediately after the copyright notices, a license notice giving the public
- permission to use the Modified Version under the terms of this License, in the form
- shown in the Addendum below.
- G. Preserve in that license notice the full lists of Invariant Sections and required Cover
- Texts given in the Documentâs license notice.
- H. Include an unaltered copy of this License.
- I. Preserve the section Entitled âHistoryâ, Preserve its Title, and add to it an item
- stating at least the title, year, new authors, and publisher of the Modified Version
- as given on the Title Page. If there is no section Entitled âHistoryâ in the Document,
- create one stating the title, year, authors, and publisher of the Document
- as given on its Title Page, then add an item describing the Modified Version as
- stated in the previous sentence.
- J. Preserve the network location, if any, given in the Document for public access to
- a Transparent copy of the Document, and likewise the network locations given in
- the Document for previous versions it was based on. These may be placed in the
- âHistoryâ section. You may omit a network location for a work that was published
- at least four years before the Document itself, or if the original publisher of the
- version it refers to gives permission.
- K. For any section Entitled âAcknowledgementsâ or âDedicationsâ, Preserve the Title
- of the section, and preserve in the section all the substance and tone of each of the
- contributor acknowledgements and/or dedications given therein.
- L. Preserve all the Invariant Sections of the Document, unaltered in their text and
- in their titles. Section numbers or the equivalent are not considered part of the
- section titles.
- M. Delete any section Entitled âEndorsementsâ. Such a section may not be included
- in the Modified Version.
- N. Do not retitle any existing section to be Entitled âEndorsementsâ or to conflict in
- title with any Invariant Section.
- O. Preserve any Warranty Disclaimers.
- If the Modified Version includes new front-matter sections or appendices that qualify
- as Secondary Sections and contain no material copied from the Document, you may at
- your option designate some or all of these sections as invariant. To do this, add their
- titles to the list of Invariant Sections in the Modified Versionâs license notice. These
- titles must be distinct from any other section titles.
- You may add a section Entitled âEndorsementsâ, provided it contains nothing but
- endorsements of your Modified Version by various partiesâfor example, statements of
- peer review or that the text has been approved by an organization as the authoritative
- definition of a standard.
- You may add a passage of up to five words as a Front-Cover Text, and a passage of up
- to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified
- Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be
- added by (or through arrangements made by) any one entity. If the Document already
- includes a cover text for the same cover, previously added by you or by arrangement
- made by the same entity you are acting on behalf of, you may not add another; but
- you may replace the old one, on explicit permission from the previous publisher that
- added the old one.
- The author(s) and publisher(s) of the Document do not by this License give permission
- to use their names for publicity for or to assert or imply endorsement of any Modified
- Version.
- 5. COMBINING DOCUMENTS
- You may combine the Document with other documents released under this License,
- under the terms defined in section 4 above for modified versions, provided that you
- include in the combination all of the Invariant Sections of all of the original documents,
- unmodified, and list them all as Invariant Sections of your combined work in its license
- notice, and that you preserve all their Warranty Disclaimers.
- The combined work need only contain one copy of this License, and multiple identical
- Invariant Sections may be replaced with a single copy. If there are multiple Invariant
- Sections with the same name but different contents, make the title of each such section
- unique by adding at the end of it, in parentheses, the name of the original author or
- publisher of that section if known, or else a unique number. Make the same adjustment
- to the section titles in the list of Invariant Sections in the license notice of the combined
- work.
- In the combination, you must combine any sections Entitled âHistoryâ in the various
- original documents, forming one section Entitled âHistoryâ; likewise combine any
- sections Entitled âAcknowledgementsâ, and any sections Entitled âDedicationsâ. You
- must delete all sections Entitled âEndorsements.â
- 6. COLLECTIONS OF DOCUMENTS
- You may make a collection consisting of the Document and other documents released
- under this License, and replace the individual copies of this License in the various
- documents with a single copy that is included in the collection, provided that you
- follow the rules of this License for verbatim copying of each of the documents in all
- other respects.
- You may extract a single document from such a collection, and distribute it individually
- under this License, provided you insert a copy of this License into the extracted
- document, and follow this License in all other respects regarding verbatim copying of
- that document.
- 7. AGGREGATION WITH INDEPENDENT WORKS
- A compilation of the Document or its derivatives with other separate and independent
- documents or works, in or on a volume of a storage or distribution medium, is called
- an âaggregateâ if the copyright resulting from the compilation is not used to limit the
- legal rights of the compilationâs users beyond what the individual works permit. When
- the Document is included in an aggregate, this License does not apply to the other
- works in the aggregate which are not themselves derivative works of the Document.
- If the Cover Text requirement of section 3 is applicable to these copies of the Document,
- then if the Document is less than one half of the entire aggregate, the Documentâs Cover
- Texts may be placed on covers that bracket the Document within the aggregate, or the
- electronic equivalent of covers if the Document is in electronic form. Otherwise they
- must appear on printed covers that bracket the whole aggregate.
- 8. TRANSLATION
- Translation is considered a kind of modification, so you may distribute translations
- of the Document under the terms of section 4. Replacing Invariant Sections with
- translations requires special permission from their copyright holders, but you may
- include translations of some or all Invariant Sections in addition to the original versions
- of these Invariant Sections. You may include a translation of this License, and all the
- license notices in the Document, and any Warranty Disclaimers, provided that you
- also include the original English version of this License and the original versions of
- those notices and disclaimers. In case of a disagreement between the translation and
- the original version of this License or a notice or disclaimer, the original version will
- prevail.
- If a section in the Document is Entitled âAcknowledgementsâ, âDedicationsâ, or âHistoryâ,
- the requirement (section 4) to Preserve its Title (section 1) will typically require
- changing the actual title.
- 9. TERMINATION
- You may not copy, modify, sublicense, or distribute the Document except as expressly
- provided for under this License. Any other attempt to copy, modify, sublicense or
- distribute the Document is void, and will automatically terminate your rights under
- this License. However, parties who have received copies, or rights, from you under this
- License will not have their licenses terminated so long as such parties remain in full
- compliance.
- 10. FUTURE REVISIONS OF THIS LICENSE
- The Free Software Foundation may publish new, revised versions of the GNU Free
- Documentation License from time to time. Such new versions will be similar in spirit
- to the present version, but may differ in detail to address new problems or concerns.
- See http://www.gnu.org/copyleft/.
- Each version of the License is given a distinguishing version number. If the Document
- specifies that a particular numbered version of this License âor any later versionâ
- applies to it, you have the option of following the terms and conditions either of that
- specified version or of any later version that has been published (not as a draft) by
- the Free Software Foundation. If the Document does not specify a version number of
- this License, you may choose any version ever published (not as a draft) by the Free
- Software Foundation.
Index: p/dist/files/README
===================================================================
--- app/dist/files/README	(revision e28a62525995e07b8d354225ae96189c5c02a06d)
+++ 	(revision )
@@ -1,51 +1,0 @@
-General information
-*********************
-
-UAM Text Tools (UTT) is a package of language processing tools
-developed at Adam Mickiewicz University. Its functionality includes:
-* tokenization
-* dictionary-based morphological analysis
-* heuristic morphological analysis of unknown words
-* spelling correction
-* pattern search
-* sentence splitting
-* generation of concordance tables
-                     
-The toolkit is destined for processing of raw (not annotated)
-unrestricted text for any conceivable purpose.
-                        
-
-Installation
-**************
-
-1) unpack the UTT tar archive
-2) in the same directory, unpack the tar archives of all UTT dictionary modules you have
-3) run
-	make install
-   in the root directory of the installation
-4) add the bin directory to the PATH variable
-
-
-Requirements
-*************
-
-* File::HomeDir
-
-  the Perl package File::HomeDir must be installed
-  (to install the package, run 'perl -MCPAN -e shell' and write
-   'install File::HomeDir' after the 'cpan>' prompt appears)
-   
-* flex
-
-  to run the ser component, flex must be installed in your system
-
-* ruby
-
-  to run the tre component, ruby must be installed in your system
-
-* locale pl_PL.iso-8852-2
-
-  the locales pl_PL.iso-8859-2 (pl_PL in short) must be installed
-  and set while using UTT with the Polish module. The text you 
-  process with UTT must be encoded in iso-8859-2.
-  
Index: p/dist/spec/Makefile
===================================================================
--- app/dist/spec/Makefile	(revision 9b57c4d68c64c1eecf74b8d771c0471c586fa063)
+++ 	(revision )
@@ -1,26 +1,0 @@
-# this makefile will build rpm
-
-DIR=$(shell pwd)
-
-ifndef UTT_DIST_DIR
-	UTT_DIST_DIR=${DIR}
-endif
-
-_RPM_FROOT=${DIR}/rmp_root
-_UTT_ROOT=${_RPM_FROOT}/usr/local
-# default task
-.PHONY: rpm
-rpm:
-	if test -d ${_RPM_FROOT}; then rm -fr ${_RMP_FROOT}; fi
-	mkdir -p ${_UTT_ROOT}
-	cp -rf ${UTT_DIST_DIR}/* ${_UTT_ROOT}/
-	mkdir -p ${_UTT_ROOT}/cnf
-	mv ${_UTT_ROOT}/etc/utt/*.conf ${_UTT_ROOT}/cnf/
-	${DIR}/../common/prepare_conf.sh ${_UTT_ROOT}/cnf ${_UTT_ROOT}/etc/utt \\\/usr\\\/local
-	rm -rf ${_UTT_ROOT}/cnf
-
-	cp ../files/* ${_UTT_ROOT}/
-	cd ${_RPM_FROOT}; rpmbuild -bb ${DIR}/utt.spec
-	
-	rm -rf ${_RPM_FROOT}
-	
Index: p/dist/spec/README
===================================================================
--- app/dist/spec/README	(revision 9b57c4d68c64c1eecf74b8d771c0471c586fa063)
+++ 	(revision )
@@ -1,16 +1,0 @@
-This directory contains files necessary to produce rpm package.
-
-First, you must have variable UTT_DIST_DIR defined properly.
-This variable should be defined by main Makefile.
-
-To create rpm file, just write:
-make
-
-The created package should appears in default RPM directory.
-(in my computer it is /usr/src/redhat/RPMS/$arch/ directory)
-
-To determine the rpm output directory, execute:
-rpm --showrc | grep _rmpdir
-
-You need access privilage to this directory to create rmp.
-
Index: p/dist/spec/utt.spec
===================================================================
--- app/dist/spec/utt.spec	(revision b2647ded51d1c3f8e4a856396ea16c7afd54b9e6)
+++ 	(revision )
@@ -1,81 +1,0 @@
-#
-# Default RPM header.
-#
-# START_RPM_STD_HEADER:
-
-
-#
-# RPM properties
-#
-%define _this_product     UAM Text Tools
-%define _this_summary	  Some tools for text processing
-%define _this_name        utt
-%define _this_version	  %(cat ../../common/version.def)
-%define _this_release	  %(cat ../../common/release.def)
-%define _this_copyright   Adam Mickiewicz University, Poland
-
-#
-# Default RPM header.
-#
-# END_RPM_STD_HEADER:
-# --------------------------------------------------------------------
-
-Summary:     %_this_summary
-Name:        %_this_name
-Version:     %_this_version
-Release:     %_this_release
-#Copyright:   %_this_copyright
-License:	GPL
-Group:       Development/Tools
-URL:         http://utt.amu.edu.pl
-Vendor:      Adam Mickiewicz University
-BuildRoot:	%(pwd)
-#BuildArch: 	 i586
-# requirements for utt application
-#AutoReq: no
-#AutoReqProv: no
-
-#Requires: 	 glibc >= 2.1.3
-#Requires: 	 libgcc1 >= 3.0
-#Requires: 	 libgcc >= 3.0
-#Requires:    libstdc++6 >= 3.4.1
-#Requires:    libstdc++ >= 3.4.1
-
-%description
-%(cat ../../common/description.def)
-
-%description -l pl
-%(cat ../../common/description.pl.def)
-
-
-# -------------------------------------------------------------
-# preparing sources for compilation
-%prep
-
-# source compilation
-%build
-
-# rpm building
-%install
-
-# cleaning after rpm build
-%clean
-
-# -------------------------------------------------------------
-#before installation
-%pre
-
-#after installation
-%post
-# we need to create utt.conf file
-
-#before uninstallation
-%preun
-
-#after uninstallation
-%postun
-
-# -------------------------------------------------------------
-%files
-%defattr(-,root,root)
-/*
Index: p/dist/struktura.txt
===================================================================
--- app/dist/struktura.txt	(revision adb4c8d65ba8b406a1703d1c091bcf1af4bdfb3c)
+++ 	(revision )
@@ -1,74 +1,0 @@
-/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/gph
-/usr/local/bin/grp
-/usr/local/bin/gue
-/usr/local/bin/kot
-/usr/local/bin/lem
-/usr/local/bin/mar
-/usr/local/bin/sen
-/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/ipi.tag2re
-/usr/local/bin/uam.tag2re
-
-
-# R.D. sugeruje /etc/utt
-# lokalnie: ~/.utt lub (trendy) ~/.config/utt
-/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
-/usr/local/etc/utt/kor.conf
-/usr/local/etc/utt/kot.conf
-/usr/local/etc/utt/lem.conf
-/usr/local/etc/utt/mar.conf
-/usr/local/etc/utt/sen.conf
-/usr/local/etc/utt/ser.conf
-/usr/local/etc/utt/tok.conf
-/usr/local/etc/utt/unfla.conf
-/usr/local/etc/utt/utt.conf
-
-/usr/local/share/utt/weights.kor
-/usr/local/share/utt/cats.dgc
-/usr/local/share/utt/gram.dgc
-# lokalnie: wszystkie pliki beda umieszczone w ~/.local/share/utt/
-
-/usr/local/share/utt/pl_PL.ISO-8859-2/pl_PL.ISO-8859-2.sym
-/usr/local/share/utt/pl_PL.ISO-8859-2/cor.bin
-/usr/local/share/utt/pl_PL.ISO-8859-2/gue.bin
-/usr/local/share/utt/pl_PL.ISO-8859-2/lem.bin
-/usr/local/share/utt/pl_PL.UTF-8/pl_PL.UTF-8.sym
-/usr/local/share/utt/pl_PL.UTF-8/cor.bin
-/usr/local/share/utt/pl_PL.UTF-8/gue.bin
-/usr/local/share/utt/pl_PL.UTF-8/lem.bin
-# lokalnie: wszystkie slowniki beda umieszczone w ~/.local/share/utt/
-
-/usr/local/lib/utt/ser.l.template
-/usr/local/lib/utt/terms.m4
-/usr/local/lib/utt/seg.rb
-/usr/local/lib/attr.pm
-# lokalnie: wszystkie pliki beda umieszczone w ~/.local/lib/utt/
-
-/usr/local/share/doc/utt/FAQ
-/usr/local/share/doc/utt/COPYRIGHT
-/usr/local/share/doc/utt/NEWS
-/usr/local/share/doc/utt/README
-/usr/local/share/info/utt.info.gz
-/usr/local/share/man/man3/utt.gz
-
-~/.utt/*.conf  (wszystko z /usr/local/etc/utt)
Index: p/dist/tarball/INSTALL
===================================================================
--- app/dist/tarball/INSTALL	(revision 9b57c4d68c64c1eecf74b8d771c0471c586fa063)
+++ 	(revision )
@@ -1,5 +1,0 @@
-Here you can find some information about how to install utt.
-
-You should just unpack archive and then execute
-make test
-make install
Index: p/dist/tarball/Makefile
===================================================================
--- app/dist/tarball/Makefile	(revision 9b57c4d68c64c1eecf74b8d771c0471c586fa063)
+++ 	(revision )
@@ -1,48 +1,0 @@
-# This makefile allows build tarball distribution for utt.
-
-#
-# Some variables
-#
-
-DIR=$(shell pwd)
-
-# Directory with utt binaries
-ifndef UTT_DIST_DIR
-	UTT_DIST_DIR=${DIR}
-endif
-
-# Where put result
-ifndef UTT_DIST_OUTPUT
-	UTT_DIST_OUTPUT=${DIR}
-endif
-
-# Common info about version and release
-_UTT_VER=$(shell cat ../common/version.def)
-_UTT_REL=$(shell cat ../common/release.def)
-
-# Temp vars
-_TARBALL_ROOT=$(DIR)/utt-$(_UTT_VER).$(_UTT_REL)
-_TAR_FILE_NAME=utt.$(_UTT_VER)_$(_UTT_REL).tar.gz
-
-#defualt task
-.PHONY: default
-default:
-	@echo Build directory: ${UTT_DIST_DIR}
-	@echo Output directory for tarball: ${UTT_DIST_OUTPUT}
-	mkdir -p ${_TARBALL_ROOT}
-	cp -fr ${UTT_DIST_DIR}/* ${_TARBALL_ROOT}
-	@# we add some extra files
-	@# config files
-	mkdir -p ${_TARBALL_ROOT}/cnf
-	mv ${_TARBALL_ROOT}/etc/utt/*.conf ${_TARBALL_ROOT}/cnf/
-	${DIR}/../common/prepare_conf.sh ${_TARBALL_ROOT}/cnf ${_TARBALL_ROOT}/etc/utt \~\\\/.local
-	rm -rf ${_TARBALL_ROOT}/cnf
-	cp ./INSTALL ${_TARBALL_ROOT}/
-	cp ./Makefile.tarball ${_TARBALL_ROOT}/Makefile
-	cp ../files/* ${_TARBALL_ROOT}/
-
-
-	tar -czf ${UTT_DIST_OUTPUT}/${_TAR_FILE_NAME} utt*
-
-	rm -rf ${_TARBALL_ROOT}
-
Index: p/dist/tarball/Makefile.tarball
===================================================================
--- app/dist/tarball/Makefile.tarball	(revision d33e555ed7200c1e9897443874c3b89bbeef42bb)
+++ 	(revision )
@@ -1,18 +1,0 @@
-UTT_LIB_DIR=${HOME}/.local/lib/utt
-UTT_SHARE_DIR=${HOME}/.local/share/utt
-UTT_CONF_DIR=${HOME}/.utt
-
-.PHONY: install
-install:
-	mkdir -p ${UTT_LIB_DIR}
-	cp -r lib/utt/* ${UTT_LIB_DIR}
-	mkdir -p ${UTT_SHARE_DIR}
-	cp -r share/utt/* ${UTT_SHARE_DIR}
-	mkdir -p ${UTT_CONF_DIR}
-	cp -r etc/utt/* ${UTT_CONF_DIR}
-
-.PHONY: uninstall
-uninstall:
-	rm -r ${UTT_LIB_DIR}
-	rm -r ${UTT_SHARE_DIR}
-	rm -r ${CONF_DIR}
Index: p/dist/tarball/README
===================================================================
--- app/dist/tarball/README	(revision 20b4e44e7537762f6aceb72b039f6e8f8a50e201)
+++ 	(revision )
@@ -1,6 +1,0 @@
-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.
Index: p/lib/attr.pm
===================================================================
--- app/lib/attr.pm	(revision 6b3be72395bfc594673b8184d6a7624e3800b47d)
+++ 	(revision )
@@ -1,133 +1,0 @@
-package attr;
-
-use locale;
-use strict;
-
-use Data::Dumper;
-
-our $pos_re    = qr/(?:[[:upper:]]+)/;
-our $attr_re   = qr/(?:[[:upper:]]+)/;
-our $val_re    = qr/(?:[[:lower:][:digit:]+?!*-]|<[^>\n]+>)/;
-our $av_re     = qr/(?:$attr_re$val_re+)/;
-our $avlist_re = qr/(?:$av_re+)/;
-our $cat_re    = qr/(?:$pos_re(?:\/$avlist_re)?)/;
-
-sub match(\@\@)
-{
-    my ($cat1,$avs1)= @{shift @_};
-    my ($cat2,$avs2)= @{shift @_};
-
-    if($cat1 ne $cat2 && $cat1 ne '*' && $cat2 ne '*')
-    {
-	return 0; 
-    }
-    else
-    {
-      ATTR:for my $attr (keys %$avs1)
-      {
-	  if(exists $avs2->{$attr})
-	  {
-	      for my $val (keys %{$avs1->{$attr}})
-	      {
-		  next ATTR if $avs2->{$attr}->{$val};
-	      }
-	      return 0;
-	      last ATTR;
-	  }
-      }
-    }
-
-    return 1;
-}
-
-sub agree(\@\@$)
-{
-    my $val1 = $_[0]->[1]->{$_[2]};
-    my $val2 = $_[1]->[1]->{$_[2]};
-
-    return 1 if !$val1 || !$val2;
-
-    for my $v (keys %$val1)
-    {
-	return 1 if exists $val2->{$v};
-    }
-    return 0;
-}
-
-# funkcja parse
-# arg:     deskrypcja
-# warto¶æ: referencja do tablicy [<cat>, <avs>],
-#          gdzie <avs> jest referencja do hasza, zawierajacego pary
-#          atrybut=>hasz warto¶ci (pary warto¶æ=>1), czyli np.
-
-#         [
-#           'ADJ',
-#           {
-#             'KOLEDZY' => {
-#                            '<alojzy>' => 1,
-#                            '<karol>' => 1,
-#                            '<jan>' => 1
-#                          },
-#             'C' => {
-#                      'p' => 1,
-#                      'a' => 1,
-#                      'i' => 1
-#                    },
-#             'N' => {
-#                      'p' => 1
-#                    }
-#           }
-#         ];
-
-sub parse ($)
-{
-    my ($dstr)=@_;
-    my $avs={};
-    my ($cat,$attrlist) = split '/', $dstr;
-  ATTR:
-#    while( $attrlist =~ /([[:upper:]]+)((?:[[:lower:][:digit:]+?!*-]|<[^>\n]+>)+)/g )
-    while( $attrlist =~ /($attr_re)($val_re+)/g )
-    {
-	my ($attrstr,$valstr)=($1,$2);
-	my %vals;
-	while($valstr =~ /$val_re/g)
-	{
-	    my $val = $&;
-	    next ATTR if $val eq '*';
-	    $val =~ s/^<([[:lower:]])>$/$1/;
-	    $vals{$val}=1;
-	}
-	
-	$avs->{$attrstr} = \%vals; # dlaczego to dziala? %vals jest lokalne
-    }
-    [$cat, $avs];
-}
-
-# funkcja unparse
-# arg:     jak warto¶æ parse
-# warto¶æ: deskrypcja - napis
-
-sub unparse (\@)
-{
-    my ($cat,$avs)= @{shift @_};
-    my $dstr=$cat;
-    my @attrs = keys %$avs;
-    if(@attrs)
-    {
-	$dstr .= '/';
-	for my $attr ( sort @attrs )
-	{
-	    $dstr .= $attr . (join '', sort keys %{$avs->{$attr}});
-	}
-    }
-    $dstr;
-}
-
-
-sub canonize ($)
-{
-    unparse @{parse @_[0]} ;
-}
-
-
-1;
Index: p/lib/seg.rb
===================================================================
--- app/lib/seg.rb	(revision 6b3be72395bfc594673b8184d6a7624e3800b47d)
+++ 	(revision )
@@ -1,31 +1,0 @@
-
-class Seg
-  
-  def initialize(s="")
-    @line=s
-    self
-  end
-
-  def to_s
-    @line.chomp
-  end
-
-  def set(s)
-    @line=s
-    self
-  end
-
-  def field(key)
-    if key.class==Fixnum
-      @line.split[key-1]
-    elsif key.class==String
-      @line =~ /\s#{key}:(\S+)/; $1
-    end
-  end
-  alias [] field
-
-  def fields
-    @line.split
-  end
-
-end
Index: p/lib/ser.l.template
===================================================================
--- app/lib/ser.l.template	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,30 +1,0 @@
-%{
-		#include<string.h>
-		int n=0;
-%}
-
-%%
-
-PATTERN			{
-			  int start, end, len;
-			  char *lastseg, *tmp;
-			  if(yytext[yyleng-1]!='\n')
-			    {fprintf(stderr,"ser: pattern matches incomplete line\n"); exit(1);}
-			  n++;
-			  sscanf(yytext,"%d %d",&start,&len);
-			  yytext[yyleng-1]='\0';
-			  if(tmp=strrchr(yytext,'\n'))
-			  {
-			    lastseg=tmp+1;
-			    sscanf(lastseg,"%d %d", &end, &len);
-			  }
-			  else
-			    end=start;
-			  yytext[yyleng-1]='\n';
-			  printf("%04d 00 BOM * ser:%d\n",start,n);
-			  ECHO;
-			  printf("%04d 00 EOM * ser:%d\n",end+len,n);
-			}
-
-
-.*\n			DEFAULTACTION;
Index: p/lib/terms.m4
===================================================================
--- app/lib/terms.m4	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,52 +1,0 @@
-divert(-1)
-#--------------------------------------------------------------------------
-
-# Macros defined here may be used in pattern specifications 
-# You can modify this file according to your needs.
-
-# ENDOFSEGMENT and MORFIELD are macros expanded to, respectively,
-# end of segment marker (dependes on the format: flattened or not)
-# and the name of the annotation field containing morphological
-# information (standard value is 'lem'). These values are controlled
-# by programs using this file to expand search patterns (ser, grp, ...).
-
-# seg(type,form,annotation) 
-
-define(`seg',`(\s*((\d+\s+)(\d+\s+)?)?dnl
-ifelse($1, `',`(\S+)', `($1)')\s+dnl
-ifelse($2, `',`(\S+)', `($2)')dnl
-ifelse($3, `',`((\s+\S+)*)', `(\s+($3))')\s*ENDOFSEGMENT)')
-
-# form(f) - segment containing the form f 
-
-define(`form', `seg(,$1)')
-
-# field(f) segment containing auxiliary field f 
-
-define(`field', `seg(,,`(\S+\s+)*($1)(\s+\S+)*')')
-
-# word, space, punct, number segments (assuming W, S, P, N segment types)
-
-define(`space', `seg(`S',`$1')')
-define(`word',  `seg(`W',`$1')')
-define(`punct', `seg(`P',`$1')')
-define(`number', `seg(`N',`$1')')
-
-# macros specific to PMDB format 
-
-define(`lexeme', `field(`MORFIELD:(\S+;)?$1,\S+')')
-define(`cat', `field(`MORFIELD:\S+,$1([,;]\S+)?')')
-
-
-# Place here your macro definitions. 
-
-
-
-
-
-
-
-
-
-#--------------------------------------------------------------------------
-divert(0)
Index: p/share/cats.dgc
===================================================================
--- app/share/cats.dgc	(revision 6b3be72395bfc594673b8184d6a7624e3800b47d)
+++ 	(revision )
@@ -1,696 +1,0 @@
-ADJ/DcNpCaGp
-ADJ/DcNpCd
-ADJ/DcNpCgl
-ADJ/DcNpCi
-ADJ/DcNpCnavGaifn
-ADJ/DcNpCnvGp
-ADJ/DcNsCaGi
-ADJ/DcNsCaGpa
-ADJ/DcNsCaiGf
-ADJ/DcNsCavGf
-ADJ/DcNsCdGpain
-ADJ/DcNsCgdlGf
-ADJ/DcNsCgGpain
-ADJ/DcNsCilGpain
-ADJ/DcNsCnavGn
-ADJ/DcNsCnvGpai
-ADJ/DpNpCaGp
-ADJ/DpNpCd
-ADJ/DpNpCgl
-ADJ/DpNpCi
-ADJ/DpNpCnavGaifn
-ADJ/DpNpCnvGp
-ADJ/DpNsCaGi
-ADJ/DpNsCaGpa
-ADJ/DpNsCaiGf
-ADJ/DpNsCavGf
-ADJ/DpNsCdGpain
-ADJ/DpNsCgdlGf
-ADJ/DpNsCgGpain
-ADJ/DpNsCilGpain
-ADJ/DpNsCnavGn
-ADJ/DpNsCnvGpai
-ADJ/DsNpCaGp
-ADJ/DsNpCd
-ADJ/DsNpCgl
-ADJ/DsNpCi
-ADJ/DsNpCnavGaifn
-ADJ/DsNpCnvGp
-ADJ/DsNsCaGi
-ADJ/DsNsCaGpa
-ADJ/DsNsCaiGf
-ADJ/DsNsCavGf
-ADJ/DsNsCdGpain
-ADJ/DsNsCgdlGf
-ADJ/DsNsCgGpain
-ADJ/DsNsCilGpain
-ADJ/DsNsCnavGn
-ADJ/DsNsCnvGpai
-ADJNUM/NpCaGp
-ADJNUM/NpCd
-ADJNUM/NpCgl
-ADJNUM/NpCi
-ADJNUM/NpCnavGaifn
-ADJNUM/NpCnvGp
-ADJNUM/NsCaGi
-ADJNUM/NsCaGpa
-ADJNUM/NsCaiGf
-ADJNUM/NsCavGf
-ADJNUM/NsCdGpain
-ADJNUM/NsCgdlGf
-ADJNUM/NsCgGpain
-ADJNUM/NsCilGpain
-ADJNUM/NsCnavGn
-ADJNUM/NsCnvGpai
-ADJPAP/NpCaGp
-ADJPAP/NpCd
-ADJPAP/NpCgl
-ADJPAP/NpCi
-ADJPAP/NpCnavGaifn
-ADJPAP/NpCnvGp
-ADJPAP/NsCaGi
-ADJPAP/NsCaGpa
-ADJPAP/NsCaiGf
-ADJPAP/NsCavGf
-ADJPAP/NsCdGpain
-ADJPAP/NsCgdlGf
-ADJPAP/NsCgGpain
-ADJPAP/NsCilGpain
-ADJPAP/NsCnavGn
-ADJPAP/NsCnvGpai
-ADJPP/NpCaGp
-ADJPP/NpCd
-ADJPP/NpCgl
-ADJPP/NpCi
-ADJPP/NpCnavGaifn
-ADJPP/NpCnvGp
-ADJPP/NsCaGi
-ADJPP/NsCaGpa
-ADJPP/NsCaiGf
-ADJPP/NsCavGf
-ADJPP/NsCdGpain
-ADJPP/NsCgdlGf
-ADJPP/NsCgGpain
-ADJPP/NsCilGpain
-ADJPP/NsCnavGn
-ADJPP/NsCnvGpai
-ADJPRO/NpCaGp
-ADJPRO/NpCd
-ADJPRO/NpCgl
-ADJPRO/NpCi
-ADJPRO/NpCnavGaifn
-ADJPRO/NpCnvGp
-ADJPRO/NsCaGi
-ADJPRO/NsCaGpa
-ADJPRO/NsCaiGf
-ADJPRO/NsCavGf
-ADJPRO/NsCdGpain
-ADJPRO/NsCgdlGf
-ADJPRO/NsCgGpain
-ADJPRO/NsCilGpain
-ADJPRO/NsCnavGn
-ADJPRO/NsCnvGpai
-ADJPRO/ZdNpCaGp
-ADJPRO/ZdNpCd
-ADJPRO/ZdNpCgl
-ADJPRO/ZdNpCi
-ADJPRO/ZdNpCnavGaifn
-ADJPRO/ZdNpCnvGp
-ADJPRO/ZdNsCaGi
-ADJPRO/ZdNsCaGpa
-ADJPRO/ZdNsCaiGf
-ADJPRO/ZdNsCavGf
-ADJPRO/ZdNsCdGpain
-ADJPRO/ZdNsCgdlGf
-ADJPRO/ZdNsCgGpain
-ADJPRO/ZdNsCilGpain
-ADJPRO/ZdNsCnavGn
-ADJPRO/ZdNsCnvGpai
-ADJPRO/ZgNpCaGp
-ADJPRO/ZgNpCd
-ADJPRO/ZgNpCgl
-ADJPRO/ZgNpCi
-ADJPRO/ZgNpCnavGaifn
-ADJPRO/ZgNpCnvGp
-ADJPRO/ZgNsCaGi
-ADJPRO/ZgNsCaGpa
-ADJPRO/ZgNsCaiGf
-ADJPRO/ZgNsCavGf
-ADJPRO/ZgNsCdGpain
-ADJPRO/ZgNsCgdlGf
-ADJPRO/ZgNsCgGpain
-ADJPRO/ZgNsCilGpain
-ADJPRO/ZgNsCnavGn
-ADJPRO/ZgNsCnvGpai
-ADJPRO/ZiNpCaGp
-ADJPRO/ZiNpCd
-ADJPRO/ZiNpCgl
-ADJPRO/ZiNpCi
-ADJPRO/ZiNpCnavGaifn
-ADJPRO/ZiNpCnvGp
-ADJPRO/ZiNsCaGi
-ADJPRO/ZiNsCaGpa
-ADJPRO/ZiNsCaiGf
-ADJPRO/ZiNsCavGf
-ADJPRO/ZiNsCdGpain
-ADJPRO/ZiNsCgdlGf
-ADJPRO/ZiNsCgGpain
-ADJPRO/ZiNsCilGpain
-ADJPRO/ZiNsCnavGn
-ADJPRO/ZiNsCnvGpai
-ADJPRO/ZnNpCaGp
-ADJPRO/ZnNpCd
-ADJPRO/ZnNpCgl
-ADJPRO/ZnNpCi
-ADJPRO/ZnNpCnavGaifn
-ADJPRO/ZnNpCnvGp
-ADJPRO/ZnNsCaGi
-ADJPRO/ZnNsCaGpa
-ADJPRO/ZnNsCaiGf
-ADJPRO/ZnNsCavGf
-ADJPRO/ZnNsCdGpain
-ADJPRO/ZnNsCgdlGf
-ADJPRO/ZnNsCgGpain
-ADJPRO/ZnNsCilGpain
-ADJPRO/ZnNsCnavGn
-ADJPRO/ZnNsCnvGpai
-ADJPRO/ZqNpCaGp
-ADJPRO/ZqNpCd
-ADJPRO/ZqNpCgl
-ADJPRO/ZqNpCi
-ADJPRO/ZqNpCnavGaifn
-ADJPRO/ZqNpCnvGp
-ADJPRO/ZqNsCaGi
-ADJPRO/ZqNsCaGpa
-ADJPRO/ZqNsCaiGf
-ADJPRO/ZqNsCavGf
-ADJPRO/ZqNsCdGpain
-ADJPRO/ZqNsCgdlGf
-ADJPRO/ZqNsCgGpain
-ADJPRO/ZqNsCilGpain
-ADJPRO/ZqNsCnavGn
-ADJPRO/ZqNsCnvGpai
-ADJPRO/ZqrNpCaGp
-ADJPRO/ZqrNpCd
-ADJPRO/ZqrNpCgl
-ADJPRO/ZqrNpCi
-ADJPRO/ZqrNpCnavGaifn
-ADJPRO/ZqrNpCnvGp
-ADJPRO/ZqrNsCaGi
-ADJPRO/ZqrNsCaGpa
-ADJPRO/ZqrNsCaiGf
-ADJPRO/ZqrNsCavGf
-ADJPRO/ZqrNsCdGpain
-ADJPRO/ZqrNsCgdlGf
-ADJPRO/ZqrNsCgGpain
-ADJPRO/ZqrNsCilGpain
-ADJPRO/ZqrNsCnavGn
-ADJPRO/ZqrNsCnvGpai
-ADJPRO/ZsNpCaGp
-ADJPRO/ZsNpCd
-ADJPRO/ZsNpCgl
-ADJPRO/ZsNpCi
-ADJPRO/ZsNpCnavGaifn
-ADJPRO/ZsNpCnvGp
-ADJPRO/ZsNsCaGi
-ADJPRO/ZsNsCaGpa
-ADJPRO/ZsNsCaiGf
-ADJPRO/ZsNsCavGf
-ADJPRO/ZsNsCdGpain
-ADJPRO/ZsNsCgdlGf
-ADJPRO/ZsNsCgGpain
-ADJPRO/ZsNsCilGpain
-ADJPRO/ZsNsCnavGn
-ADJPRO/ZsNsCnvGpai
-ADJPRP/NpCaGp
-ADJPRP/NpCd
-ADJPRP/NpCgl
-ADJPRP/NpCi
-ADJPRP/NpCnavGaifn
-ADJPRP/NpCnvGp
-ADJPRP/NsCaGi
-ADJPRP/NsCaGpa
-ADJPRP/NsCaiGf
-ADJPRP/NsCavGf
-ADJPRP/NsCdGpain
-ADJPRP/NsCgdlGf
-ADJPRP/NsCgGpain
-ADJPRP/NsCilGpain
-ADJPRP/NsCnavGn
-ADJPRP/NsCnvGpai
-ADVANP
-ADV/Dc
-ADV/Dp
-ADV/Ds
-ADVNUM
-ADVPRO
-ADVPRO/Zd
-ADVPRO/Zi
-ADVPRO/Zn
-ADVPRO/Zq
-ADVPRO/Zqr
-ADVPRO/Zr
-ADVPRP
-APP
-BYC/Vb
-BYC/VpMcNpP1Gaifn
-BYC/VpMcNpP1Gp
-BYC/VpMcNpP2Gaifn
-BYC/VpMcNpP2Gp
-BYC/VpMcNpP3Gaifn
-BYC/VpMcNpP3Gp
-BYC/VpMcNsP1Gf
-BYC/VpMcNsP1Gpai
-BYC/VpMcNsP2Gf
-BYC/VpMcNsP2Gpai
-BYC/VpMcNsP3Gf
-BYC/VpMcNsP3Gn
-BYC/VpMcNsP3Gpai
-BYC/VpMdTaNpP1Gaifn
-BYC/VpMdTaNpP1Gp
-BYC/VpMdTaNpP2Gaifn
-BYC/VpMdTaNpP2Gp
-BYC/VpMdTaNpP3Gaifn
-BYC/VpMdTaNpP3Gp
-BYC/VpMdTaNsP1Gf
-BYC/VpMdTaNsP1Gpai
-BYC/VpMdTaNsP2Gf
-BYC/VpMdTaNsP2Gpai
-BYC/VpMdTaNsP3Gf
-BYC/VpMdTaNsP3Gn
-BYC/VpMdTaNsP3Gpai
-BYC/VpMdTrfNpP1
-BYC/VpMdTrfNpP2
-BYC/VpMdTrfNpP3
-BYC/VpMdTrfNsP1
-BYC/VpMdTrfNsP2
-BYC/VpMdTrfNsP3
-BYC/VpMiNpP1
-BYC/VpMiNpP2
-BYC/VpMiNsP2
-CONJ
-EXCL
-N/GaNpCa
-N/GaNpCd
-N/GaNpCg
-N/GaNpCi
-N/GaNpCl
-N/GaNpCn
-N/GaNpCv
-N/GaNsCa
-N/GaNsCd
-N/GaNsCg
-N/GaNsCi
-N/GaNsCl
-N/GaNsCn
-N/GaNsCv
-N/GfNpCa
-N/GfNpCd
-N/GfNpCg
-N/GfNpCi
-N/GfNpCl
-N/GfNpCn
-N/GfNpCv
-N/GfNsCa
-N/GfNsCd
-N/GfNsCg
-N/GfNsCi
-N/GfNsCl
-N/GfNsCn
-N/GfNsCv
-N/GiNpCa
-N/GiNpCd
-N/GiNpCg
-N/GiNpCi
-N/GiNpCl
-N/GiNpCn
-N/GiNpCv
-N/GiNsCa
-N/GiNsCd
-N/GiNsCg
-N/GiNsCi
-N/GiNsCl
-N/GiNsCn
-N/GiNsCv
-N/GnNpCa
-N/GnNpCd
-N/GnNpCg
-N/GnNpCi
-N/GnNpCl
-N/GnNpCn
-N/GnNpCv
-N/GnNsCa
-N/GnNsCd
-N/GnNsCg
-N/GnNsCi
-N/GnNsCl
-N/GnNsCn
-N/GnNsCv
-N/G?NpCa
-N/G*NpCa
-N/G?NpCd
-N/G*NpCd
-N/G?NpCg
-N/G*NpCg
-N/G?NpCi
-N/G*NpCi
-N/G?NpCl
-N/G*NpCl
-N/G?NpCn
-N/G*NpCn
-N/G?NpCv
-N/G*NpCv
-N/G?NsCa
-N/G?NsCd
-N/G?NsCg
-N/G?NsCi
-N/G?NsCl
-N/G?NsCn
-N/G?NsCv
-N/GpNpCa
-N/GpNpCd
-N/GpNpCg
-N/GpNpCi
-N/GpNpCl
-N/GpNpCn
-N/GpNpCv
-N/GpNsCa
-N/GpNsCd
-N/GpNsCg
-N/GpNsCi
-N/GpNsCl
-N/GpNsCn
-N/GpNsCv
-NPRO/ZdGnNsCa
-NPRO/ZdGnNsCd
-NPRO/ZdGnNsCg
-NPRO/ZdGnNsCi
-NPRO/ZdGnNsCl
-NPRO/ZdGnNsCn
-NPRO/ZgGnNsCa
-NPRO/ZgGnNsCd
-NPRO/ZgGnNsCg
-NPRO/ZgGnNsCi
-NPRO/ZgGnNsCl
-NPRO/ZgGnNsCn
-NPRO/ZgGpNpCa
-NPRO/ZgGpNpCd
-NPRO/ZgGpNpCg
-NPRO/ZgGpNpCi
-NPRO/ZgGpNpCl
-NPRO/ZgGpNpCn
-NPRO/ZiGnNsCa
-NPRO/ZiGnNsCd
-NPRO/ZiGnNsCg
-NPRO/ZiGnNsCi
-NPRO/ZiGnNsCl
-NPRO/ZiGnNsCn
-NPRO/ZiGpNsCa
-NPRO/ZiGpNsCd
-NPRO/ZiGpNsCg
-NPRO/ZiGpNsCi
-NPRO/ZiGpNsCl
-NPRO/ZiGpNsCn
-NPRO/ZnGnNsCa
-NPRO/ZnGnNsCd
-NPRO/ZnGnNsCg
-NPRO/ZnGnNsCi
-NPRO/ZnGnNsCl
-NPRO/ZnGnNsCn
-NPRO/ZnGpNsCa
-NPRO/ZnGpNsCd
-NPRO/ZnGpNsCg
-NPRO/ZnGpNsCi
-NPRO/ZnGpNsCl
-NPRO/ZnGpNsCn
-NPRO/ZpGaifnNpCa
-NPRO/ZpGaifnNpCd
-NPRO/ZpGaifnNpCg
-NPRO/ZpGaifnNpCi
-NPRO/ZpGaifnNpCl
-NPRO/ZpGaifnNpCn
-NPRO/ZpGfNsCa
-NPRO/ZpGfNsCd
-NPRO/ZpGfNsCg
-NPRO/ZpGfNsCi
-NPRO/ZpGfNsCl
-NPRO/ZpGfNsCn
-NPRO/ZpGnNsCa
-NPRO/ZpGnNsCd
-NPRO/ZpGnNsCg
-NPRO/ZpGnNsCi
-NPRO/ZpGnNsCl
-NPRO/ZpGnNsCn
-NPRO/ZpG*NpCa
-NPRO/ZpG*NpCd
-NPRO/ZpG*NpCg
-NPRO/ZpG*NpCi
-NPRO/ZpG*NpCl
-NPRO/ZpG*NpCn
-NPRO/ZpG*NsCa
-NPRO/ZpG*NsCd
-NPRO/ZpG*NsCg
-NPRO/ZpG*NsCi
-NPRO/ZpG*NsCl
-NPRO/ZpG*NsCn
-NPRO/ZpGpaiNsCa
-NPRO/ZpGpaiNsCd
-NPRO/ZpGpaiNsCg
-NPRO/ZpGpaiNsCi
-NPRO/ZpGpaiNsCl
-NPRO/ZpGpaiNsCn
-NPRO/ZpGpNpCa
-NPRO/ZpGpNpCd
-NPRO/ZpGpNpCg
-NPRO/ZpGpNpCi
-NPRO/ZpGpNpCl
-NPRO/ZpGpNpCn
-NPRO/ZqGnNsCa
-NPRO/ZqGnNsCd
-NPRO/ZqGnNsCg
-NPRO/ZqGnNsCi
-NPRO/ZqGnNsCl
-NPRO/ZqGnNsCn
-NPRO/ZqGpNsCa
-NPRO/ZqGpNsCd
-NPRO/ZqGpNsCg
-NPRO/ZqGpNsCi
-NPRO/ZqGpNsCl
-NPRO/ZqGpNsCn
-NPRO/ZqrGnNsCa
-NPRO/ZqrGnNsCd
-NPRO/ZqrGnNsCg
-NPRO/ZqrGnNsCi
-NPRO/ZqrGnNsCl
-NPRO/ZqrGnNsCn
-NPRO/ZqrGpNsCa
-NPRO/ZqrGpNsCd
-NPRO/ZqrGpNsCg
-NPRO/ZqrGpNsCi
-NPRO/ZqrGpNsCl
-NPRO/ZqrGpNsCn
-NPRO/ZxG*N*Ca
-NPRO/ZxG*N*Cd
-NPRO/ZxG*N*Cg
-NPRO/ZxG*N*Ci
-NPRO/ZxG*N*Cl
-NUMCOL/Ca
-NUMCOL/Cd
-NUMCOL/Cg
-NUMCOL/Ci
-NUMCOL/Cl
-NUMCOL/Cn
-NUMCRD/Ca
-NUMCRD/CaGaifn
-NUMCRD/CaGain
-NUMCRD/CaGf
-NUMCRD/CaGp
-NUMCRD/Cd
-NUMCRD/Cg
-NUMCRD/Ci
-NUMCRD/CiGf
-NUMCRD/CiGpain
-NUMCRD/Cl
-NUMCRD/Cn
-NUMCRD/CnGaifn
-NUMCRD/CnGain
-NUMCRD/CnGf
-NUMCRD/CnGp
-NUMCRD/ZiCaGaifn
-NUMCRD/ZiCaGain
-NUMCRD/ZiCaGf
-NUMCRD/ZiCaGp
-NUMCRD/ZiCd
-NUMCRD/ZiCg
-NUMCRD/ZiCi
-NUMCRD/ZiCiGf
-NUMCRD/ZiCiGpain
-NUMCRD/ZiCl
-NUMCRD/ZiCnGaifn
-NUMCRD/ZiCnGain
-NUMCRD/ZiCnGf
-NUMCRD/ZiCnGp
-NUMCRD/ZqiCaGaifn
-NUMCRD/ZqiCaGp
-NUMCRD/ZqiCd
-NUMCRD/ZqiCg
-NUMCRD/ZqiCi
-NUMCRD/ZqiCl
-NUMCRD/ZqiCnGaifn
-NUMCRD/ZqiCnGp
-NUMORD/NpCaGp
-NUMORD/NpCd
-NUMORD/NpCgl
-NUMORD/NpCi
-NUMORD/NpCnavGaifn
-NUMORD/NpCnvGp
-NUMORD/NsCaGi
-NUMORD/NsCaGpa
-NUMORD/NsCaiGf
-NUMORD/NsCavGf
-NUMORD/NsCdGpain
-NUMORD/NsCgdlGf
-NUMORD/NsCgGpain
-NUMORD/NsCilGpain
-NUMORD/NsCnavGn
-NUMORD/NsCnvGpai
-NUMPAR
-NUMPAR/Dc
-NUMPAR/Dp
-NUMPAR/Ds
-NUMPAR/Ns
-NUMPAR/NsGf
-NUMPAR/NsGpain
-NV/Ca
-NV/Cd
-NV/Cg
-NV/Ci
-NV/Cl
-NV/Cn
-ONO
-P
-PART
-P/Ca
-P/Cai
-P/Cal
-P/Cd
-P/Cg
-P/Cga
-P/Cgai
-P/Cgd
-P/Cgi
-P/Ci
-P/Cl
-PPRO/Zp
-V/AiVb
-V/AiViTa
-V/AiVpMcNpP1Gaifn
-V/AiVpMcNpP1Gp
-V/AiVpMcNpP2Gaifn
-V/AiVpMcNpP2Gp
-V/AiVpMcNpP3Gaifn
-V/AiVpMcNpP3Gp
-V/AiVpMcNsP1Gf
-V/AiVpMcNsP1Gpai
-V/AiVpMcNsP2Gf
-V/AiVpMcNsP2Gpai
-V/AiVpMcNsP3Gf
-V/AiVpMcNsP3Gn
-V/AiVpMcNsP3Gpai
-V/AiVpMdTaNpP1Gaifn
-V/AiVpMdTaNpP1Gp
-V/AiVpMdTaNpP2Gaifn
-V/AiVpMdTaNpP2Gp
-V/AiVpMdTaNpP3Gaifn
-V/AiVpMdTaNpP3Gp
-V/AiVpMdTaNsP1Gf
-V/AiVpMdTaNsP1Gpai
-V/AiVpMdTaNsP2Gf
-V/AiVpMdTaNsP2Gpai
-V/AiVpMdTaNsP3Gf
-V/AiVpMdTaNsP3Gn
-V/AiVpMdTaNsP3Gpai
-V/AiVpMdTrfNpP1
-V/AiVpMdTrfNpP2
-V/AiVpMdTrfNpP3
-V/AiVpMdTrfNsP1
-V/AiVpMdTrfNsP2
-V/AiVpMdTrfNsP3
-V/AiVpMiNpP1
-V/AiVpMiNpP2
-V/AiVpMiNsP2
-V/ApVb
-V/ApViTa
-V/ApVpMcNpP1Gaifn
-V/ApVpMcNpP1Gp
-V/ApVpMcNpP2Gaifn
-V/ApVpMcNpP2Gp
-V/ApVpMcNpP3Gaifn
-V/ApVpMcNpP3Gp
-V/ApVpMcNsP1Gf
-V/ApVpMcNsP1Gpai
-V/ApVpMcNsP2Gf
-V/ApVpMcNsP2Gpai
-V/ApVpMcNsP3Gf
-V/ApVpMcNsP3Gn
-V/ApVpMcNsP3Gpai
-V/ApVpMdTaNpP1Gaifn
-V/ApVpMdTaNpP1Gp
-V/ApVpMdTaNpP2Gaifn
-V/ApVpMdTaNpP2Gp
-V/ApVpMdTaNpP3Gaifn
-V/ApVpMdTaNpP3Gp
-V/ApVpMdTaNsP1Gf
-V/ApVpMdTaNsP1Gpai
-V/ApVpMdTaNsP2Gf
-V/ApVpMdTaNsP2Gpai
-V/ApVpMdTaNsP3Gf
-V/ApVpMdTaNsP3Gn
-V/ApVpMdTaNsP3Gpai
-V/ApVpMdTrfNpP1
-V/ApVpMdTrfNpP2
-V/ApVpMdTrfNpP3
-V/ApVpMdTrfNsP1
-V/ApVpMdTrfNsP2
-V/ApVpMdTrfNsP3
-V/ApVpMiNpP1
-V/ApVpMiNpP2
-V/ApVpMiNsP2
-V/GiVb
-V/GiViTa
-V/GiVpMcNpP1Gaifn
-V/GiVpMcNpP1Gp
-V/GiVpMcNpP2Gaifn
-V/GiVpMcNpP2Gp
-V/GiVpMcNpP3Gaifn
-V/GiVpMcNpP3Gp
-V/GiVpMcNsP1Gf
-V/GiVpMcNsP1Gpai
-V/GiVpMcNsP2Gf
-V/GiVpMcNsP2Gpai
-V/GiVpMcNsP3Gf
-V/GiVpMcNsP3Gn
-V/GiVpMcNsP3Gpai
-V/GiVpMdTaNpP1Gaifn
-V/GiVpMdTaNpP1Gp
-V/GiVpMdTaNpP2Gaifn
-V/GiVpMdTaNpP2Gp
-V/GiVpMdTaNpP3Gaifn
-V/GiVpMdTaNpP3Gp
-V/GiVpMdTaNsP1Gf
-V/GiVpMdTaNsP1Gpai
-V/GiVpMdTaNsP2Gf
-V/GiVpMdTaNsP2Gpai
-V/GiVpMdTaNsP3Gf
-V/GiVpMdTaNsP3Gn
-V/GiVpMdTaNsP3Gpai
-V/GiVpMdTrfNpP1
-V/GiVpMdTrfNpP2
-V/GiVpMdTrfNpP3
-V/GiVpMdTrfNsP1
-V/GiVpMdTrfNsP2
-V/GiVpMdTrfNsP3
-V/GiVpMiNpP1
-V/GiVpMiNpP2
-V/GiVpMiNsP2
-VNI
Index: p/share/gram.dgc
===================================================================
--- app/share/gram.dgc	(revision 91ed676c45e7d803877c8f87ab4592ebb9b31ee1)
+++ 	(revision )
@@ -1,126 +1,0 @@
-#FLAG REL
-
-#UP REL 
-
-#ORDER * pcmpl
-#ORDER ..
-#ORDER subj .. * ..  cmpl
-#ORDER refl .. *
-#ORDER * refl
-
-#CONSTR	cmpl_g	 => ~cmpl_a
-#CONSTR	cmpl_inf => ~(cmpl_g|cmpl_d|cmpl_a|cmpl_p|cmpl_ze|cmpl_s)
-#CONSTR subj_pred => subj
-#constr cmpl_pred => cmpl
-
-
-
-#subj
-ROLE subj         # deklaracja roli (typ zaleznosci) podmiot
-AGR subj N        # zgodnosc podrzednika z nadrzednikiem co do liczby
-AGR subj G        # zgodnosc podrzednika z nadrzednikiem co do rodzaju
-GOV subj */Cn     # wymaganie by podrzednik byl w mianowniku
-
-# pary kategorii, jakie mozna polaczyc zaleznoscia typu podmiot
-
-#	nadrzednik		podrzednik
-LINK	V/VpP3,BYC/VpP3		N,NPRO		subj
-
-# (przecinek znaczy lub)
-
-ROLE cmpl_ga	# dopelnienie w bierniku/dopelniaczu
-ROLE cmpl_d     #             w celowniku
-ROLE cmpl_i     #             w narzedniku
-ROLE cmpl_inf   #             w bezokoliczniku
-ROLE cmpl_s     #             bedace zdaniem
-ROLE cmpl_ze    #             bedace zdaniem poprzedzonym 'ze'
-ROLE aux        # 
-ROLE mod	# modyfikator (okolicznik/przydawka) (niewymagane okreÅlenie) (biaÅy kot)
-ROLE prep	# modyfikator w postaci frazy przyimkowej
-ROLE pcmpl	# dopeÅnienie przyimka (wymagany rzeczownik)
-ROLE ccmpl	# dopeÅnienie spÃ³jnika (wymagany drugi czÅon konstrukcji spÃ³jnikowej)
-ROLE poss	# np. ksiÄ
-ÅŒka Marii, ojciec kolegi
-ROLE restr	# (bardzo <- duÅŒy)
-ROLE part	# partykuÅa
-ROLE coord	# koordynacja (powiÄ
-zanie pierwszego czÅonu konstrukcji wspÃ³ÅrzÄdnej
-		# ze spÃ³jnikiem wspÃ³ÅrzÄdnym centralnym ( Oto [pies -> i] kot. )
- 
-
-AGR aux N
-AGR aux G
-
-AGR mod N
-AGR mod C
-AGR mod G
-
-AGR pcmpl C
-
-GOV	cmpl_ga	*/Cga
-GOV	cmpl_d	*/Cd
-GOV	cmpl_i	*/Ci
-GOV	poss	*/Cg
-
-SGL subj
-SGL cmpl_ga
-SGL cmpl_d
-SGL cmpl_i
-SGL cmpl_inf
-SGL aux
-SGL pcmpl
-SGL ccmpl
-SGL poss
-SGL restr
-
-REQ	P	pcmpl
-REQ	CONJ	ccmpl
-
-RIGHT pcmpl
-RIGHT ccmpl
-RIGHT cmpl_ze
-RIGHT poss
-
-
-#cmpl_*
-LINK	V,ADVPRP,ADVANP,ADJPRP,ADJPAP,NV	N,NPRO			cmpl_ga
-LINK	V,ADVPRP,ADVANP,ADJPRP,ADJPAP,NV	N,NPRO			cmpl_d
-LINK	V,ADVPRP,ADVANP,ADJPRP,ADJPAP,NV	N,NPRO			cmpl_i
-LINK	V,ADVPRP,ADVANP,ADJPRP,ADJPAP,NV	V/Vb			cmpl_inf
-LINK	V,ADVPRP,ADVANP,ADJPRP,ADJPAP,NV	CONJ			cmpl_ze
-
-#aux
-#czas przyszly analityczny
-LINK	BYC/VpMdTf				V/AiVpP3,V/AiVb		aux
-#czas zaprzeszly(?)
-LINK	BYC/VpMc				V/VpP3			aux
-#BYC jako lacznik w (jest bialy, jest zaszlachtowany, jest pilotem)
-LINK	BYC					ADJPAP/Cn,ADJ/Cn,N/Ci	aux
-
-#mod
-
-LINK	V	ADV,ADVPRP,ADVANP,ADVPRO	mod
-LINK	N,NV	ADJ,ADJPAP,ADJPRP,ADJPRO	mod
-
-
-#prep
-LINK	N,V	P	prep
-
-#pcmpl
-LINK	P	N,NV	pcmpl
-
-
-#poss
-LINK	N	N,NV,NPRO	poss
-
-
-#ccmpl
-LINK	CONJ	V/Vp	ccmpl
-
-
-#restr
-LINK	ADJ	ADV	restr
-
-
-#part
-LINK	V	PART	part
Index: p/share/weights.kor
===================================================================
--- app/share/weights.kor	(revision 6b3be72395bfc594673b8184d6a7624e3800b47d)
+++ 	(revision )
@@ -1,21 +1,0 @@
-%stdcor	1
-%xchg	1
-¿  rz 0.5
-ch h  0.5
-u  ó  0.5
-u  o  0.75
-om ¹  0.5
-om a  0.75
-en ê  0.5
-en ê  0.75
-a  ¹  0.25
-c  æ  0.25
-e  ê  0.25
-l  ³  0.25
-n  ñ  0.25
-o  ó  0.25
-s  ¶  0.25
-z  ¿  0.25
-z  Œ  0.25
-x  Œ  0.30
-
Index: p/src/common/Makefile
===================================================================
--- app/src/common/Makefile	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,8 +1,0 @@
-# main: cmdline.c main_template.cc
-# 	g++ -o main cmdline.c common.cc main_template.cc
-
-# cmdline.c cmdline.h : cmdline.ggo
-# 	gengetopt -i cmdline.ggo
-
-# cmdline.ggo: cmdline_common.ggo cmdline_program.ggo
-# 	cat cmdline_common.ggo cmdline_program.ggo > cmdline.ggo
Index: p/src/common/README
===================================================================
--- app/src/common/README	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,18 +1,0 @@
-Propozycja ujednolicenia dzialania klocka na poziomie
-funkcji main. Parametry meta - zdefiniowane dla
-wszystkich, poza tok, programow, definiujace ich zachowanie
-w systemie klockow.
-
-cmdline_common.ggo		- deklaracje parametrow meta
-
-cmdline_program.ggo		- przyklad deklaracji parametrow programu
-				  nazwa docelowa np. cmdline_guess.ggo
-
-common.cc			- zmienne globalne zawierajace informacje
-				  przekazane przez parametry meta 
-common.h			
-
-main_template.cc		- szkielet funkcji main
-
-Makefile			- sposob kompilacji
-
Index: p/src/common/cmdline_common.ggo
===================================================================
--- app/src/common/cmdline_common.ggo	(revision e28a62525995e07b8d354225ae96189c5c02a06d)
+++ 	(revision )
@@ -1,34 +1,0 @@
-#section "Common UTT options"
-
-
-option  "input"		f	"Input file" string no
-
-option  "output"	o	"Output file for succesfully processed segments" string no
-
-option  "fail"		e	"Output file for unsuccesfully processed segments " string no
-
-option 	"only-fail"	-	"Print only segments the program failed to process" flag off hidden
-
-option 	"no-fail"	-	"Print only segments the program processed" flag off hidden 
-
-option  "copy"		c       "Copy succesfully processed segments to standard output" flag off
-
-option  "process"	p	"Process segments with this tag" string no multiple
-
-option  "select"	s	"Select only segments with this field" string no multiple
-
-option  "ignore"	S	"Select only segments without this field" string no multiple
-
-option	"output-field"	O	"Output field name" string no
-
-option	"input-field"	I	"Input field name" string no multiple
-
-option	"interactive"	i	"Toggle interactive mode" flag off
-
-option  "config"	-	"Configuration file" string typestr="FILENAME" no
-
-option 	"one-field"	1	"Print all results in one segments (creates ambiguous annotation)" flag off
-
-option	"one-line"	-	"Print annotation alternatives as additional fields" flag off
-
-option	"language"	-	"Language." string no
Index: p/src/common/cmdline_program.ggo
===================================================================
--- app/src/common/cmdline_program.ggo	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,5 +1,0 @@
-package "guess"
-version "0.1"
-
-option  "color"		l       "Show guessed descriptions in colour." flag off
-
Index: p/src/common/common.cc
===================================================================
--- app/src/common/common.cc	(revision 40358d23e569b2d0d4697a192451fff347a48e96)
+++ 	(revision )
@@ -1,230 +1,0 @@
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include "common.h"
-
-#include <stdio.h>
-#include <locale.h>
-
-FILE* inputf=stdin;
-FILE* outputf=stdout;
-FILE* failedf=stdout;
-bool copy_processed=0;
-bool one_field=false;
-bool one_line=false;
-char output_field_prefix[FIELD_PREFIX_MAXLEN];
-char input_field_prefix[FIELD_PREFIX_MAXLEN];
-
-extern int argc;
-extern char **argv;
-
-
-// tilde (home dir) expansion in path
-int expand_path(char* inpath, char* outpath)
-{
-  if(inpath[0]=='~')
-    sprintf(outpath,"%s%s",getenv("HOME"),inpath+1);
-  else
-    strcpy(outpath,inpath);
-  return 0; // no problem
-}
-
-
-
-
-void set_program_name(char program_name[], char* argv0)
-{
-  if (char* p_name = strrchr(argv0, '/'))
-    strcpy(program_name,p_name+1);
-  else
-    strcpy(program_name,argv0);
-}
-
-
-
-extern void process_config_files(gengetopt_args_info* args, char* argv0)
-{
-
-  char program_name[256];
-  char config_file[256];
-  char config_file_tmp[256];
-
-  set_program_name(program_name,argv0);
-
-  // obsÅuga pliku konfiguracyjnego podanego w linii komend
-  if (args->config_given) {
-    if (file_accessible(args->config_arg) == 0) {
-      if (cmdline_parser_configfile(args->config_arg,
-				    args,
-				    0, // 0 - nie nadpisuj wartoÅci parametrÃ³w
-				    0, // 0 - nie inicjuj
-				    0) != 0) {
-	fprintf(stderr, "Error in config file (%s)\n", args->config_arg);
-	exit(1);
-      }
-    }
-  }
-
-  if(args->one_line_given && !one_line) one_line=true, one_field=false;
-  if(args->one_field_given && !one_field) one_line=false, one_field=true;
-
-  // obsluga pliku konfiguracyjnego uzytkownika dla programu
-  sprintf(config_file_tmp, "%s/%s.conf", USER_CONFIG_DIR, program_name);
-  expand_path(config_file_tmp, config_file);
-  if (file_accessible(config_file) == 0) {
-    if (cmdline_parser_configfile(config_file,
-				  args,
-				  0, // 0 - nie nadpisuj danych
-				  0, // 0 - nie inicjuj struktury
-				  0) != 0) {
-      fprintf(stderr, "Error in config file (%s)\n", config_file);
-      exit(1);
-    }
-  }
-
-  if(args->one_line_given && !one_line) one_line=true, one_field=false;
-  if(args->one_field_given && !one_field) one_line=false, one_field=true;
-
-
-  // obsluga pliku konfiguracyjnego uzytkownika globalnego
-  sprintf(config_file_tmp, "%s/utt.conf", USER_CONFIG_DIR);
-  expand_path(config_file_tmp, config_file);
-  if (file_accessible(config_file) == 0) {
-    if (cmdline_parser_configfile(config_file,
-				  args,
-				  0, // 0 - nie nadpisuj danych
-				  0, // 0 - nie inicjuj struktury
-				  0) != 0) {
-      fprintf(stderr, "Error in config file (%s)\n", config_file);
-      exit(1);
-    }
-  }
-
-  if(args->one_line_given && !one_line) one_line=true, one_field=false;
-  if(args->one_field_given && !one_field) one_line=false, one_field=true;
-
-
-
-  // obsluga systemowego pliku konfiguracyjnego dla programu
-  sprintf(config_file, "%s/%s.conf", SYSTEM_CONFIG_DIR, program_name);
-  if (file_accessible(config_file) == 0) {
-    if (cmdline_parser_configfile(config_file,
-				  args,
-				  0, // 0 - nie zmieniaj danych wczesniejszych
-				  0, // 0 - nie inicjuj struktury
-				  0  // 0 - nie sprawdzaj wymaganych parametrow
-				  ) != 0) {
-      fprintf(stderr, "Error in config file (%s)\n", config_file);
-      exit(1);
-    }
-  }
-
-  if(args->one_line_given && !one_line) one_line=true, one_field=false;
-  if(args->one_field_given && !one_field) one_line=false, one_field=true;
-
-
-  // obsluga systemowego pliku konfiguracyjnego globalnego
-  sprintf(config_file, "%s/utt.conf", SYSTEM_CONFIG_DIR);
-  if (file_accessible(config_file) == 0) {
-    if (cmdline_parser_configfile(config_file,
-				  args,
-				  0, // 0 - nie zmieniaj danych wczesniejszych
-				  0, // 0 - nie inicjuj struktury
-				  0  // 0 - nie sprawdzaj wymaganych parametrow
-				  ) != 0) {
-      fprintf(stderr, "Error in config file (%s)\n", config_file);
-      exit(1);
-    }
-  }
-
-  if(args->one_line_given && !one_line) one_line=true, one_field=false;
-  if(args->one_field_given && !one_field) one_line=false, one_field=true;
-
-}
-
-
-void process_common_options(gengetopt_args_info* args, char* argv0)
-{
-  char program_name[256];
-
-  set_program_name(program_name,argv0);
-
-  setlocale(LC_CTYPE,"");
-  setlocale(LC_COLLATE, "");
-
-  if(args->help_given)
-      cmdline_parser_print_help ();
-
-  if(args->input_given)
-    if(!(inputf=fopen(args->input_arg,"r")))
-    {
-      fprintf(stderr,"No such file: %s.\n", args->input_arg);
-      exit(1);
-    }
-  
-  if(args->output_given)
-    if(!(outputf=fopen(args->output_arg,"w")))
-    {
-      fprintf(stderr,"Cannot open output file: %s.\n", args->output_arg);
-      exit(1);
-    }
-  
-  if(args->fail_given)
-      if(!(failedf=fopen(args->fail_arg,"w")))
-      {
-	fprintf(stderr,"Cannot open output file: %s.\n", args->fail_arg);
-	exit(1);
-      }
-
-  if(args->input_field_given)
-    fieldprefix(args->input_field_arg[0],input_field_prefix);
-  else
-    strcpy(input_field_prefix, "4");
-
-  if(args->output_field_given)
-    fieldprefix(args->output_field_arg,output_field_prefix);
-  else
-    sprintf(output_field_prefix, "%s%c", program_name, INFIELD_SEP);
-
-  if ((args->copy_given))
-    copy_processed=true;
-}
-
-// sprawdza istnienie pliku
-int file_accessible(const char* path) {
-  return access(path, R_OK);
-}
-
-// sprawdza istnienie pliku konfiguracyjnego
-int config_file_exists(const char* dir, const char* filename) {
-    struct stat dir_stat;
-    struct stat file_stat;
-
-    char* path = (char*)malloc(strlen(dir) + strlen(filename) + 2); // + '\0' + '/'
-
-    sprintf(path, "%s/%s", dir, filename);
-
-    if (stat(dir, &dir_stat) != 0)
-	return -1;
-
-    if (stat(path, &file_stat) != 0)
-	return -1;
-
-    if (!S_ISDIR(dir_stat.st_mode))
-	return -1; // katalog nie jest katalogiem
-
-    if (!S_ISREG(file_stat.st_mode))
-	return -1; // plik konfiguracyjny nie jest plikiem
-
-    if (access(dir, X_OK) != 0)
-	return -1; // nie mamy prawa zmienic katalogu
-
-    if (access(path, R_OK) != 0)
-	return -1; // nie mamy prawa odczytu pliku
-
-    free(path);
-
-    return 0;
-}
Index: p/src/common/common.h
===================================================================
--- app/src/common/common.h	(revision 0e3df7e06ad71d2e763b970d4420a4374e473cdd)
+++ 	(revision )
@@ -1,467 +1,0 @@
-#ifndef __COMMON_H
-#define __COMMON_H
-
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "../lib/const.h"
-
-#ifndef _CMDLINE_FILE
-#error _CMDLINE_FILE constant not defined!
-#else
-#include _CMDLINE_FILE
-#endif
-
-
-/**************************************************
- * Stale dotyczace wejscia/wyjscia
- */
-
-#define EMPTYFORM '*'
-#define INFIELD_SEP ':'
-#define MAXAUX 16
-#define FIELD_SEP " \t\n"
-#define FIELD_PREFIX_MAXLEN 32
-
-
-// katalogi z plikami konfiguracyjnymi
-// nowe
-// stare - do wyrzucenia
-// #define CONFIG_DIR ".utt/conf"
-
-// nazwa zmiennej okreslajaca sciezke do danych
-
-// #define UTT_DIR_VAR "UTT_DIR"
-
-// sciezka do plikow z danymi (np UTT_DIR/pliki) wzgledem $HOME!
-
-// #define UTT_DIR_DEFAULT ".utt/pl/"
-
-/**************************************************/
-
-
-extern FILE* inputf;
-extern FILE* outputf;
-extern FILE* failedf;
-
-extern char* input_filename;
-extern char* output_filename;
-extern char* failed_filename;
-extern bool one_line;
-extern bool one_field;
-
-extern char input_field_prefix[];
-extern char output_field_prefix[];
-
-extern bool copy_processed;
-extern bool append_output;
-extern bool append_failed;
-
-//sciezka do katalogu z danymi
-extern char utt_dir[];
-
-extern void process_common_options(gengetopt_args_info* args, char* argv0);
-extern void process_config_files(gengetopt_args_info* args, char* argv0);
-
-extern int expand_path(char* inpath, char* outpath);
-
-/**************************************************
- * problems with casing                           */
-// sprawdzenie wielkosci liter
-// wartoÂ¶ÃŠ zwracana:
-// 0 - wszystkie maÂ³e litery
-// 1 - pierwsza wielka, reszta male
-// 2 - wszystkie wielkie
-// 3 - inne
-inline int casing(char* s)
-{
-  int ret = isupper(*s) ? 1 : 0;
-  while(*++s != '\0')
-  {
-    if(isupper(*s))
-    {
-      if(ret==1) ret=2;
-      else if(ret==0) ret=3;
-    }
-    else
-    {
-      if(ret==2) ret=3;
-    }
-  }
-  return ret;
-}
-
-// 
-inline void tolowers(char* s, char* d)
-{
-  *d=tolower(*s);
-  while(*s != '\0') * ++d = tolower(* ++s);
-}
-
-
-// przepisuje s do d
-// nadajac wielkoÂ¶ÃŠ liter zgodnie z wartoÂ¶ciÂ± casing
-// casing - wartoÂ¶ÃŠ zwracana przez casing()
-// jeÂ¶li casing==3 przepisuje bez zmian (za maÂ³o informacji)
-inline void restorecasing(char *s, char *d, int casing)
-{
-  switch(casing)
-  {
-  case 0:
-  case 3:
-    *d=*s;
-    while(*s != '\0') * ++d = * ++s;
-    break;
-  case 1:
-    *d=toupper(*s);
-    while(*s != '\0') * ++d = * ++s;
-    break;
-  case 2:
-    *d=toupper(*s);
-    while(*s != '\0') * ++d = toupper(* ++s);
-    break;
-  }
-}
-
-/**************************************************/
-
-/*
-parameters:
-  -seg  - segment
-  -pref - field name or "1", "2", "3", "4" for the first four fields
-  +val  - field contents
-return value:
-  1 if specified field exists, 0 otherwise
-*/
-
-inline int getfield(char* seg, const char* pref, char* val)
-{
-
-  char* p=seg;
-  char* p0;
-
-  while(isspace(*p)) ++p;
-
-  // field "1"
-  p0=p; while(isdigit(*p)) ++p;
-  if(*pref=='1') if(p!=p0) { strncpy(val,p0,p-p0); val[p-p0]='\0'; return 1; } else return 0;
-  
-  while(isspace(*p)) ++p;
-
-  // field "2"
-  p0=p; while(isdigit(*p)) ++p;
-  if(*pref=='2') if(p!=p0) { strncpy(val,p0,p-p0); val[p-p0]='\0'; return 1; } else return 0;
-
-  while(isspace(*p)) ++p;
-
-  // field "3"
-  p0=p; while(isgraph(*p)) ++p; 
-  if(*pref=='3') if(p!=p0) { strncpy(val,p0,p-p0); val[p-p0]='\0'; return 1; } else return 0;
-
-  while(isspace(*p)) ++p;
-
-  // field "4"
-  p0=p; while(isgraph(*p)) ++p;
-  if(*pref=='4') if(p!=p0) { strncpy(val,p0,p-p0); val[p-p0]='\0'; return 1; } else return 0;
-
-  while(isspace(*p)) ++p;
-
-  // annotation fields
-  do p=strstr(p,pref); while(p!=NULL && *(p-1)!=' ' && *(p-1)!='\t');
-  
-  if(p==NULL) return 0;
-  else
-  {
-    p+=strlen(pref);
-    int len=strcspn(p,FIELD_SEP "\n\r\f\0");
-    strncpy(val,p,len);
-    val[len]='\0';
-    return 1;
-  }
-}
-
-
-/*
-parameters:
-        -name - field name, long or short
-        +prefix - field name with ':' appended if long name
-return value:
-        1 if correct field name, 0 otherwise
-examples:
-name    prefix  r.v.
-lem     lem:    1
-@       @       1
-::      'undef' 0
-a,b     'undef' 0
-*/
-inline
-int fieldprefix(char *name, char *prefix)
-{
-  if (ispunct(name[0]) && name[1]=='\0') // correct short name
-  {
-    strcpy(prefix, name); return 1;
-  }
-
-  int i=0;
-  while(name[i]!='\0' && isalnum(name[i])) ++i;
-  
-  if(name[i]=='\0' && i>0) // correct long name
-  {
-    sprintf(prefix,"%s:",name); return 1;
-  }
-
-  // incorrect
-  return 0;
-}
-
-inline
-bool process_seg(char* seg, gengetopt_args_info& args)
-{
-  char buf[256];
-  char pref[FIELD_PREFIX_MAXLEN];
-  bool ret = !args.process_given;
-  if(args.process_given)
-    {
-      getfield(seg,"3",buf);
-      for(int i=0; i<args.process_given; ++i)
-	if(strcmp(args.process_arg[i],buf)==0)
-	  {
-	    ret=true;
-	    break;
-	  }
-    }
-
-  if(ret==false) return false; 
-
-  for(int i=0; i<args.select_given; ++i)
-    {
-      fieldprefix(args.select_arg[i],pref); // !!! ÅATKA - ZOPTYMALIZOWAÄ !!!
-      if(! getfield(seg,pref,buf))
-	return false;
-    }
-  for(int i=0; i<args.ignore_given; ++i)
-    {
-      fieldprefix(args.ignore_arg[i],pref);  // !!! ÅATKA - ZOPTYMALIZOWAÄ !!!
-      if(getfield(seg,pref,buf))
-	return false;
-    }
-  
-  if(args.input_field_given & !getfield(seg,input_field_prefix,buf))
-    return false;
-
-  return true;
-}
-
-
-/*
-parameters:
-  -+seg - segment
-  -pref - prefix of the new field
-  -val  - contents of the new field
-return value:
-  1 - success, 0 - fail (limit on segment length exceeded)
- */
-inline
-int addfield(char *seg, const char *pref, const char *val)
-     // zalozenie, ze seg konczy sie znakiem \n
-{
-  if(strlen(seg)+strlen(pref)+strlen(val) >= MAX_LINE) return 0; // bezpieczniej, ale wolniej
-
-  int seglen=strlen(seg);
-  sprintf(seg+(seglen-1)," %s%s\n",pref,val);
-  return 1;
-}
-
-/**************************************************/
-
-struct Seg
-{
-  int filepos, len;
-  char* tag;
-  char* form;
-  char* aux[MAXAUX];
-  int auxn;
-
-  bool parse(char* line);
-  char* getfield(char* fieldname);
-  void print(char* line);
-  bool addfield(char* s);
-  bool clearfields();
-};
-
-/**************************************************/
-
-/* definicja struktury wejscia/wyjscia
- */
-struct Segment
-{
-  int filepos, len;
-  char* tag;
-  char* form;
-  char* aux[MAXAUX];
-  int auxn;
-
-  bool parse(char* line);
-  char* getfield(char* fieldname);
-  void print(char* line);
-  bool addfield(char* s);
-  bool clearfields();
-};
-
-/*
- * Sprawdza czy nalezy przetwarzac dany segment.
- */
-
-inline
-bool process_seg(Segment& s, gengetopt_args_info& args)
-{
-  bool ret = !args.process_given;
-
-  for(int i=0; i<args.process_given; ++i)
-    if(strcmp(args.process_arg[i],s.tag)==0)
-      {
-        ret=true;
-        break;
-      }
-
-  for(int i=0; i<args.select_given; ++i)
-    if(! s.getfield(args.select_arg[i]))
-      ret=false;
-
-  for(int i=0; i<args.ignore_given; ++i)
-    if(s.getfield(args.ignore_arg[i]))
-      ret=false;
-
-  return ret;
-}
-
-
-/*
- * FUNKCJE OBSLUGUJACE WEJSCIE/WYJSCIE
- */
-// napisy zostaj na miejscu (w line), tylko wskazniki sa ustawian
-// i zara dopisywane zera s dopisywane
-
-inline
-bool Segment::parse(char* line)
-{
-  auxn=0;
-  char* field;
-  if((field=strtok(line,FIELD_SEP))!=NULL)
-    filepos=atoi(field); // nie sprawdzana poprawnosc
-  else
-    return false;
-  if((field=strtok(NULL,FIELD_SEP))!=NULL)
-    len=atoi(field); // nie sprawdzana poprawnosc
-  else return false;
-  if((tag=strtok(NULL,FIELD_SEP))==NULL) return false;
-  if((form=strtok(NULL,FIELD_SEP))==NULL)
-    return true;
-  else
-    if(form[0] == EMPTYFORM && form[1] =='\0')
-      form=NULL;
-
-  while((aux[auxn]=strtok(NULL,FIELD_SEP))!=NULL) ++auxn;
-
-  return true;
-}
-
-
-inline char* Segment::getfield(char* f)
-{
-  int flen=strlen(f);
-  if(isalnum(*f))
-  {
-    for(int i=0; i<auxn; ++i)
-      if(strncmp(aux[i],f,flen)==0 && aux[i][flen]==INFIELD_SEP)
-	return aux[i]+flen+1;
-  } else
-  {
-    for(int i=0; i<auxn; ++i)
-    {
-      if(*f==*(aux[i]))
-	return aux[i]+1;
-    }
-  }
-  return NULL;
-}
-
-inline bool Segment::clearfields() {
-  for (int i=0; i<auxn; ++i) {
-    //    free(aux[i]);
-    aux[i] = NULL;
-  }
-  auxn=0;
-  return true;
-}
-
-inline // NIEEFEKTYWNE
-void Segment::print(char* line)
-{
-  sprintf(line,"%04d %02d %s", filepos, len, tag);
-  if(form)
-    {
-      strcat(line," ");
-      strcat(line,form);
-    }
-  else
-    if(auxn)
-      strcat(line," *");
-
-  for(int i=0; i<auxn; ++i)
-    {
-      strcat(line," ");
-      strcat(line,aux[i]);
-    }
-
-  strcat(line,"\n");
-}
-
-
-inline
-bool Segment::addfield(char* s)
-{
-  if(auxn<MAXAUX)
-    {
-      aux[auxn++]=s;
-      return true;
-    }
-  else
-    return false;
-}
-
-/**************************************************
- * funkcje pomocne w operacjach na plikach        *
- *  konfiguracyjnych                              *
- **************************************************/
-
-// sprawdza istnienie pliku
-int file_accessible(const char* path);
-
-// sprawdza istnienie pliku konfiguracyjnego
-int config_file(const char* dir, const char* filename);
-
-/**************************************************/
-
-/* Pobiera wejscie
- * parametry:
- * - args - tablica stringow okresnajacych pola wejsciowe
- * - args_len - rozmiar args
- * - seg - segment
- * wartosc - wskaznik do wejscia
- */
-inline char*  getInput(char** args, int args_len, Segment seg) {
-  char* formp = NULL;
-  for (int i=0; i<args_len; ++i) {
-    if ('4' == args[i][0])
-      return seg.form;
-    if ((formp = seg.getfield(args[i])) != NULL) {
-      return formp;
-    }
-  }
-  return formp;
-}
-
-#endif
Index: p/src/common/main_template.cc
===================================================================
--- app/src/common/main_template.cc	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,20 +1,0 @@
-#include <stdlib.h>
-
-#include "common.h"
-
-main(int argc, char* argv[])
-{
-  gengetopt_args_info args;
-
-  if(cmdline_parser(argc,argv,&args) != 0)
-    exit(1);
-  
-  process_common_options(args);
-
-  //
-  // TU KOD
-  //
-
-  cmdline_parser_free(&args);
-  
-}
Index: p/src/compiledic/Makefile
===================================================================
--- app/src/compiledic/Makefile	(revision 246900abc92b7d822ca17bd69aeb06d2b30db588)
+++ 	(revision )
@@ -1,21 +1,0 @@
-CFLAG1 = -m32 -Wno-deprecated -O3 -fpermissive
-CFLAG_ST = -Wno-deprecated -O3 -fpermissive -static
-
-all: compiledic aut2fsa
-
-compiledic:
-
-
-aut2fsa: aut2fsa.cc
-	#g++ -m32 -Wno-deprecated -O3 -fpermissive -static -o aut2fsa aut2fsa.cc
-	g++ $(CFLAG1) -o aut2fsa aut2fsa.cc
-
-
-copy:
-ifdef UTT_BIN_DIR
-	cp compiledic fsm2aut aut2fsa ${UTT_BIN_DIR}
-endif
-
-clean:
-	rm aut2fsa
-
Index: p/src/compiledic/TODO
===================================================================
--- app/src/compiledic/TODO	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,5 +1,0 @@
-* pliki tymczasowe:
-   - pliki symboli lab i scl
-   - pliki powstajace podczas kompilacji slownika
-
-   gdzie maja byc tworzone? tak jak teraz nie moze byc!
Index: p/src/compiledic/aut2fsa.cc
===================================================================
--- app/src/compiledic/aut2fsa.cc	(revision 2f8d6d8c39e7d4812bd35744328e0ed7e89e92bd)
+++ 	(revision )
@@ -1,18 +1,0 @@
-
-#include <iostream>
-#include <stdlib.h>
-
-#include "../lib/tfti.h"
-
-#include <fstream>
-
-using namespace std;
-
-int main()
-{
-  TFTiv<char,char> a;
-  a.read();
-  a.save();
-
-  return 0;
-}
Index: p/src/compiledic/compiledic
===================================================================
--- app/src/compiledic/compiledic	(revision e1942bef32aa49424c28a6a21a68f73a516d3fd8)
+++ 	(revision )
@@ -1,242 +1,0 @@
-#! /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 File::Copy;
-use Getopt::Long;
-
-
-my $linesPerFile = 20000;
-
-
-my $systemconfigfile='/usr/local/etc/utt/compiledic.conf';
-my $userconfigfile=home()."/.utt/compiledic.conf";
-
-Getopt::Long::Configure('no_ignore_case_always');
-
-#my $symfile='~/.utt/pl/pl_PL.iso-8859-2.sym';
-my $symbols=0;
-my $help=0;
-
-
-
-#read configuration files###########################
-my $file;
-foreach $file ($systemconfigfile, $userconfigfile){
-  if(open(CONFIG, $file)){
-  	while (<CONFIG>) {
-  		chomp;                  
-      		s/#.*//;                
-	      	s/^\s+//;               
-      		s/\s+$//;               
-    		next unless length;     
-    		my ($name, $value) = split(/\s*=\s*/, $_, 2);
-    		if($name eq "symbols"){
-			$symbols=$value;
-    		}
-   		elsif(($name eq "help")or($name eq "h")){
-			$help=1;
-    		}
-    	
-	} 
-  	close CONFIG;
-  }
-}
-#########################################################
-
-GetOptions("symbols=s" => \$symbols,
-	   "help|h" => \$help);
-
-if($help)
-{
-    print <<'END'
-Usage: compiledic [OPTIONS] dictionaryfile
-
-Options:
-   --help -h                      Help.
-   --symbols=FILE                 Symbol file.
-END
-;
-    exit 0;
-}
-
-##################################################
-
--f $symbols or die("Symbol file not found.");
-
-@ARGV > 0   or die("Source dictionary not given.");
-
-my $file = shift;
-
--f $file or die("Source dictionary not found.");
-
-$file =~ /(.*)\.dic/ or die("The input file must have .dic extension.");
-
-my $filenameprefix = $1;
-
-##################################################
-
-# Tworzymy katalog tymczasowy, gdzie wszystko bedzie umieszczane.
-my $tmp_root = File::Temp::tempdir( CLEANUP => 1 );
-
-(undef, my $symfile) = File::Temp::tempfile( DIR => $tmp_root, SUFFIX => ".sym" );
-my $symfilenoext=$symfile;
-$symfilenoext =~ s/\.sym$//;
-my $labfile = $symfilenoext . '.lab';
-my $sclfile = $symfilenoext . '.scl';
-
-copy($symbols, $symfile);
-
-# Przygotowanie etykiet
-
-`lexmakelab $symfilenoext`;
-
-
-# Analiza pliku slownika
-
-print "preparing file...........................................";
-#print "... sed section .....\n";
-(undef, my $file_sed) = File::Temp::tempfile( DIR => $tmp_root, SUFFIX => ".sed" );
-`sed -r "s/([[:punct:]])/\[\\1\]/g" < $file > $file_sed`;
-
-print "OK\n";
-
-#dzielimy plik na wiele czesci, uruchamiamy lexcomplex dla kazdej
-#czesci osobno, nastepnie laczymy to za pomoca programu fsmunion
-
-#print "Dziele slownik na mniejsze czesci...";
-
-open(IN, $file_sed);
-
-my $lineCount = 0;
-my $fileCount = 0;
-
-open(FILE, ">$tmp_root/slo_$fileCount");
-
-while (<IN>) {
-
-    if (++$lineCount >= $linesPerFile) {
-	$fileCount++;
-	$lineCount = 0;
-
-	close(FILE);
-#	print "Tworze nowy plik tymczasowy: slo_".$fileCount."\n";
-	open(FILE, ">$tmp_root/slo_".$fileCount);
-    }
-
-    print(FILE $_);
-}
-
-#print "OK\n";
-
-print "building partial automata";
-
-#32 kropki, fileCount plikow
-my $filesPerDot = $fileCount/32;
-my $files=$filesPerDot;
-my $dots=0;
-
-for (my $i=0; $i<=$fileCount; $i++) {
-
-    if ($files >= $filesPerDot) {
-	$files = 0;
-	print ".";
-	$dots++;
-    }
-    $files++;
-
-    `lexcomplex -l $labfile -S $sclfile < $tmp_root/slo_$i > $tmp_root/slownik_$i.fsm`;
-
-}
-if ($dots < 32) {
-    for (my $i=0; $i<32 - $dots; $i++) {
-	print ".";
-    }
-}
-
-print "OK\n";
-
-unlink <$tmp_root/slo_*>;
-
-print "building final automaton";
-
-#35 kropek...
-my $ndots=33;
-$filesPerDot = $fileCount/$ndots;
-$files=$filesPerDot;
-$dots=0;
-
-copy("$tmp_root/slownik_0.fsm", "$tmp_root/slownik1.fsm");
-
-for (my $i=1; $i<=$fileCount; $i++) {
-
-    if ($files >= $filesPerDot) {
-	$files = 0;
-	print ".";
-	$dots++;
-    }
-    $files++;
-
-    `fsmunion $tmp_root/slownik_$i slownik1.fsm > $tmp_root/slownik2.fsm`;
-
-    move("$tmp_root/slownik2.fsm", "$tmp_root/slownik1.fsm") || die "Unable to move $tmp_root/slownik2.fsm!\n";
-}
-
-if ($dots < $ndots) {
-    for (my $i=0; $i<$ndots - $dots; $i++) {
-	print ".";
-    }
-}
-
-#`fsmunion $tmp_root/* > $tmp_root/slownik1.fsm`;
-
-print "OK\n";
-
-print "removing epsilon-transitions.............................";
-
-`fsmrmepsilon $tmp_root/slownik1.fsm > $tmp_root/slownik2.fsm`;
-
-unlink ("$tmp_root/slownik1.fsm");
-
-print "OK\n";
-
-print "determinizing automaton..................................";
-
-`fsmdeterminize $tmp_root/slownik2.fsm > $tmp_root/slownik1.fsm`;
-
-unlink ("$tmp_root/slownik2.fsm");
-
-print "OK\n";
-
-print "minimizing automaton.....................................";
-
-`fsmminimize $tmp_root/slownik1.fsm > $tmp_root/slownik.fsm`;
-
-#`rm slownik1.fsm`;
-
-print "OK\n";
-
-print "converting fsm format to bin.............................";
-
-`fsmprint -i $labfile $tmp_root/slownik.fsm > $tmp_root/slownik.txt`;
-
-`fsm2aut $tmp_root/slownik.txt > $tmp_root/slownik.aut`;
-
-`aut2fsa < $tmp_root/slownik.aut > $filenameprefix.bin`;
-
-print "OK\n";
-
-print "removing temporary files.................................";
-
-unlink <$tmp_root/*>;
-unlink ($tmp_root);
-
-print "OK\n";
Index: p/src/compiledic/fsm2aut
===================================================================
--- app/src/compiledic/fsm2aut	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,44 +1,0 @@
-#!/usr/bin/perl
-
-my $currstate=-1;
-my @states;
-my @final;
-my $tn=0;
-
-while(<>)
-{
-  if(/^\s*([0-9]+)\s+([0-9]+)\s+(.)(\s*)?$/)
-  {
-    push @{$states[$1]}, ($3, $2);
-    $#states=$2 if $#states<$2;
-    $tn++;
-  }
-  elsif(/^\s*([0-9]+)\s*$/)
-  {
-    $final[$1]=1;
-    $#states=$1 if $#states<$1;
-  }
-  else
-  {
-    die("Input error.");
-  }
-}
-
-print scalar(@states)," ",$tn," char void\n";
-
-my $i=0;
-my $width=int(log(@states+1)/log(10));
-foreach $stateref (@states)
-{
-  $f = ($final[$i]?"+":"-");
-  printf "%${width}d %s",$i++,$f;
-  while(@$stateref)
-  {
-    $c=shift @$stateref;
-    $s=shift @$stateref;
-    print " $c $s";
-  }
-  print "\n";
-}
-
-  
Index: p/src/cor/Makefile
===================================================================
--- app/src/cor/Makefile	(revision e28a62525995e07b8d354225ae96189c5c02a06d)
+++ 	(revision )
@@ -1,41 +1,0 @@
-PAR=-Wno-deprecated -m32 -fpermissive -static
-PAR2=-c -Wno-deprecated -m32 -fpermissive
-LIB_PATH=../lib
-COMMON_PATH=../common
-CMDLINE_FILE='"../cor/cmdline.h"'
-
-
-cor: main.cc corr.o $(LIB_PATH)/word.o \
-	$(LIB_PATH)/auttools.o cmdline.c common_cor.o common.o 
-	g++ $(PAR) -D _CMDLINE_FILE=$(CMDLINE_FILE) main.cc corr.o common.o \
-	$(LIB_PATH)/word.o $(LIB_PATH)/auttools.o cmdline.c common_cor.o \
-	-o cor
-
-corr.o: corr.cc corr.hh
-	g++ $(PAR2) corr.cc
-
-common.o: $(COMMON_PATH)/cmdline_common.ggo $(COMMON_PATH)/common.cc \
-	 $(COMMON_PATH)/common.h
-	g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) $(COMMON_PATH)/common.cc
-
-common_cor.o: cmdline.h common_cor.cc common_cor.h
-	g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) common_cor.cc
-
-cmdline.c cmdline.h: cmdline.ggo
-	gengetopt -i cmdline.ggo --conf-parser
-
-cmdline.ggo: cmdline_cor.ggo $(COMMON_PATH)/cmdline_common.ggo
-	cat cmdline_cor.ggo $(COMMON_PATH)/cmdline_common.ggo > cmdline.ggo
-
-copy:
-ifdef UTT_BIN_DIR
-	cp cor ${UTT_BIN_DIR}
-endif
-
-clean: clean.cmdline
-	rm *.o || true
-	rm cor || true
-
-clean.cmdline:
-	rm cmdline.* || true
-
Index: p/src/cor/cmdline_cor.ggo
===================================================================
--- app/src/cor/cmdline_cor.ggo	(revision e28a62525995e07b8d354225ae96189c5c02a06d)
+++ 	(revision )
@@ -1,8 +1,0 @@
-package "cor"
-version "0.1"
-
-option "dictionary-home"	-	"Dictionary home dir." string typestr="FILENAME" no hidden
-option "dictionary"		d	"Dictionary" string typestr="FILENAME" default="cor.bin" no
-option "distance"		n	"Maximal edit distance." int default="1" no
-option "replace"		r	"Replace original form with corrected form, place original form in the cor field. This option has no effect in single mode" flag off hidden
-#option "single"			-	"Place all alternatives in the same line" flag off
Index: p/src/cor/common_cor.cc
===================================================================
--- app/src/cor/common_cor.cc	(revision 40358d23e569b2d0d4697a192451fff347a48e96)
+++ 	(revision )
@@ -1,29 +1,0 @@
-#include <stdlib.h>
-#include <string.h>
-#include "common_cor.h"
-
-char dictionary[256];
-
-void process_cor_options(gengetopt_args_info* args)
-{
-  if(args->dictionary_given)
-    {
-      expand_path(args->dictionary_arg,dictionary);
-      if(file_accessible(dictionary)!=0)
-	{
-	  fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary);
-	  exit(1);
-	}
-    }
-  else if (args->dictionary_home_given && args->language_given)
-    {
-      char buf[255];
-      expand_path(args->dictionary_home_arg, buf);
-      sprintf(dictionary,"%s/%s/cor.bin",buf,args->language_arg);
-      if(file_accessible(dictionary)!=0)
-	{
-	  fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary);
-	  exit(1);
-	}
-    }
-}
Index: p/src/cor/common_cor.h
===================================================================
--- app/src/cor/common_cor.h	(revision 13a8a67bce500a27f4c2121c096be175d5daab52)
+++ 	(revision )
@@ -1,19 +1,0 @@
-#ifndef __COMMON_COR_H
-#define __COMMON_COR_H
-
-#include <stdio.h>
-
-//do wyrzucenia - definicja w Makefile! #define _CMDLINE_FILE "../cor/cmdline.h"
-#include "../common/common.h"
-
-#include "cmdline.h"
-
-#define DICT_FILE "cor.bin"
-
-extern int change_count;
-
-extern void process_cor_options(gengetopt_args_info* args);
-
-extern char dictionary[];
-
-#endif
Index: p/src/cor/corr.cc
===================================================================
--- app/src/cor/corr.cc	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,142 +1,0 @@
-//---------------------------------------------------------------------------
-
-#include "corr.hh"
-
-#define MAXPATH 256
-
-#define min(x,y) ((x<y)?(x):(y))
-#define max(x,y) ((x>y)?(x):(y))
-
-
-int Corr::ed(int i,int j)
-{
-  if(i==-1)
-    return j+1;
-  if(j==-1)
-    return i+1;
-  if(i==-2 || j==-2)
-    return n+1;
-
-  if(X[i]==Y[j])
-    return H2[i-1][j-1];
-  if(X[i-1]==Y[j] && X[i]==Y[j-1])
-    return 1+min(H2[i-2][j-2],min(H2[i][j-1],H2[i-1][j]));
-  return 1+min(H2[i-1][j-1],min(H2[i][j-1],H2[i-1][j]));
-
-/*
-  if(X[i]==Y[j])
-    return H[(i-1)+2][(j-1)+2];
-  if(X[i-1]==Y[j] && X[i]==Y[j-1])
-    return 1+min(H[(i-2)+2][(j-2)+2],min(H[(i)+2][(j-1)+2],H[(i-1)+2][(j)+2]));
-  return 1+min(H[(i-1)+2][(j-1)+2],min(H[(i)+2][(j-1)+2],H[(i-1)+2][(j)+2]));
-*/
-}
-
-int Corr::cuted(int j)
-{
-  int l=max(0,j-t);
-  int u=min(m,j+t);
-  int ce=j+t;
-  for(int k=l;k<=u;k++)
-  {
-    if(H2[k][j]<ce)//if(H[(k)+2][(j)+2]<ce)
-      ce=H2[k][j];//ce=H[(k)+2][(j)+2];
-  }
-  return ce;
-}
-
-/*
-void Corr::recomputeH(int j)
-{
-  for(int i=0;i<=m;i++)
-    H[(i)+2][(j)+2]=ed(i,j);
-}
-*/
-
-void Corr::recomputeH(int j)
-{
-  int lo=max(0,j-t-2);
-  int hi=min(m,j+t+2);
-  for(int i=lo;i<=hi;++i)
-    H2[i][j]=ed(i,j);//H[(i)+2][(j)+2]=ed(i,j);
-}
-
-
-int Corr::correct(const char* w, Words& tab)
-{
-  long int path[MAXPATH]={0};
-  int i;                                    // row index (X)
-  int j;                                    // column index (Y)
-  long state=0;
-
-  strcpy(X,w);
-  m=strlen(X)-1;
-  n=m+t;
-
-  for(i=(-2);i<=m;i++)
-    H[(i)+2][(-2)+2]=n;
-  for(i=(-1);i<=m;i++)
-    H[(i)+2][(-1)+2]=(i)+1;
-  for(j=(-2);j<=n;j++)
-    H[(-2)+2][(j)+2]=n;
-  for(j=(-1);j<=n;j++)
-    H[(-1)+2][(j)+2]=(j)+1;
-
-  for(j=0; j<=n; ++j)
-    for(i=0; i<=m; ++i)
-      H[i+2][j+2]=t+1;
-
-  int more=1;
-  bool cont=false;
-
-  strcpy(Y,"");
-  j=0;
-  state=0;
-  int count=0;
-  while(more)
-  {
-    if(!empty(state))
-    {
-      Y[j]=input(state);
-      recomputeH(j);
-      if(cuted(j)<=t)
-      {
-        int edd;
-        if(final(next(state)) && (edd=H[(m)+2][(j)+2])<=t)
-        {
-          char* out=new char[j+2];
-          strncpy(out,Y,j+1);
-          out[j+1]='\0';
-          //          if(cont) putchar(' ');
-          cont=true;
-	  //          printf("%i,%s", edd,out);
-	  //          cout << out << "(" << edd << ")" << endl;
-	  tab.add(out);
-	  count++;
-        }
-        path[j++]=state;
-        state=next(state);
-        continue;
-      }
-      else
-        if(continued(state))
-        {
-          state++;
-          continue;
-        }
-    }
-    //backtracking
-    do
-      if(j>0)
-        j--;
-      else
-        more=0;
-    while(more && !continued(path[j]));
-    state=path[j]+1;
-  }
-  return count;
-}
-
-
-//---------------------------------------------------------------------------
-
Index: p/src/cor/corr.hh
===================================================================
--- app/src/cor/corr.hh	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,34 +1,0 @@
-//---------------------------------------------------------------------------
-#ifndef _corr_hh
-#define _corr_hh
-//---------------------------------------------------------------------------
-
-#include "../lib/tfti.h"
-#include "../lib/word.h"
-
-class Corr : public TFTiv<char,char>
-{
-private:
-  int H[100][100];
-  char X[100];                         // misspelled string
-  char Y[100];                         // (possibly partial) candidate string
-  int m;                               // length of X
-  int n;                               // maximal length of Y
-
-  int ed(int,int);
-  int cuted(int);
-  void recomputeH(int);
-
-public:
-  int (*H2)[100];
-
-  int t;                               // threshold
-
-  Corr() : H2((int(*)[100])&H[2][2]) {};
-  Corr(const char* a) : TFTiv<char,char>(a), H2((int(*)[100])&H[2][2]) { };
-
-  int correct(const char* w, Words& tab);
-};
-
-//---------------------------------------------------------------------------
-#endif
Index: p/src/cor/main.cc
===================================================================
--- app/src/cor/main.cc	(revision 13a8a67bce500a27f4c2121c096be175d5daab52)
+++ 	(revision )
@@ -1,155 +1,0 @@
-#include <stdlib.h>
-#include <ctype.h>
-#include "../lib/iotools.h"
-//do wyrzucenia - definicja w Makefile! #define _CMDLINE_FILE "../cor/cmdline.h"
-#include "../common/common.h"
-#include "common_cor.h"
-#include "corr.hh"
-#include "cmdline.h"
-#include <locale.h>
-
-
-int main(int argc, char** argv) {
-
-//   setlocale(LC_CTYPE,"");
-//   setlocale(LC_COLLATE,"");
-
-  gengetopt_args_info args;
-
-  if(cmdline_parser(argc, argv, &args) != 0)
-    exit(1);
-
-  process_config_files(&args,argv[0]);
-  process_common_options(&args,argv[0]);
-  process_cor_options(&args);
-
-  Corr cor;
-
-  cor.load(dictionary);
-  cor.t=args.distance_arg;
-
-  char line[MAX_LINE+1];
-  long line_count = 0;
-
-  Segment seg;
-  Words tab;
-  char form1[MAX_LINE];
-  char* form;
-  int formcasing;
-  char corfield[MAX_LINE]="";
-
-  while (fgets(line, MAX_LINE, inputf))
-    {
-//       strcpy(outline,line);
-      ++line_count;
-
-//       if(!seg.parse(line))
-//         {
-//           fprintf(stderr,"Input error in line %d.\n",line_count);
-//           exit(1);
-//         }
-
-      char outline[128];
-      //printf("Starting cor... searching for %d fields\n", args.input_field_given);
-      //for (int i=0; i<args.input_field_given; ++i) {
-      //	printf("\t%d. %s\n", i, args.input_field_arg[i]);
-      //}
-
-      if (!process_seg(line, args))
-	fputs(line, outputf);
-      else
-	{
-	  char form[MAX_FORM];
-	  
-	  tab.clear();
-	  getfield(line,input_field_prefix,form);
-	  if (form==NULL) continue;
-	  
-	  formcasing=3;
-	  cor.correct(form, tab);
-	  
-	  if( tab.count() == 0 )
-	    {
-	      formcasing=casing(form);
-	      if( formcasing == 1 || formcasing == 2)
-		tolowers(form, form1), cor.correct(form1, tab);
-	    }
-	  
-	  if ( tab.count() == 0)
-	    fputs(line, failedf);
-	  else 
-	    {
-	      if(args.replace_flag)
-		{
-		  char corfield[128];
-		  strcpy(corfield, input_field_prefix);
-		  strcat(corfield, form);
-		  seg.aux[seg.auxn]=corfield;
-		  ++seg.auxn;
-		  for(int i=0; i<tab.count(); ++i)
-		    {
-		      seg.form=tab[i].form();
-		      restorecasing(seg.form,seg.form,formcasing);
-		      seg.print(outline);
-		      fputs(outline, outputf);
-		    }
-		  --seg.auxn;
-		}
-	      else
-		{
-		  if(one_line)
-		    {
-		      char* p=corfield;
-		      for(int i=0; i<tab.count(); ++i)
-			{
-			  restorecasing(tab[i].form(),tab[i].form(),formcasing);
-			  p += sprintf(p," %s%s",output_field_prefix,tab[i].form());
-			}
-		      sprintf(p,"\n");
-
-		      strcpy(outline,line);
-		      outline[strlen(outline)-1]='\0';
-		      strcat(outline,corfield);
-		      fputs(outline, outputf);
-		    }
-		  else if(one_field)
-		    {
-		      char* p=corfield;
-		      p += sprintf(p," %s",output_field_prefix);
-		      for(int i=0; i<tab.count(); ++i)
-			{
-			  restorecasing(tab[i].form(),tab[i].form(),formcasing);
-			  p += sprintf(p,(i==0)?"%s":";%s",tab[i].form());
-			}
-		      
-		      sprintf(p,"\n");
-
-		      strcpy(outline,line);
-		      outline[strlen(outline)-1]='\0';
-		      strcat(outline,corfield);
-		      fputs(outline, outputf);
-		    }
-		  else
-		    {
-		      for(int i=0; i<tab.count(); ++i)
-			{
-			  restorecasing(tab[i].form(),tab[i].form(),formcasing);
-			  sprintf(corfield," %s%s\n",output_field_prefix,tab[i].form());
-			  strcpy(outline,line);
-			  outline[strlen(outline)-1]='\0';
-			  strcat(outline,corfield);
-			  fputs(outline, outputf);
-			}
-		    }
-		}
-	    }
-	}
-      
-      if(args.interactive_flag)
-	{
-        fflush(outputf);
-        fflush(failedf);
-      }
-    }
-  cmdline_parser_free(&args);
-}
Index: p/src/dgp/Makefile
===================================================================
--- app/src/dgp/Makefile	(revision 839a0d50e29289f66e26368671df0e083499286b)
+++ 	(revision )
@@ -1,56 +1,0 @@
-
-
-SHELL = /bin/sh
-LIB_PATH=../../lib
-COMMON_PATH=../common
-CMDLINE_FILE='"../dgp/cmdline.h"'
-
-
-#vpath %.o  .
-
-CXXFLAGS = -O2 -static
-
-sources = main.cc grammar.cc symbol.cc mgraph.cc sgraph.cc dgp0.cc cmdline.cc \
-          $(COMMON_PATH)/common.cc global.cc
-
-bin  = dgp
-
-# plik *.o sa umieszczane w podkatalogu o
-objs = $(sources:%.cc=%.o)
-
-${bin}: ${objs}
-	${CXX} ${CXXFLAGS} -D _CMDLINE_FILE=$(CMDLINE_FILE) -o $@ ${objs}
-
-include $(sources:.cc=.d)
-
-%.o: %.cc
-	${CXX} -D _CMDLINE_FILE=$(CMDLINE_FILE) -c ${CXXFLAGS} -o $@ $<
-
-%.d: %.cc
-	$(CC) -MM $(CPPFLAGS) -D _CMDLINE_FILE=$(CMDLINE_FILE) $< > $@.$$$$; \
-	sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
-	rm -f $@.$$$$
-
-# stare:
-# cmdline.cc cmdline.h : cmdline.ggo
-# 	gengetopt --c-extension=cc -i cmdline.ggo
-# nowe
-cmdline.cc cmdline.h: cmdline.ggo
-	gengetopt -i cmdline.ggo  --c-extension=cc --conf-parser
-
-cmdline.ggo: cmdline_dgp.ggo ../common/cmdline_common.ggo
-	cat cmdline_dgp.ggo ../common/cmdline_common.ggo > cmdline.ggo
-# endnowe
-
-
-clean:
-	rm ${bin} ${objs} cmdline.cc cmdline.h
-	rm -rf *.d
-
-prof: dgp
-	gprof dgp ~/tmp/dgp-pl/gmon.out > dgp.prof
-
-copy:
-ifdef UTT_BIN_DIR
-	cp dgp dgc canonize tre $(UTT_BIN_DIR)/
-endif
Index: p/src/dgp/Makefile.user
===================================================================
--- app/src/dgp/Makefile.user	(revision 0214596e4d70b25df913a24f19d50cb0f1b4a69f)
+++ 	(revision )
@@ -1,3 +1,0 @@
-
-gram.dgp: gram.dgc
-	dgc -c cats.dgc < gram.dgc > gram.dgp
Index: p/src/dgp/canonize
===================================================================
--- app/src/dgp/canonize	(revision adb4c8d65ba8b406a1703d1c091bcf1af4bdfb3c)
+++ 	(revision )
@@ -1,50 +1,0 @@
-#!/usr/bin/perl
-
-#package:	UAM TExt Tools
-#component:	canonize
-#version:	1.0
-#author:	Tomasz Obrebski
-
-use lib "/usr/local/lib/utt";
-use lib "$ENV{'HOME'}/.local/lib/utt";
-
-use strict;
-use Getopt::Long;
-use attr;
-
-
-my $help;
-
-GetOptions("help|h" => \$help);
-
-if($help)
-{
-    print <<'END'
-
-Transforms syntactic categories to their canonical form.
-
-Usage: canonize
-
-Options:
-   --help -h			Help.
-
-END
-;
-    exit 0;
-}
-
-#$|=1;
-
-my %tra;
-
-while(<>)
-{
-    s/$attr::pos_re\/$attr::avlist_re/trans($&)/ge;
-    print;
-}
-
-sub trans
-{
-    my $cat=shift;
-    exists($tra{$cat}) ? $tra{$cat} : ( $tra{$cat} = attr::canonize $cat );
-}
Index: p/src/dgp/cmdline_dgp.ggo
===================================================================
--- app/src/dgp/cmdline_dgp.ggo	(revision 3748bd1db46143a281581cb44dc804da0190cbc2)
+++ 	(revision )
@@ -1,18 +1,0 @@
-package "dgp"
-version "0.1"
-
-option	"grammar"	g	"Grammar file"
-				string no typestr="filename"
-
-option  "long"		l	"Long output"
-				flag off
-
-option  "debug"		d	"Debug mode."
-				flag off
-
-option	"info"		-	"Print info. 
-h - heads         d - dependents
-s - sets
-c - constraints	  n - node/arc counts	t - parse time
-"
-string no default="h"
Index: p/src/dgp/const.hh
===================================================================
--- app/src/dgp/const.hh	(revision 9ace5d204d63628901f9f128d3f99ce5f7c973c0)
+++ 	(revision )
@@ -1,13 +1,0 @@
-#ifndef CONST_HH
-#define CONST_HH
-
-#define MAXTYPES 32
-#define MAXFLAGS 64
-#define MAXNODES 1024
-#define MAXCONSTRS 32
-#define MAXLINE 256
-#define MAXFORMLEN 64
-#define MAXDESCRLEN 80
-#define FIELDSEP " \n\t"
-
-#endif
Index: p/src/dgp/dgc
===================================================================
--- app/src/dgp/dgc	(revision 9ace5d204d63628901f9f128d3f99ce5f7c973c0)
+++ 	(revision )
@@ -1,292 +1,0 @@
-#!/usr/bin/perl
-
-#package:	UAM Text Tools
-#component:	dgc (dg compiler)
-#version:	1.0
-#author:	Tomasz Obrebski
-
-# wymaga niejawnie programu canonize!!!!
-use lib "/usr/local/lib/utt";
-use lib "$ENV{'HOME'}/.local/lib/utt";
-
-use strict;
-use Getopt::Long;
-use Data::Dumper;
-use attr;
-use File::HomeDir;
-
-my $systemconfigfile='/usr/local/etc/utt/dgc.conf';
-my $userconfigfile=home()."/.utt/dgc.conf";
-
-Getopt::Long::Configure('no_ignore_case_always');
-
-my $help=0;
-my $catfile=0;
-my $dicfile=0;
-my $gramfile=0;
-my $outputfile=0;
-
-#read configuration files###########################
-my $file;
-foreach $file ($systemconfigfile, $userconfigfile){
-  if(open(CONFIG, $file)){
-        while (<CONFIG>) {
-                chomp;
-                s/#.*//;
-                s/^\s+//;
-                s/\s+$//;
-                next unless length;
-                my ($name, $value) = split(/\s*=\s*/, $_, 2);
-                if(($name eq "categories")or($name eq "c")){
-                        $catfile=$value;
-                }
-                elsif(($name eq "dictionary")or($name eq "d")){
-                        $dicfile=$value;
-                }
-                elsif(($name eq "grammar")or($name eq "g")){
-                        $gramfile=$value;
-                }
-                elsif(($name eq "outputfile")or($name eq "o")){
-                        $outputfile=$value;
-                }
-                elsif(($name eq "help")or($name eq "h")){
-                        $help=1;
-                }
-
-        }
-        close CONFIG;
-  }
-}
-#########################################################
-
-GetOptions("help|h" => \$help,
-	   "categories|c=s" => \$catfile,
-	   "dictionary|d=s" => \$dicfile,
-	   "grammar|g=s" => \$gramfile,
-	   "outputfile|o=s" => \$outputfile);
-
-my $homedir = $ENV{'HOME'};
-$catfile =~ s/~/$homedir/;
-$dicfile =~ s/~/$homedir/;
-$gramfile =~ s/~/$homedir/;
-$outputfile =~ s/~/$homedir/;
-
-
-if($help)
-{
-    print <<'END'
-Usage: dgc [OPTIONS]
-
-Options:
-   --categories -c filename	List of syntactic categories.
-   --dictionary -d filename     Dictionary.
-   --grammar -g filename	List of grammar rules.
-   --outputfile -o filename	Output file name.
-   --help -h			Help.
-END
-;
-    exit 0;
-}
-
-die("At least one of --cats and --dic must be given.\n") if !$catfile && !$dicfile;
-
-my $ncat=0;
-my $nrole=0;
-my $nsgl=0;
-my $nleft=0;
-my $nright=0;
-my $nreq=0;
-my $nlink=0;
-my $nflag=0;
-
-my %cats;
-my %roles;
-my %agr;
-my %gov;
-
-if(!$outputfile) {
-	*OUTPUT = *STDOUT;
-}
-elsif($outputfile eq "-") {
-    *OUTPUT = *STDOUT;
-}
-else {
-	open(OUTPUT, ">$outputfile") or die("Can't open output file: $outputfile!");
-}
-
-
-loadcats($catfile) if $catfile;
-extractcats($dicfile) if $dicfile;
-
-
-my $cats_re = qr/(?:$attr::cat_re\s*(?:,\s*$attr::cat_re)*)/;
-
-# class parse_class:
-# /$attr::cat_re/g;
-
-
-if(!$gramfile) { 
-	*INPUT = *STDIN;
-}
-elsif($gramfile eq "-"){
-    *INPUT = *STDIN;
-}
-else {
-	open(INPUT, $gramfile) or die("Unable to open: $gramfile!");
-}
-
-while(<INPUT>)
-{
-    s/#.*//;
-    s/^\s+//;
-    s/\s+$//;
-    if(/^AGR\s+(\S+)\s+(\S+)$/)
-    {
-	push @{$agr{$1}}, $2;
-    }
-    elsif(/^GOV\s+(\S+)\s+(\S+)$/)
-    {
-	push @{$gov{$1}}, attr::parse($2);
-    }
-    elsif(/^ROLE\s+\S+$/)
-    {
-	$roles{$_}=1;
-	print OUTPUT "$_\n";
-    }
-    elsif(/^SGL\s+\S+$/)
-    {
-	++$nsgl;
-	print OUTPUT "$_\n";
-    }
-    elsif(/^REQ\s+(\S+)\s+(\S+)$/)
-    {
-	print OUTPUT "#$_\n";
-	my $cat = attr::parse $1;
-	for my $atomcat (keys %cats)
-	{
-	    if(attr::match @$cat, @{$cats{$atomcat}})
-	    {
-		print OUTPUT "REQ ".$atomcat." $2\n";
-		++$nreq;
-	    }
-	}
-    }
-    elsif(/^LEFT\s+\S+$/)
-    {
-	++$nleft;
-	print OUTPUT "$_\n";
-    }
-    elsif(/^RIGHT\s+\S+$/)
-    {
-	++$nright;
-	print OUTPUT "$_\n";
-    }
-    elsif(my ($hs,$ds,$r) = /^LINK\s+($cats_re)\s+($cats_re)\s+(\S+)$/)
-    {
-	print OUTPUT "#$_\n";
-	for my $h ($hs =~ /$attr::cat_re/g)
-	{
-	    for my $d ($ds =~ /$attr::cat_re/g)
-	    {
-		addlinks($h,$d,$r);
-	    }
-	}
-    }
-    elsif(/^FLAG\s+\S+$/)
-    {
-	++$nflag;
-	print OUTPUT "$_\n"
-    }
-    elsif(/^$/) {
-	# pomijamy puste linie oraz komentarze
-	}
-	else
-    {
-	print STDERR "Illegal format: $_\n";
-    }
-}
-
-
-sub addlinks
-{
-    my ($h,$d,$r) = @_;
-
-    for my $a (@{$agr{$r}}) { print OUTPUT "#AGR $r $a\n"; }
-    for my $c (@{$gov{$r}}) { print OUTPUT "#GOV $r ".attr::unparse(@$c)."\n"; }
-    my $head = attr::parse $h;
-    my $dep = attr::parse $d;
-    
-    for my $atomhead (keys %cats)
-    {
-	if(attr::match @$head, @{$cats{$atomhead}})
-	{
-	  DEP:
-	    for my $atomdep (keys %cats)
-	    {
-		next DEP if ! attr::match @$dep, @{$cats{$atomdep}};
-		
-		for my $a (@{$agr{$r}})
-		{
-		    next DEP if ! attr::agree(@{$cats{$atomhead}},@{$cats{$atomdep}},$a);
-		}
-		
-		for my $c (@{$gov{$r}})
-		{
-		    next DEP if ! attr::match(@$c,@{$cats{$atomdep}});
-		}
-		
-		print OUTPUT "LINK ";
-		print OUTPUT $atomhead." ";
-		print OUTPUT $atomdep." $r\n";
-		++$nlink;
-		
-	    }
-	}
-    }
-}
-
-
-printf STDERR "%6d CAT   statements\n", 0+keys(%cats);
-printf STDERR "%6d ROLE  statements\n", 0+keys(%roles);
-printf STDERR "%6d SGL   statements\n", $nsgl;
-printf STDERR "%6d REQ   statements\n", $nreq;
-printf STDERR "%6d LEFT  statements\n", $nleft;
-printf STDERR "%6d RIGHT statements\n", $nright;
-printf STDERR "%6d LINK  statements\n", $nlink;
-printf STDERR "%6d FLAG  statements\n", $nflag;
-
-
-sub extractcats
-{
-    my $file = shift;
-    open DICFILE, "canonize $file |";
-    while(<DICFILE>)
-    {
-	while(/,([^[:space:];]+)/g)
-	{
-	    my $cat=$1;
-	    next if !$cat || exists $cats{$cat};
-	    $ncat++;
-	    print OUTPUT "CAT $1\n";
-	    $cats{$cat}=attr::parse($cat);
-	}
-    }
-    close DICFILE;
-}
-
-
-sub loadcats
-{
-    my $file = shift;
-    open CATFILE, "canonize $file |";
-    while(<CATFILE>)
-    {
-	tr/ \t\n//d;
-	next if !$_ || exists $cats{$_};
-	print OUTPUT "CAT $_\n";
-	++$ncat;
-	$cats{$_}=attr::parse($_);
-    }
-    close CATFILE;
-}
-
Index: p/src/dgp/dgp0.cc
===================================================================
--- app/src/dgp/dgp0.cc	(revision 0214596e4d70b25df913a24f19d50cb0f1b4a69f)
+++ 	(revision )
@@ -1,217 +1,0 @@
-#include "dgp0.hh"
-#include "global.hh"
-
-extern Grammar grammar;
-extern MGraph mgraph;
-extern SGraph sgraph;
-
-SNode* snodes;
-
-extern bool debug;
-
-list<int> nodelist;
-list<int>::iterator processed;
-
-
-void set_initial_constraints(int node)
-{
-  snodes[node].prop.forbidden.reset();
-  snodes[node].prop.required=grammar.obl[snodes[node].mnode->cat];
-}
-
-
-bool changing_constraints(int head, Role role)
-{
-  return grammar.sgl[role] || snodes[head].prop.required[role];
-}
-
-void apply_constraints(int head, Role role)
-{
-  if(grammar.sgl[role]) snodes[head].prop.forbidden.set(role);
-  snodes[head].prop.required.reset(role);
-}
-
-NodeProp compute_prop_left(NodeProp headprop, Role role)
-{
-  NodeProp ret=headprop;
-  if(grammar.sgl[role]) ret.forbidden.set(role);
-  ret.required.reset(role);
-  return ret;
-}
-
-NodeProp compute_prop_right(NodeProp headprop, Role role)
-{
-  NodeProp ret=headprop;
-
-  if(grammar.sgl[role]) ret.forbidden.set(role);
-  ret.required.reset(role);
-  return ret;
-}
-
-int get_node(MNode& mnode, NodeProp p, bitset<MAXNODES>& newheadLH, bitset<MAXNODES>& newheadLV)
-{
-  for(vector<int>::iterator ps=mnode.snodes.begin(); ps!=mnode.snodes.end(); ++ps)
-    if(snodes[*ps].prop==p && snodes[*ps].LH==newheadLH && snodes[*ps].LV==newheadLV)
-      return *ps;
-  return -1;
-}
-
-void connect_left(list<int>::iterator h, list<int>::iterator d, Role r)
-{
-  NodeProp &oldheadprop = snodes[*h].prop;
-  NodeProp newheadprop;
-  bitset<MAXNODES> newheadLV;
-  bitset<MAXNODES> newheadLH;
-  bitset<MAXNODES> newheadLD;
-  
-  newheadprop=compute_prop_left(oldheadprop,r);
-  
-  int newheadind;
-  if(oldheadprop==newheadprop)
-    newheadind = *h;
-  else
-  {
-    newheadLH = snodes[*h].LH;
-    newheadLV = snodes[*d].LV;
-    newheadLD = snodes[*h].LD;
-
-    newheadind = get_node(*(snodes[*h].mnode), newheadprop, newheadLH, newheadLV);
-    if( newheadind < 0 )
-    {
-      newheadind = sgraph.clone(*h,newheadprop);
-      list<int>::iterator nextit=h; ++nextit;
-      nodelist.insert(nextit,newheadind);
-      snodes[newheadind].LH=newheadLH;
-      snodes[newheadind].in_LH=true;
-      snodes[newheadind].LV.reset();
-      snodes[newheadind].LD = newheadLD;
-      
-      if(debug) sgraph.print_node_debug(stderr," C ",newheadind);
-    }
-    else
-      snodes[newheadind].LD |= newheadLD; // TYLKO DLA LD
-  }
-
-  snodes[newheadind].deps.push_back(Arc(*d,r,*h));
-  
-  if(snodes[*d].saturated()) snodes[newheadind].LV |= snodes[*d].LV;
-  snodes[newheadind].LD.set(*d);
-  if(snodes[*d].saturated()) snodes[newheadind].LD |= snodes[*d].LD;
-  
-  if(debug)
-    sgraph.print_arc(stderr,*d,newheadind,r,0), sgraph.print_node_debug(stderr," U ",newheadind);
-}
-
-
-void connect_right(list<int>::iterator h, list<int>::iterator d, Role r)
-{
-  NodeProp &oldheadprop = snodes[*h].prop;
-  NodeProp newheadprop;
-  bitset<MAXNODES> newheadLV;
-  bitset<MAXNODES> newheadLH;
-  bitset<MAXNODES> newheadLD;
-  int newheadind;
-  
-  newheadprop = compute_prop_right(oldheadprop,r);
-  if(oldheadprop==newheadprop)
-    newheadind = *h;
-  else
-  {
-    newheadLH = snodes[*h].LH;
-    newheadLV = snodes[*h].LV;
-    newheadLD = snodes[*h].LD;
-
-    newheadind = get_node(*(snodes[*h].mnode), newheadprop, newheadLH, newheadLV);
-    if( newheadind < 0 )
-    {
-      newheadind = sgraph.clone(*h,newheadprop);
-      snodes[newheadind].LH=newheadLH;
-      snodes[newheadind].in_LH=false;
-      snodes[newheadind].LV=newheadLV;
-      snodes[newheadind].LD=newheadLD;
-      list<int>::iterator nextit=h; ++nextit;
-      nodelist.insert(nextit,newheadind);
-      
-      if(debug) sgraph.print_node_debug(stderr," C ",newheadind);
-    }
-    else
-      snodes[newheadind].LD |= newheadLD; // TYLKO DLA LD
-  }
-  
-  snodes[*d].heads.push_back(Arc(newheadind,r,*h));
-
-  snodes[*d].LH.set(newheadind);
-
-  if(snodes[newheadind].saturated()) snodes[*d].LH |= snodes[newheadind].LH;
-
-  if(debug)
-    sgraph.print_arc(stderr,newheadind,*d,r,1), sgraph.print_node_debug(stderr," U ",*d);
-  
-}
-
-
-void try_connect_dependents(list<int>::iterator j)
-{
-  for(list<int>::iterator i(j); i!=nodelist.begin(); --i)
-    if(sgraph.visible(*i,*j) && sgraph.saturated(*i))
-    {
-      Roles& ji_roles = grammar.connect[snodes[*j].mnode->cat][snodes[*i].mnode->cat];
-      for(RolesIter r=ji_roles.begin(); r!=ji_roles.end();++r)
-        if(grammar.check_constr(snodes[*j].prop,snodes[*i].prop,0,*r))
-          connect_left(j,i,*r);
-    }
-}
-
-
-void try_connect_heads(list<int>::iterator j)
-{
-  for(list<int>::iterator i(j); i!=nodelist.begin(); --i)
-    if(sgraph.visible(*i,*j))
-    {
-      Roles& ij_roles = grammar.connect[snodes[*i].mnode->cat][snodes[*j].mnode->cat];
-      for(RolesIter r=ij_roles.begin(); r!=ij_roles.end();++r)
-        if(grammar.check_constr(snodes[*i].prop,snodes[*j].prop,1,*r))
-          connect_right(i,j,*r);
-    }
-}
-
-
-void reverse_links()
-{
-  list<int>::iterator i = nodelist.begin();
-  for(++i; i!=nodelist.end(); ++i)
-    {
-      for(vector<Arc>::iterator da=sgraph.nodes[*i].deps.begin()--; da!=sgraph.nodes[*i].deps.end(); ++da)
-        sgraph.nodes[da->dst].heads.push_back(Arc(*i,da->role,da->anc));
-      for(vector<Arc>::iterator ha=sgraph.nodes[*i].heads.begin(); ha!=sgraph.nodes[*i].heads.end(); ++ha)
-        sgraph.nodes[ha->dst].deps.push_back(Arc(*i,ha->role,ha->anc));
-    }
-}
-
-
-void dgp0()
-{
-  snodes=sgraph.nodes;
-
-  nodelist.clear();
-  nodelist.push_back(0); // BOS
-  processed=nodelist.begin();
-
-  for(int m=0; m<mgraph.n ; ++m)
-  {
-    int basenode = sgraph.add_base_snode(mgraph.nodes+m); // ma zwracaæ SNode*
-    set_initial_constraints(basenode);
-    nodelist.push_back(basenode);
-
-    if(debug) {sgraph.print_node_debug(stderr,"B  ",basenode);} // STDOUT!!!
-
-    list<int>::iterator cursor=processed;
-    while(++cursor != nodelist.end())
-    {
-      try_connect_dependents(cursor);
-      try_connect_heads(cursor);
-      processed=cursor;
-    }
-  }
-  reverse_links();
-}
Index: p/src/dgp/dgp0.hh
===================================================================
--- app/src/dgp/dgp0.hh	(revision 0214596e4d70b25df913a24f19d50cb0f1b4a69f)
+++ 	(revision )
@@ -1,12 +1,0 @@
-#ifndef _DGP0_HH
-#define _DGP0_HH
-
-#include "grammar.hh"
-#include "sgraph.hh"
-#include "mgraph.hh"
-
-// API
-
-void dgp0();
-
-#endif
Index: p/src/dgp/global.cc
===================================================================
--- app/src/dgp/global.cc	(revision 0214596e4d70b25df913a24f19d50cb0f1b4a69f)
+++ 	(revision )
@@ -1,5 +1,0 @@
-
-#include "global.hh"
-
-bool debug = false;
-
Index: p/src/dgp/global.hh
===================================================================
--- app/src/dgp/global.hh	(revision 0214596e4d70b25df913a24f19d50cb0f1b4a69f)
+++ 	(revision )
@@ -1,1 +1,0 @@
-extern bool debug;
Index: p/src/dgp/go
===================================================================
--- app/src/dgp/go	(revision cfed5c16437f8fdaa6995493b975db89abf458c2)
+++ 	(revision )
@@ -1,13 +1,0 @@
-if test -f Makefile.go; 
-then
-	make -f Makefile.go gram.dgp;
-	tok |\
-	lem -p W |\
-	canonize |\
-	sen |\
-	gph -p W -p BOS -p EOS -r BOS |\
-	dgp -i ds -p W -p BOS -p EOS -g gram.dgp
-else 
-	echo "Invalid configuration! Run utt_make_config.pl first."
-fi
-
Index: p/src/dgp/grammar.cc
===================================================================
--- app/src/dgp/grammar.cc	(revision 9ace5d204d63628901f9f128d3f99ce5f7c973c0)
+++ 	(revision )
@@ -1,181 +1,0 @@
-
-#include <stdio.h>
-
-#include "grammar.hh"
-
-bool (*constraint[MAXCONSTRS])(int head, int dep);
-
-
-int chk_type(const char* s, int lineno) // SIDE EFECTS!
-{
-  if(Role::index(s)>0) return 1;
-
-  fprintf(stderr,"%8d: Invalid type '%s'. Line ignored.\n",lineno,s);
-  return 0;
-}
-
-int chk_cat(const char* s, int lineno)
-{
-  if(Cat::index(s)>0) return 1;
-
-  fprintf(stderr,"%8d: Invalid category '%s'. Line ignored.\n",lineno,s);
-  return 0;
-}
-
-void Grammar::add_category(const char* s)
-{
-  Cat::add(s);
-  if(Cat::count()>cats_sz)
-  {
-    cats_sz += 16;
-    connect.resize(cats_sz);
-    for(int i=0; i<cats_sz; ++i)
-      connect[i].resize(cats_sz);
-    obl.resize(cats_sz);
-  }
-}
-
-void Grammar::add_type(const char* s)
-{  
-  Role::add(s);
-  if(Role::count()>types_sz)
-  {
-    types_sz += 16;
-    lt.resize(types_sz);
-    gt.resize(types_sz);
-  }
-}
-
-void Grammar::add_flag(const char* s)
-{  
-  Flag::add(s);
-  if(Flag::count()>flags_sz)
-  {
-    flags_sz += 16;
-    pass.resize(flags_sz);
-  }
-}
-
-
-void Grammar::set_lt(Role s, Role t)
-{
-  lt[s].set(t);
-  gt[t].set(s);
-  if(s==0||(int)t==0)
-    return;
-  else
-  {
-    for(int i=0; i<Role::count(); ++i)
-      if(lt[i][s])
-	set_lt(i,t);
-    for(int i=0; i<Role::count(); ++i)
-      if(lt[t][i])
-	set_lt(s,i);
-  }
-}  
-
-
-void Grammar::compute_gt()
-{
-  for(Role s=0; s<Role::count(); ++s)
-    for(Role t=0; t<Role::count(); ++t)
-      if(lt[s][t])
-	gt[t].set(s);
-}
-
-
-bool Grammar::read(FILE* f)
-{
-  int lineno=0;
-  char line[MAXLINE]; // line has the structure: key [arg1 [arg2 [arg3]]]
-  char key[MAXLINE];
-  char arg1[MAXLINE];
-  char arg2[MAXLINE];
-  char arg3[MAXLINE];
-
-  while(fgets(line,MAXLINE,f))
-  {
-    lineno++;
-    int fields=sscanf(line,"%s %s %s %s",key,arg1,arg2,arg3);
-
-    if(fields<1 || key[0]=='#') continue; // skip empty lines and comments
-
-    if     (strcmp(key,"CAT")==0 && fields>=2)
-    {
-      add_category(arg1);
-    }
-    else if(strcmp(key,"ROLE")==0 && fields>=2)
-    {
-      add_type(arg1);
-    }
-    else if(strcmp(key,"SGL")==0 && fields>=2)
-    {  
-      if(chk_type(arg1,lineno))
-        set_sgl(arg1);
-    }
-    else if(strcmp(key,"LEFT")==0 && fields>=2)
-    { 
-      if(chk_type(arg1,lineno))
-        set_left(arg1);
-    }
-    else if(strcmp(key,"RIGHT")==0 && fields>=2)
-    {
-      if(chk_type(arg1,lineno))
-        set_right(arg1);
-    }
-    else if(strcmp(key,"REQ")==0 && fields>=3)
-    {
-      if(chk_cat(arg1,lineno) + chk_type(arg2,lineno) == 2)
-        set_obl(arg1,arg2);
-    }
-    else if(strcmp(key,"LINK")==0 && fields>=4)
-    { 
-      if(chk_cat(arg1,lineno) + chk_cat(arg2,lineno) + chk_type(arg3,lineno) == 3)    
-        set_connect(arg1,arg2,arg3);
-    }
-    // FLAG DECLARATION
-    else if(strcmp(key,"FLAG")==0 && fields>=2)
-    { 
-      add_flag(arg1);
-    }
-
-    else fprintf(stderr,"Invalid line %d. Ignored.\n", lineno);
-  }
-
-//   compute_gt();
-
-  return true;
-  
-}
-
-void Grammar::write(FILE* f)
-{
-  for(Cat i=1; i<Cat::count(); ++i)
-    fprintf(f,"CAT\t%s\n",i.str());
-
-  for(Role i=1; i<Role::count(); ++i)
-    fprintf(f,"ROLE\t%s\n",i.str());
-
-  for(Role i=1; i<Role::count(); ++i)
-    if(sgl.test(i)) fprintf(f,"SGL\t%s\n",i.str());
-  
-  for(Role i=1; i<Role::count(); ++i)
-    if(left.test(i)) fprintf(f,"LEFT\t%s\n",i.str());
-
-  for(Role i=1; i<Role::count(); ++i)
-    if(right.test(i)) fprintf(f,"RIGHT\t%s\n",i.str());
-
-  for(Cat c=1; c<Cat::count(); ++c)
-    for(Role r=1; r<Role::count(); ++r)
-      if(obl[c].test(r)) fprintf(f,"REQ\t%s\t%s\n",c.str(),r.str());
-  
-  for(Cat c=1; c<Cat::count(); ++c)
-    for(Cat d=1; d<Cat::count(); ++d)
-      for(Role t=1; t<Role::count(); ++t)
-	if(connect[c][d].count(t))
-          fprintf(f,"LINK\t%s\t%s\t%s\n",c.str(),d.str(),t.str());
-
-  for(Flag i=1; i<Flag::count(); ++i)
-    fprintf(f,"FLAG\t%s\n",i.str());
-}
-
Index: p/src/dgp/grammar.hh
===================================================================
--- app/src/dgp/grammar.hh	(revision 2f8d6d8c39e7d4812bd35744328e0ed7e89e92bd)
+++ 	(revision )
@@ -1,81 +1,0 @@
-#ifndef _GRAMMAR_HH
-#define _GRAMMAR_HH
-
-#include <bitset>
-#include <vector>
-#include <list>
-#include <set>
-
-#include "const.hh"
-#include "thesymbols.hh"
-#include "sgraph.hh"
-
-
-using namespace std;
-
-class Link
-{
-  Role role;
-  FlagSet hflags;
-  FlagSet dflags;
-};
-
-
-class Grammar
-{
-
- public:
-
-  //  enum CONSTR { SGL, OBL, LEFT, RIGHT, INIT, NONINIT, FIN, NONFIN };
-
-  Grammar() : types_sz(0), cats_sz(0), flags_sz(0) {} ;
-  
-  int types_sz;
-  int cats_sz;
-  int flags_sz;
-
-  vector< vector< Roles > >    connect;
-  RoleSet                      sgl;
-  vector< RoleSet >            obl;
-  RoleSet                      left;
-  RoleSet                      right;
-  vector< RoleSet >            lt;
-  vector< RoleSet >            gt;
-
-
-  //  vector< vector< vector<
-  vector< FlagSet >            set;
-  vector< FlagSet >            pass;
-
-  bool read(FILE* f);
-  void write(FILE* f);
-
-  void add_category(const char* s);
-  void add_type(const char* s);
-  void add_flag(const char* s);
-
-  void set_sgl(Role r)           { sgl.set(r); }
-  void set_obl(Cat c, Role r)    { obl[c].set(r); }
-  void set_left(Role r)          { left.set(r); }
-  void set_right(Role r)         { right.set(r); }
-  void set_order(Role r, Role s) { lt[s].set(r); }
-  void set_connect(Cat c, Cat d, Role r)   { connect[c][d].insert(r); }
-  void set_lt(Role r, Role s);
-  void compute_gt();
-
-
-  bool check_constr(NodeProp& hprop, NodeProp& dprop, int dir, Role role);
-
-};
-
-inline bool Grammar::check_constr(NodeProp& hprop, NodeProp& dprop, int dir, Role role)
-{
-  return 
-    !hprop.forbidden[role] &&
-    ( !right[role] || dir==1 ) &&
-    ( !left[role] || dir==0 )
-    ;
-}
-
-
-#endif
Index: p/src/dgp/main.cc
===================================================================
--- app/src/dgp/main.cc	(revision 3748bd1db46143a281581cb44dc804da0190cbc2)
+++ 	(revision )
@@ -1,121 +1,0 @@
-
-/**
- * Package:	UAM Text Tools
- * Component:	dgp (dg parser)
- * Version:	1.0
- * Author:	Tomasz Obrebski
- */
-
-#include "global.hh"
-#include "mgraph.hh"
-#include "sgraph.hh"
-#include "grammar.hh"
-#include "dgp0.hh"
-#include "../common/common.h"
-#include "cmdline.h"
-
-#define MAXSEGMENTS 500
-
-char segment[MAXSEGMENTS][MAXLINE];
-int segcount=0;
-char seg_mnode[MAXSEGMENTS];
-char grammarfile[255];
-
-
-Grammar grammar;
-MGraph mgraph;
-SGraph sgraph;
-
-FILE* grammarf;
-FILE* debugf=stdout;
-unsigned int info=0U;
-
-void output();
-
-main(int argc, char* argv[])
-{
-  gengetopt_args_info args;
-
-  if(cmdline_parser(argc,argv,&args) != 0)
-    exit(1);
-
-  process_config_files(&args,argv[0]);
-  process_common_options(&args,argv[0]);
-
-  if(!args.grammar_given)
-    fprintf(stderr,"dgp: no grammar given\n");
-
-  expand_path(args.grammar_arg,grammarfile);
-
-  if(!(grammarf=fopen(grammarfile,"r")))
-    fprintf(stderr,"dgp: grammar file not found: %s.\n", grammarfile), exit(1);
-
-  if(args.debug_given) debug=true;
-
-  for(char* c=args.info_arg; *c!='\0' ; ++c)
-    switch(*c)
-    {
-    case 'h': info|=SGraph::HEADS; break;
-    case 'd': info|=SGraph::DEPS; break;
-    case 's': info|=SGraph::SETS; break;
-    case 'c': info|=SGraph::CONSTRAINTS; break;
-    }
-
-  grammar.read(grammarf);
-  fclose(grammarf);
-
-  mgraph.clear();
-  sgraph.clear();
-
-  char line[1000];
-  while (fgets(line, MAXLINE+1, inputf))
-  {
-    line[strlen(line)-1] = '\0';
-    strcpy(segment[segcount],line);
-
-    char segtype[80];
-
-    seg_mnode[segcount] = process_seg(line, args) ? mgraph.add_node(line) : -1;
-
-    segcount++;
-
-    getfield(line,"3",segtype);
-    if(strcmp(segtype,"EOS")==0)
-    {
-      dgp0(); // parametry!!! MGraph, SGraph, Grammar
-      output();
-      
-      mgraph.clear();
-      sgraph.clear();
-      segcount=0;
-    }
-    //    if(args.interactive_flag) { fflush(outputf); fflush(failedf); }
-  }
-  
-  fclose(inputf);
-  fclose(outputf);
-  cmdline_parser_free(&args);
-  exit(0);
-}
-
-void output()
-{
-  for(int si=0; si<segcount; ++si)
-  {
-    if(seg_mnode[si]>=0)
-    {
-      MNode& m=mgraph.nodes[seg_mnode[si]];
-      for(vector<int>::iterator s=m.snodes.begin(); s!=m.snodes.end(); ++s)
-      {
-        fputs(segment[si],outputf);
-        sgraph.print_node(outputf, *s, info);
-        fputc('\n',outputf);
-      }
-    }
-    else
-    {
-      fputs(segment[si],outputf);
-      fputc('\n',outputf);
-    }
-  }
-}
Index: p/src/dgp/mgraph.cc
===================================================================
--- app/src/dgp/mgraph.cc	(revision 3748bd1db46143a281581cb44dc804da0190cbc2)
+++ 	(revision )
@@ -1,54 +1,0 @@
-
-#include "mgraph.hh"
-#include "thesymbols.hh"
-#include "const.hh"
-
-#include <stdio.h>
-
-int MGraph::add_node(char* seg)
-{
-  nodes[n].clear();
-  
-  char field1[80], field3[80], descr[256], gph[256];
-  char* cat;
-  
-  getfield(seg,"1",field1);
-  nodes[n].pos=atoi(field1);
-
-  getfield(seg,"3",field3);
-  if(!getfield(seg,"lem",descr)) strcpy(descr,"?,?");
-
-  cat=descr;
-  while(*cat!=',' && *cat ) ++cat;
-  if(*cat) ++cat;
-  
-//  Cat::add(cat);
-  if(Cat::index(cat)>0)
-    nodes[n].cat=cat;
-  else
-    nodes[n].cat="NULL";
-  
-  nodes[n].pred.clear();
-  
-  char* tok;
-  int previd;
-  
-  if(!getfield(seg,"gph",gph))
-  {
-    fprintf(stderr,"No gph field. Aborting (sorry).\n");
-    exit(1);
-  }
-
-  char* ids=strtok(gph,":");
-  if(n!=atoi(ids)){fprintf(stderr,"Invalid node id in line ?. Program aborted.\n"); exit(1); }
-  
-  char *preds;
-  while(preds=strtok(NULL,","))
-  {
-    previd=atoi(preds);
-    nodes[n].pred.push_back(&nodes[previd]);
-  }
-
-  return n++;
-}
-
Index: p/src/dgp/mgraph.hh
===================================================================
--- app/src/dgp/mgraph.hh	(revision 2f8d6d8c39e7d4812bd35744328e0ed7e89e92bd)
+++ 	(revision )
@@ -1,37 +1,0 @@
-#ifndef _MGRAPH_HH
-#define _MGRAPH_HH
-
-#include <vector>
-
-#include "const.hh"
-#include "thesymbols.hh"
-#include "../common/common.h"
-
-
-using namespace std;
-
-class MNode
-{
-public:
-
-  char           type[MAXFORMLEN];
-  Cat            cat;
-  int            pos;
-  vector<MNode*> pred;
-  vector<int>    snodes;
-
-  void           clear() { snodes.clear(); };
-};
-
-class MGraph
-{
- public:
-
-  MNode nodes[MAXNODES];
-  int   n;
-
-  void clear() { n=0; };
-  int add_node(char* seg);
-};
-
-#endif
Index: p/src/dgp/sgraph.cc
===================================================================
--- app/src/dgp/sgraph.cc	(revision 9ace5d204d63628901f9f128d3f99ce5f7c973c0)
+++ 	(revision )
@@ -1,165 +1,0 @@
-#include "global.hh"
-#include "sgraph.hh"
-#include "mgraph.hh"
-#include "grammar.hh"
-#include "const.hh"
-#include <stdio.h>
-
-
-int SGraph::add_base_snode(MNode* mn)
-{
-  int nodeind=n;
-  SNode &node=nodes[n];
-
-  node.clear();
-
-  node.mnode=mn;
-
-  for(vector<MNode*>::iterator pm=node.mnode->pred.begin(); pm!=node.mnode->pred.end(); ++pm)
-    for(vector<int>::iterator ps=(*pm)->snodes.begin(); ps!=(*pm)->snodes.end(); ++ps)
-      if(nodes[*ps].in_LH)
-      {
-        node.LV.set(*ps);
-        if(nodes[*ps].saturated()) node.LV |= nodes[*ps].LH;
-      }
-
-  mn->snodes.push_back(nodeind);
-  ++n;
-
-  node.in_LH=true;
-
-  return nodeind;
-}
-
-
-void SGraph::update_left(int headind, int depind)
-{
-  SNode &head=nodes[headind], &dep=nodes[depind];
-
-  if(dep.saturated()) head.LV |= dep.LV, head.LD |= dep.LD;
-}
-
-
-void SGraph::update_right(int headind, int depind)
-{
-  SNode &head=nodes[headind], &dep=nodes[depind];
-
-  dep.LH.set(headind);
-  if(head.saturated())
-    dep.LH |= head.LH;
-}
-
-
-int SGraph::clone(int ancind, NodeProp newprop)
-{
-  int newind = n++;
-  SNode &newnode=nodes[newind];
-  SNode &ancnode = nodes[ancind];
-
-  newnode.clear();
-  newnode.prop=newprop;
-  newnode.mnode=ancnode.mnode;
-  newnode.mnode->snodes.push_back(newind);
-  return newind;
-}
-
-
-//-------------------------------------------------------------------------
-//-------------------------------------------------------------------------
-
-
-int SGraph::print_node(FILE* f, int n, unsigned int info)
-{
-  char buf[1000];
-  sprint_node(buf,n,info);
-  fputs(buf,f);
-}
-
-int SGraph::sprint_node(char* buf, int nodeind, unsigned int info)
-{
-  char* buf0=buf;
-  char descr[256];
-  char nodeinfo[16];
-
-  SNode &node=nodes[nodeind];
-
-  buf+=sprintf(buf," dgp:%d",nodeind);
-  buf+=sprintf(buf, saturated(nodeind) ? ";s" : ";u");
-
-  bool cont=false;
-  if (info&HEADS)
-  {
-    buf+=sprintf(buf,";");
-    for(vector<Arc>::iterator h=node.heads.begin(); h!=node.heads.end(); ++h)
-    {
-      if(cont) buf+=sprintf(buf,","); else cont=true;
-      buf+=sprintf(buf,"++%s-%d/%d",h->role.str(),h->dst,h->anc);
-    }
-  }
-  
-  if (info&DEPS)
-  {
-    buf+=sprintf(buf,";");
-    for(vector<Arc>::iterator d=node.deps.begin(); d!=node.deps.end(); ++d)
-    {
-      //      if(! nodes[d->dst].saturated()) continue; // NIE DRUKUJ NIENASYCONYCH PODRZEDNIKOW
-      if(cont) buf+=sprintf(buf,","); else cont=true;
-      buf+=sprintf(buf,"--%s-%d/%d",d->role.str(),d->dst,d->anc);
-    }
-  }
-  
-  if (info&SETS)
-  {
-    int ord=0;
-    buf+=sprintf(buf,";{");
-    for(vector<MNode*>::iterator pm=node.mnode->pred.begin(); pm!=node.mnode->pred.end(); ++pm)
-      for(vector<int>::iterator ps=(*pm)->snodes.begin(); ps!=(*pm)->snodes.end(); ++ps)
-        buf+=sprintf(buf, ord++ ? ",%d" : "%d", *ps);
-    buf+=sprintf(buf,"};{");
-    ord=0;for(int j=0; j<=n; ++j) if(node.LV[j]) buf+=sprintf(buf, ord++ ? ",%d" : "%d", j);
-    buf+=sprintf(buf,"};{");
-    ord=0;for(int j=0; j<=n; ++j) if(node.LH[j]) buf+=sprintf(buf, ord++ ? ",%d" : "%d", j);
-    buf+=sprintf(buf,"};{");
-    ord=0;for(int j=0; j<=n; ++j) if(node.LD[j]) buf+=sprintf(buf, ord++ ? ",%d" : "%d", j);
-    buf+=sprintf(buf,"}");
-  }
-
-  if (info&CONSTRAINTS)//  buf+=sprint_node_constraints(buf,n);
-  {
-    buf+=sprintf(buf,";");
-    int cont=0;
-    for(Role i=1; i<=Role::count(); ++i)
-      if(node.prop.forbidden[i]) buf+=sprintf(buf,"%s!%s",(cont++)?",":"",i.str());
-    for(Role i=1; i<=Role::count(); ++i)
-      if(node.prop.required[i]) buf+=sprintf(buf,"%s&%s",(cont++)?",":"",i.str());
-  }
-  
-//   buf+=sprintf(buf,"\n");
-  
-  return buf-buf0;
-}
-
-
-int SGraph::sprint_node_debug(char* buf, const char* pref, int n)
-{
-  char *buf0 = buf;
-  buf+=sprintf(buf,"#%s",pref);
-  buf+=sprint_node(buf,n,HEADS|DEPS|SETS|CONSTRAINTS);
-  buf+=sprintf(buf,"\n");
-  return buf-buf0;
-}
-
-int SGraph::print_node_debug(FILE* f, const char* pref, int n)
-{
-  char buf[1000];
-  sprint_node_debug(buf,pref,n);
-  fputs(buf,f);
-}
-
-void SGraph::print_arc(FILE* f, int left, int right, Role role, int dir) // 0 - left, 1 - right
-{
-  fprintf(f,"#   %s:%s.%02d %s %s.%02d\n",
-          role.str(),nodes[left].mnode->type,left,
-          dir ? "-->" : "<--",
-          nodes[right].mnode->type,right);
-}
Index: p/src/dgp/sgraph.hh
===================================================================
--- app/src/dgp/sgraph.hh	(revision 2f8d6d8c39e7d4812bd35744328e0ed7e89e92bd)
+++ 	(revision )
@@ -1,110 +1,0 @@
-#ifndef _SGRAPH_HH
-#define _SGRAPH_HH
-
-#include <stdio.h>
-
-#include <list>
-#include <vector>
-#include <bitset>
-
-#include "const.hh"
-#include "thesymbols.hh"
-
-
-using namespace std;
-
-class MNode;
-
-
-struct Arc
-{
-  int dst;
-  Role role;
-  int anc;
- 
-  Arc(int d, Role r, int a) : dst(d), role(r), anc(a) {};
- };
-
-
-struct NodeProp
-{
-  bitset<MAXTYPES> required;
-  bitset<MAXTYPES> forbidden;
-
-  bool operator==(const NodeProp& p)
-  { return required==p.required && forbidden==p.forbidden; }
-
-  void clear()
-  { required.reset(), forbidden.reset(); }
-
-};
-
-
-struct SNode
-{
-  
-  MNode* mnode;
-
-  NodeProp prop;
-
-  bitset<MAXNODES> LV;
-  bitset<MAXNODES> LH;
-  bitset<MAXNODES> LD;
-  bool in_LH;
-
-  vector<Arc> heads;
-  vector<Arc> deps;
-
-  void clear()      { prop.clear(), LV.reset(), LD.reset(), LH.reset(), heads.clear(), deps.clear(); }
-  bool saturated()  { return prop.required.none(); }
-};
-
-
-
-class SGraph
-{
-public:
-
-  SNode nodes[MAXNODES];
-  int n; // number of nodes
-
-  enum Output { HEADS=1, DEPS=2, SETS=4, CONSTRAINTS=8 };
-
-  SGraph() : n(0) {}
-
-  void clear() { n=0; }
- 
-  int add_base_snode(MNode* mn);
-  int clone(int ancind, NodeProp newprop);
-  void update_left(int headind, int depind);
-  void update_right(int headind, int depind);
-
-  bool visible(int left, int right);
-  bool saturated(int node);
-
-  //--------------------------------------------------------------------
-
-  void read(FILE* f);
-  void write(FILE* f, list<int> nodelist, unsigned int info);
-
-  int sprint_node(char* buf, int n, unsigned int info);
-  int print_node(FILE* f, int n, unsigned int info);
-  int sprint_node_debug(char* buf, const char* pref, int n);
-  int print_node_debug(FILE* f, const char* pref, int n);
-
-  void print_arc(FILE* f, int left, int right, Role role, int dir); // 0 - left, 1 - right
-
-};
-
-
-inline bool SGraph::visible(int left, int right)
-{
-  return nodes[right].LV[left];
-}
-
-inline bool SGraph::saturated(int node)
-{
-  return nodes[node].saturated();
-}
-
-#endif
Index: p/src/dgp/symbol.cc
===================================================================
--- app/src/dgp/symbol.cc	(revision 0214596e4d70b25df913a24f19d50cb0f1b4a69f)
+++ 	(revision )
@@ -1,39 +1,0 @@
-#include "symbol.hh"
-
-// CLASS symbols
-
-//int Symbols::_no_of_spaces=0;
-
-Symbols::~Symbols()
-{
-  while(!table.empty())
-  {
-    free((void*)table.back());
-    table.pop_back();
-  }
-}
-
-void Symbols::load(const char* filename)
-{
-  ifstream f(filename);
-  char s[100];
-  while(f)
-  {
-    f >> s >> ws;
-    if(strlen(s)) add(s);
-  }
-}  
-
-void Symbols::add(const char* sym)
-{
-  if(hash.count(sym)==0)
-  {
-    char* symdup=strdup(sym);
-    hash[symdup]=table.size();
-    table.push_back(symdup);
-  }
-}
-
-
-//template<int space>
-//Symbols Symbol<space>::defs;
Index: p/src/dgp/symbol.hh
===================================================================
--- app/src/dgp/symbol.hh	(revision 2969c84f86ae28faac6be390daeaf51b41f2218a)
+++ 	(revision )
@@ -1,143 +1,0 @@
-#ifndef _SYMBOL_HH
-#define _SYMBOL_HH
-
-#include <ext/hash_map>
-//#include <ext/hash_fun.h>
-#include <string>
-#include <string.h>
-#include <fstream>
-#include <vector>
-#include <iostream>
-
-using namespace std;
-
-using __gnu_cxx::hash_map;
-using __gnu_cxx::hash;
-
-
-// Key comparison for the cstr_hash hash table
-struct eqstr
-{ 
-  bool operator()(const char * s, const char* t) const 
-  { return strcmp(s,t)==0; }
-};
-
-
-// Hash table for storing symbols
-
-typedef hash_map<const char*,int,hash<const char*>,eqstr> cstr_hash;
-
-// Symbol table. Provides access to symbols through their index or name.
-
-class Symbols
-{
- public:
-
-  Symbols() { add("NULL"); };
-  ~Symbols();
-  
-  void load(const char* filename);
-
-  int operator[](const char* s) { return hash[s]; };
-  
-  const char* operator[](int i) { return table[i]; };
-
-  void add(const char* c);
-
-  int count() { return table.size(); };
-
- private:
-    
-  std::vector<const char*> table;
-  cstr_hash hash;
-
-};
-
-//////////////////////////////////////////////////////////////////////
-
-/// Symbol class template. 
-/** The template argument determines the symbol space.
-    Each space is created with symbol "NULL" with indexed 0 already in.
-*/
-
-template <int space>
-class Symbol
-{
- public:
-
-  /// Load the contents of the symbol table from file.
-  static void define(const char *filename) 
-  { defs.load(filename); }
-  
-  /// Add symbol s.
-  /** The string is duplicated.
-   */
-  static Symbol<space> add(const char* s) { defs.add(s); }
-      
-  /// Number of symbols.
-  static int count() { return defs.count(); };
-
-  /// First symbol.
-  static int first() { return 1; }
-
-  /// Last symbol.
-  static int last() { return defs.count()+1; }
-
-  /// Last symbol.
-  static int index(const char* s) { return defs[s]; }
-
-  /// Just for tests.
-  static void print();
-
-  /// 0-argument constructor, default value is 0 ("NULL").
-  Symbol() : val(0) {};
-
-  /// Constructing a symbol from its index.
-  /** No check is performed.
-  */
-
-  Symbol(int v) : val(v) {};
-  
-  /// Constructing a symbol from its name (string to Symbol conversion).
-  /** If s is not a symbol name, the value of 0 ("NULL") is assigned.
-  */
-
-  Symbol(const char * s) : val(defs[s]) {};
-  
-  /// Symbol to char* conversion. If symbol is invalid, NULL is returned.
-  const char* str() const { return (val>=0 && val<count())?defs[val]:NULL; };
-
-  /// Symbol to int& conversion.
-  /** Provides a way to iterate through symbols, eg:
-   *  for(Symbol<0> s=1; s; s++ ) ...
-      s=0; while(++s) ...
-   */
-  (operator int)() const { return val; };
-
-  Symbol operator++() {val++; return *this;}
-
-  //  bool operator<(Symbol& s) { return val < s.val; }
-
-
- private:
-  static Symbols defs;
-  int val;
-};
-
-template <int space>
-void Symbol<space>::print()
-{
-  for(Symbol i=0; i<count(); ++i)
-    cout << (int)i << ": " << (const char*)i << endl;
-}
-
-template<int space>
-Symbols Symbol<space>::defs;
-
-template<int space>
-bool operator<(const Symbol<space>& s, const Symbol<space>& t)
-{
-  return (int)s < (int)t;
-}
-
-#endif
Index: p/src/dgp/thesymbols.hh
===================================================================
--- app/src/dgp/thesymbols.hh	(revision 2f8d6d8c39e7d4812bd35744328e0ed7e89e92bd)
+++ 	(revision )
@@ -1,32 +1,0 @@
-#ifndef __THESYMBOLS__HH
-#define __THESYMBOLS__HH
-
-#include "symbol.hh"
-#include "const.hh"
-
-#include <list>
-#include <set>
-#include <bitset>
-
-
-using namespace std;
-
-typedef Symbol<1> Cat;
-
-typedef Symbol<2> Role;
-typedef list<Role> RoleList;
-typedef list<Role>::iterator RoleListIter;
-typedef bitset<MAXTYPES> RoleSet;
-typedef set<Role> Roles;
-typedef Roles::iterator RolesIter;
-
-typedef Symbol<3> Constr;
-typedef list<Constr> ConstrList;
-typedef list<Constr>::iterator ConstrListIter;
-
-typedef Symbol<4> Rel;
-
-typedef Symbol<5> Flag;
-typedef bitset<MAXFLAGS> FlagSet;
-
-#endif
Index: p/src/dgp/tre
===================================================================
--- app/src/dgp/tre	(revision b012e2a7b06b05fd4e62aa96b3082305dcd8e1ef)
+++ 	(revision )
@@ -1,304 +1,0 @@
-#!/usr/bin/ruby -I /usr/local/lib/utt -I $HOME/.local/lib/utt
-
-$: << "#{ENV['HOME']}/.local/lib/utt"
-$: << "/usr/local/lib/utt"
-
-require 'getoptlong'
-require 'seg.rb'
-
-opts = GetoptLong.new(
-[ '--help',     '-h',   GetoptLong::NO_ARGUMENT ],
-[ '--debug',    '-d',   GetoptLong::NO_ARGUMENT ],
-[ '--format',   '-F',   GetoptLong::REQUIRED_ARGUMENT ],
-[ '--info',     '-I',   GetoptLong::REQUIRED_ARGUMENT ],
-[ '--only-trees','-t',  GetoptLong::NO_ARGUMENT ])
-
-$helptext=
-"The program generates trees from the graph output by dgp. dgp must\n"+
-"must be run with '-i ds' option.\n\n"+
-"Command:       tre [options]\n\n"+
-"Options:\n"+
-"--help         -h      Print help (this text) and exit.\n"+
-"--debug        -d      Verbose output. For developers only.\n"+
-"--format=s     -F s    Output format. Recognized values:\n"+
-"                               a       root + list of arcs\n"+
-"                               p       parenthesized notation\n"+
-"                               h       human readable indented tree format\n"+
-"                       Multiple values are allowed. (default p)\n"+
-"--info=s       -I s    Information printed. Recognized values:\n"+
-"                               n       node identifier\n"+
-"                               f       surface form\n"+
-"                               m       morphological information\n"+
-"                               l       arc labels\n"+
-"--only-trees   -t      Do not copy input. Print trees only.\n"
-
-$DEBUG=false
-$FORMAT='p'
-$INFO='DEFAULT'
-$ONLYTREES=false
-
-opts.each do |opt, arg|
-  case opt
-  when '--help'
-    print $helptext
-    exit 0
-  when '--debug'
-    $DEBUG=true
-  when '--format'
-    $FORMAT=arg
-  when '--info'
-    $INFO=arg
-  when '--only-trees'
-    $ONLYTREES=true
-  else
-    print "Unknown option #{opt}. Ignored.\n"
-  end
-end
-
-if $INFO=='DEFAULT'
-  case $FORMAT
-    when 'p','a'
-    $INFO='nl'
-    when 'h'
-    $INFO='fmnl'
-  end
-end
-
-$dgpsep=';'
-
-def tre(input)
-  $gphid=[]
-  $form=[]
-  $lem=[]
-  nodes=[]
-  count=0
-  seg=Seg.new
-  for line in input
-    print line unless $ONLYTREES
-    seg.set(line)
-    if dgp=seg['dgp']
-      if nodes==[] && seg[3]!='BOS'
-        print "A sentence must start with BOS segment. Aborting.\n"
-        return
-      end
-
-      id=dgp[/^\d+/].to_i
-
-      if gph=seg['gph']
-        $gphid[id]=gph[/^\d+/].to_i
-      else
-        print "No gph field. Aborting.\n"
-        return
-      end
-
-      $form[$gphid[id]]=seg[4]
-      $lem[$gphid[id]]=seg['lem']
-              
-      nodes[id] = [seg[1].to_i,dgp]
-
-      if seg[3]=='EOS'
-        $pref = "#{seg[1]} #{seg[2]} SYN *"
-        parsegraph(nodes)
-        printgraph if $DEBUG
-        $thetrees=[]
-        gentrees2
-        for t in $thetrees
-          count += 1
-          t1=ground(t)
-          case $FORMAT
-          when /a/
-            print "#{$pref} tre:#{count} arc:"
-            printarcs(t1[0],t1[1])
-            print "\n"
-          when /p/
-            print "#{$pref} tre:#{count} par:"
-            printpar(t1[0],t1[1])
-            print "\n"
-          when /h/
-            print "#\n# tree #{count}\n# ------\n"
-            printtree(t1[0],t1[1],0)
-          end
-        end
-        nodes=[]
-      end
-    end
-  end
-end
-
-
-def nodeinfo(id)
-  info=""
-  if $INFO =~ /n/
-    info += id.to_s                           
-    info += '.' if $INFO =~ /[fm]/
-  end
-  if $INFO =~ /f/
-    info += $form[id] 
-    info += ';' if $INFO =~ /m/
-  end
-  if $INFO =~ /m/
-    info += $lem[id]  
-  end
-  info
-end
-
-
-def printarcs(root,arcs)
-  print nodeinfo(root)
-  for a in arcs
-    print ';'
-    print "#{a[2]}:" if $INFO =~ /l/
-      print nodeinfo(a[0])+'-'+nodeinfo(a[1])
-  end
-end
-
-def printtree(root,arcs,o)
-  if o==0
-        print "# %-16s" % "root: "
-  end
-  print nodeinfo(root),"\n"
-  for arc in arcs.select{ |a| a[0]==root }.sort{|a,b| a[1]<=>b[1] }
-    print '# ',"   "*(o+1)
-    print "%-16s" % (arc[2]+": ")
-    printtree(arc[1],arcs,o+1)
-  end
-end
-
-def printpar(root,arcs)
-  print nodeinfo(root)
-  deps = arcs.select{ |a| a[0]==root }.sort{|a,b| a[1]<=>b[1] }
-  unless deps == []
-    print '('
-    cont=false
-    for arc in deps
-      if cont then print ',' else cont=true end
-      print arc[2],':' if $INFO =~ /l/
-      printpar(arc[1],arcs)
-    end
-    print ')'
-  end
-end
-
-
-def parsegraph(nodes)
-
-  $n   =nodes.length
-  $sat =[];
-
-  $vis =[];
-  $succ=[];
-  $lhs =[];
-  $arcs=[];
-  $pos=[]
-
-  for dgp in nodes
-
-    parts  = dgp[1].split($dgpsep,6)
-
-    if parts[3]==nil || parts[4]==nil || parts[5]==nil
-      $stderr.print "ERR: tre requires dgp be called with '--info s' option. Aborting.\n"
-      exit
-    end
-
-    i      = parts[0].to_i
-    $pos[i] = dgp[0].to_i
-    $sat << i if parts[1]=="s"
-    $arcs |= parts[2].split(',').map{ |a| case a 
-                                          when /\-\-(\w+)-(\d+)\/(\d+)/
-                                            [i, $2.to_i, $1, $3.to_i]
-                                          when /\+\+(\d+)-(\w+)\/(\d+)/
-                                            [$1.to_i, i, $2, $3.to_i]
-                                          end }
-    $succ |= parts[3][1..-2].split(',').map{|x| [x.to_i,i]}
-    $vis  |= parts[4][1..-2].split(',').map{|x| [x.to_i,i]} 
-    $lhs  |= parts[5][1..-2].split(',').map{|x| [x.to_i,i]} + [[i,i]]
-
-  end
-end
-
-
-def ground(t)
-  [ $gphid[t[0]] , t[1].map{|a| [$gphid[a[0]],$gphid[a[1]],a[2]]} ]
-end  
-
-
-def gentrees2()
-  $thetrees=[];
-  bos=0; eos=$n-1;
-  roots = (1...eos).select{|i| $vis.include? [i,eos]}.select{|i| $vis.include? [bos,i]}
-  if $DEBUG then print "ROOTS: #{roots.inspect}\n" end
-  for i in roots
-    $theroot=i
-    for r in buildR(i , eos, [])
-      (rmin,rmax,rtree) = r
-      buildR(bos, rmin, rtree)
-    end
-  end
-end
-
-
-def buildR(min, max, tree)
-  if $DEBUG then print "buildR--#{min}--#{max}--#{tree.inspect}\n" end
-  trees=[]
-  for a in $arcs.select{|a| a[0]==max && $vis.include?([min,a[1]]) }
-    if $DEBUG then print "ARC: #{a.inspect}\n" end
-    for r in buildR(a[1],a[3],tree+[a])
-      (rmin,rmax,rarcs) = r
-      for l in buildR(min,rmin,rarcs)
-        (lmin,lmax,larcs) = l
-        trees << [lmin,rmax,larcs]
-      end
-    end
-  end
-  for i in (0...$n).select{|i| $succ.include?([i,max])}.select{|i| $lhs.include?([min,i])}
-    for l in buildL(min,i,tree)
-      (lmin,lmax,larcs) = l
-      trees << [lmin,lmax,larcs]
-    end
-  end
-  trees  
-end
-    
-
-def buildL(min,max,tree)
-  if $DEBUG then print "buildL--#{min}--#{max}--#{tree.inspect}\n" end
-  if $pos[min]==$pos[max]
-    if min==0 && max==0
-      $thetrees.push [$theroot,tree]
-      if $DEBUG then print "adding tree: #{tree.inspect}\n" end
-    end
-    return [[max,max,tree]]
-  end
-  trees=[]
-  for arc in $arcs.select{|a| a[1]==max && $lhs.include?([min,a[0]]) }
-    if $DEBUG then print "ARC: #{arc.inspect}\n" end
-    for r in buildR(arc[3],max,tree+[arc])
-      (rmin,rmax,rarcs) = r
-      for l in buildL(min,rmin,rarcs)
-        (lmin,lmax,larcs) = l
-        trees << [lmin,lmax,larcs]
-      end
-    end
-  end
-  trees
-end
-
-
-def printgraph()
-  
-  print "N:    #{$n}\n"
-  print "SAT:  #{set_to_s($sat)}\n"
-  print "SUCC: #{rel_to_s($succ)}\n"
-  print "VIS:  #{rel_to_s($vis)}\n"
-  print "LHS:  #{rel_to_s($lhs)}\n"
-  print "ARCS: #{arcs_to_s($arcs)}\n"
-end
-
-def set_to_s(s) "{#{s.join(',')}}" end
-def rel_to_s(r) "{#{r.map{|p| "(#{p[0]},#{p[1]})"}.join(',')}}" end
-def arc_to_s(q) "-#{q[0]}-#{q[2]}-#{q[1]}/#{q[3]}" end
-def arcs_to_s(a) "{#{a.map{|q| arc_to_s(q)}.join(',')}}" end
-
-######################################################################
-
-tre($stdin)
Index: p/src/dgp/uttcommon.c
===================================================================
--- app/src/dgp/uttcommon.c	(revision 0214596e4d70b25df913a24f19d50cb0f1b4a69f)
+++ 	(revision )
@@ -1,2 +1,0 @@
-#include "uttcommon.h"
-
Index: p/src/dgp/uttcommon.h
===================================================================
--- app/src/dgp/uttcommon.h	(revision 0214596e4d70b25df913a24f19d50cb0f1b4a69f)
+++ 	(revision )
@@ -1,146 +1,0 @@
-#ifndef __COMMON_H
-#define __COMMON_H
-
-#include <stdio.h>
-
-/**************************************************
- * Stale dotyczace wejscia/wyjscia
- */
-
-#define MAXLINE 1024
-
-#define EMPTYFORM '*'
-#define INFIELD_SEP ':'
-#define MAXAUX 16
-#define FIELD_SEP " \t\n"
-
-
-/***************************************************************/
-/* problems with casing                                        */
-/* sprawdzenie wielkosci liter                                 */
-/* warto¶æ zwracana:                                           */
-/* 0 - wszystkie ma³e litery, 1 - pierwsza wielka, reszta male */
-/* 2 - wszystkie wielkie, 3 - inne                             */
-/***************************************************************/
-inline int casing(char* s)
-{
-  int ret = isupper(*s) ? 1 : 0;
-  while(*++s != '\0')
-  {
-    if(isupper(*s))
-    {
-      if(ret==1) ret=2;
-      else if(ret==0) ret=3;
-    }
-    else
-    {
-      if(ret==2) ret=3;
-    }
-  }
-  return ret;
-}
-
-// 
-inline void tolowers(char* s, char* d)
-{
-  *d=tolower(*s);
-  while(*s != '\0') * ++d = tolower(* ++s);
-}
-
-
-// przepisuje s do d
-// nadajac wielko¶æ liter zgodnie z warto¶ci± casing
-// casing - warto¶æ zwracana przez casing()
-// je¶li casing==3 przepisuje bez zmian (za ma³o informacji)
-inline void restorecasing(char *s, char *d, int casing)
-{
-  switch(casing)
-  {
-  case 0:
-  case 3:
-    *d=*s;
-    while(*s != '\0') * ++d = * ++s;
-    break;
-  case 1:
-    *d=toupper(*s);
-    while(*s != '\0') * ++d = * ++s;
-    break;
-  case 2:
-    *d=toupper(*s);
-    while(*s != '\0') * ++d = toupper(* ++s);
-    break;
-  }
-}
-
-
-/**************************************************/
-/*
-parameters:
-  -seg  - segment
-  -name - field name
-  +val  - field contents
-return value:
-  1 if specified field exists, 0 otherwise
-*/
-
-inline int getfield(char* seg, const char* pref, char* val)
-{
-  char* p=seg;
-
-  while(isspace(*p)) ++p;
-  
- pos:
-  if(isdigit(*p) or *p=='*') while(!isspace(*p)) ++p; 
-  else goto type;
-
-  while(isspace(*p)) ++p;
-  
- len:
-  if(isdigit(*p) or *p=='*') while(!isspace(*p)) ++p; 
-  else goto type;
-
-  while(isspace(*p)) ++p;
-  
- type:
-  while(isspace(*p)) ++p; while(!isspace(*p)) ++p;
-
-  while(isspace(*p)) ++p;
-
- form:
-  while(isspace(*p)) ++p; while(!isspace(*p)) ++p;
-
- annotation:
-  do p=strstr(p,pref); while(p!=NULL && *(p-1)!=' ' && *(p-1)!='\t');
-  
-  if(p==NULL) return 0;
-  else
-  {
-    p+=strlen(pref);
-    int len=strcspn(p,FIELD_SEP "\n\r\f\0");
-    strncpy(val,p,len);
-    val[len]='\0';
-    return 1;
-  }
-}
-
-
-/*
-parameters:
-  +seg - segment
-  -pref - prefix of the new field
-  -val  - contents of the new field
-return value:
-  1 - success, 0 - fail (limit on segment length exceeded)
-*/
-inline int addfield(char *seg, const char *pref, const char *val)
-     // zalozenie, ze seg konczy sie znakiem \n
-{
-  if(strlen(seg)+strlen(pref)+strlen(val) >= MAXLINE) return 0; // bezpieczniej, ale wolniej
-
-  int seglen=strlen(seg);
-  sprintf(seg+(seglen-1)," %s%s\n",pref,val);
-  return 1;
-}
-
-
-#endif
Index: p/src/gue/Makefile
===================================================================
--- app/src/gue/Makefile	(revision e28a62525995e07b8d354225ae96189c5c02a06d)
+++ 	(revision )
@@ -1,42 +1,0 @@
-PAR=-Wno-deprecated -O3 -fpermissive -m32 -static
-PAR2=-c -Wno-deprecated -O3 -fpermissive -m32
-LIB_PATH=../lib
-COMMON_PATH=../common
-CMDLINE_FILE='"../gue/cmdline.h"'
-
-
-gue: main.cc guess.o $(LIB_PATH)/auttools.o $(LIB_PATH)/word.o \
-      cmdline.c common_guess.o common.o
-	g++ $(PAR) main.cc guess.o \
-	$(LIB_PATH)/auttools.o $(LIB_PATH)/word.o cmdline.c common.o common_guess.o \
-	-o gue
-
-guess.o: guess.h guess.cc
-	g++ $(PAR2) guess.cc
-
-common_guess.o: cmdline.h  common_guess.cc common_guess.h
-	g++ $(PAR2) common_guess.cc
-
-common.o: $(COMMON_PATH)/cmdline_common.ggo $(COMMON_PATH)/common.cc \
-	 $(COMMON_PATH)/common.h
-	g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) $(COMMON_PATH)/common.cc
-
-cmdline.c cmdline.h: cmdline.ggo
-	gengetopt -i cmdline.ggo --conf-parser
-
-cmdline.ggo: cmdline_guess.ggo $(COMMON_PATH)/cmdline_common.ggo
-	cat cmdline_guess.ggo $(COMMON_PATH)/cmdline_common.ggo > cmdline.ggo
-
-
-clean: clean.cmdline
-	rm *.o || true
-	rm gue || true
-
-
-clean.cmdline:
-	rm cmdline.* || true
-
-copy:
-ifdef UTT_BIN_DIR
-	cp gue ${UTT_BIN_DIR}
-endif
Index: p/src/gue/cmdline_guess.ggo
===================================================================
--- app/src/gue/cmdline_guess.ggo	(revision 19760efd7bb36c499d7149474a4898332fa60a7c)
+++ 	(revision )
@@ -1,12 +1,0 @@
-package "guess"
-version "0.1"
-
-option "guess_count"		n	"Guess up to n descriptions" int default="0" no
-option "delta"			-	"Stop displaying answers after fall of weight" float default="0.2" no
-option "cut-off"		-	"Do not display answers with less weight than cut-off" int default="200" no
-option "dictionary-home"	-	"dh" string typestr="FILENAME" no hidden
-option "dictionary"		d	"File with dictionary information" string typestr="filename" default="gue.bin" no
-option "per-info"		v	"Display performance information" flag off
-option "weights"		w	"Print weights" flag off
-option "no-uppercase"		-	"Do not process form containing uppercase letters" flag off
-
Index: p/src/gue/common_guess.cc
===================================================================
--- app/src/gue/common_guess.cc	(revision 19760efd7bb36c499d7149474a4898332fa60a7c)
+++ 	(revision )
@@ -1,60 +1,0 @@
-#include <stdlib.h>
-#include <string.h>
-#include "common_guess.h"
-
-int guess_count=0;
-double delta=0.1;
-int cut_off=100;
-char dictionary[255];
-bool per_info=false;
-bool weights=false;
-
-void process_guess_options(gengetopt_args_info* args)
-{
-
-  if(args->dictionary_given)
-    {
-      expand_path(args->dictionary_arg,dictionary);
-      if(file_accessible(dictionary)!=0)
-	{
-	  fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary);
-	  exit(1);
-	}
-    }
-  else if (args->dictionary_home_given && args->language_given)
-    {
-      char buf[255];
-      expand_path(args->dictionary_home_arg, buf);
-      sprintf(dictionary,"%s/%s/gue.bin",buf,args->language_arg);
-      if(file_accessible(dictionary)!=0)
-	{
-	  fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary);
-	  exit(1);
-	}
-    }
-
-  if(args->guess_count_given)
-    guess_count=args->guess_count_arg;
-  else
-    guess_count=0;
-
-  if(guess_count==0)
-    guess_count=100;
-
-  if(args->delta_given)
-    delta=args->delta_arg;
-  else
-    delta=0.1;
-
-  if(args->cut_off_given)
-    cut_off=args->cut_off_arg;
-  else
-    cut_off=100;
-
-  if(args->per_info_given)
-    per_info=args->per_info_flag;
-
-  if(args->weights_given)
-    weights=true;
-
-}
Index: p/src/gue/common_guess.h
===================================================================
--- app/src/gue/common_guess.h	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,20 +1,0 @@
-#ifndef __COMMON_GUESS_H
-#define __COMMON_GUESS_H
-
-#include <stdio.h>
-#define _CMDLINE_FILE "../gue/cmdline.h"
-#include "../common/common.h"
-#include "cmdline.h"
-
-#define DIC_FILE "gue.bin"
-
-extern int guess_count;
-extern double delta;
-extern int cut_off;
-extern char dictionary[];
-extern bool per_info;
-extern bool weights;
-
-void process_guess_options(gengetopt_args_info* args);
-
-#endif
Index: p/src/gue/guess.cc
===================================================================
--- app/src/gue/guess.cc	(revision 2f8d6d8c39e7d4812bd35744328e0ed7e89e92bd)
+++ 	(revision )
@@ -1,142 +1,0 @@
-
-#include "guess.h"
-
-#include <string.h>
-#include <iostream>
-#include <stdlib.h>
-#include <assert.h>
-#include <time.h>
-
-#define DICT 1
-#define COR 2
-#define DICT_P 3
-#define COR_P 4
-
-#define W_PRE 0.1
-#define W_SUF 0.9
-
-#define PREF_SIGN '_'
-
-
-using namespace std;
-
-
-Guess::Guess(const char* suf_file)
-  : _suf(suf_file) {
-  /*  _suf = NULL;
-  _pref = NULL;
-
-   if (strlen(suf_file) > 0)
-    _suf = new TFTiv<char, char>(suf_file);
-  if (strlen(pref_file) > 0)
-    _pref = new TFTiv<char, char>(corp_file);
-  */
-}
-
-
-  char buf[MAX_LINE];
-  char out[MAX_LINE];
-  char* buf0_s = buf;
-  char* word_t = NULL;
-  long state_s = 0;
-  unsigned length_s = buf0_s - buf;
-  long len = 0;
-  int i=0;
-
-int Guess::ana(const char* word, Words& result) {
-
-  assert(word && &result);
-
-  /* Word zawiera wyraz, ktory mamy zbadac.
-   * Nalezy przepisac go w odwrotnej kolejnosci do bufora,
-   * znalezc najdluzszy prefiks pasujacy do tego bufora
-   * separatorem jest '/' - za tym znakiem znajduje sie
-   * prawdopodobienstwo wystapienia danego opisu */
-
-  buf0_s = buf;
-  word_t = strdup(word);
-
-  if (reverse(word, buf) != 0)
-    return -1;
-
- 
-
-  state_s = -1;
-  //  printf("#buf0_s=%s, ", buf0_s);
-  state_s = _suf.pref(buf0_s, PREF_SIGN);
-  //  printf("#word=%s, buf0_s=%s\t", word, buf0_s);
-  /* jezeli state_s != -1 to oznacza, ze w slowniku jest zawarta
-   * informacja o prefiksie tego slowa.
-   * nie jest ona odwrocona, wiec porownujemy do word a nie do buf
-   */
-  //  printf("state_s=%d\t", state_s);
-  if (state_s != -1) {
-    state_s = _suf.pref(word_t, '~', state_s);
-    //    printf("state_s(wp)=%d, word_t=%s, word=%s\n", state_s, word_t, word);
-  }
-  if (state_s == -1) {
-  //  if (_suf != NULL) 
-    buf0_s = buf;
-    state_s = _suf.pref(buf0_s, '~');
-    //    printf("state_s=%d\n", state_s);
-  }
-
-  length_s = buf0_s - buf;
- 
-  /* state jest stanem, od ktorego zaczyna sie sciezka opisujaca
-   * prawdopodobienstwo przeciwienstwa wystapienia opisu
-   * znajdujacego sie dalej na tej sciezce.
-   * Im mniejsza wartosc liczby tym wieksze prawdopodobienstwo */
-
-  len = 0;
-  i=0;
-  
-  //  if (_suf != NULL)
-    len = _suf.cont(state_s, out);
-  while (len > 0) {
-    i++;
-    add_word_prob(result, word, out, length_s, DICT);
-    len = _suf.cont(-1, out);
-  }
-    
-  return i;
-
-}
-
-
-int Guess::add_word_prob(Words& tab, const char* word, const char* path, unsigned len, int source) {
-
-  /* Dodaje do tablicy tab wyraz word wraz
-   * z prawdopodobienstwem i opisem zawartym
-   * w sciezce path */
-
-  //  printf("add_word_prob(");
-  //  fflush(stdout);
-  char p[MAX_LINE];
-
-  strcpy(p, path);
-
-  int probLen = strcspn(p, ";");
-  char prob[probLen+1];
-  strncpy(prob, p, probLen);
-  prob[probLen] = '\0';
-
-  char* desc = p + probLen+1; // +2 bo pomijamy jeszcze znak ';'
-
-  int i = tab.add(word, desc);
-
-  if (source==DICT) {
-    tab[i].len_suf(len);
-    tab[i].w_suf(atof(prob)); // + W_PRE*tab[i].w_suf()));
-    //    tab[i].w_suf((float)(W_SUF*(1000-atof(prob)) + W_PRE*tab[i].w_suf()));
-  }
-//   if (source==COR) {
-//     tab[i].len_pref(len);
-//     tab[i].w_pref(W_SUF*(1000-atof(prob)) + W_PRE*tab[i].w_pref());
-//   }
-//   printf(")\n");
-//   fflush(stdout);
-
-  return i;
-
-}
Index: p/src/gue/guess.h
===================================================================
--- app/src/gue/guess.h	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,56 +1,0 @@
-
-#include "../lib/tfti.h"
-#include "../lib/word.h"
-
-#include <sys/timeb.h>
-
-/**************************************************************
- * Zawiera definicje klasy Guess.                              *
- *                                                            *
- * Klasa ta pozwala na okreslenie opisu slowa nie             *
- * znajdujacego sie w slowniku wraz z prawdopodobienstwem     *
- * jego wystapienia.                                          *
- *************************************************************/
-
-class Guess {
-
- public:
-
-  // nazawa pliku slownika w parametrze
-  Guess(const char* suf_file);
-
-  // zwraca tablice opisow slowa wraz z prawdopodobienstwem ich wystapienia
-  int ana(const char* word, Words& result);
-
-  long time_overall;
-
- private:
-
-  // sufiksy
-  TFTiv<char, char> _suf;
-
-  // prefiksy
-  TFTiv<char, char> _pref;
-
-  //odwraca ciag znakow
-  int reverse(const char* src, char* dest) {
- 
-  //  assert((src != NULL) && (dest != NULL));
-
-    const char* c = src;
-  
-    int len = strlen(src);
-
-    for (int i=1; i<=len; ++i) {
-      dest[i-1] = src[len-i];
-    }
-
-    dest[len] = '\0';
-
-    return 0;
-  }
-
-  //dodaje nowy element do tablicy WordsProb
-  int add_word_prob(Words& tab, const char* word, const char* path, unsigned len, int source);
-
-};
Index: p/src/gue/main.cc
===================================================================
--- app/src/gue/main.cc	(revision 6ac84d8bba375e6caf620f62d632c4fb07aa95d4)
+++ 	(revision )
@@ -1,237 +1,0 @@
-#include <time.h>
-#include <stdlib.h>
-#include "../lib/iotools.h"
-#define _CMDLINE_FILE "../gue/cmdline.h"
-#define CONFIGFILE1 "/home/ynka/utt/utt-0.9/conf/gue.conf"
-#define CONFIGFILE2 "/home/ynka/utt/utt-0.9/conf/gue.conf"
-#include "../common/common.h"
-#include "common_guess.h"
-#include "guess.h"
-#include "cmdline.h"
-
-#define W_SUFF 0.6
-#define W_PREF 0.4
-
-
-int main(int argc, char** argv) {
-
-  //  int non_standard_config=0;
-
-  gengetopt_args_info args;
-
-  if(cmdline_parser(argc, argv, &args) != 0)
-    exit(1);
-
-  process_config_files(&args,argv[0]);
-  process_common_options(&args,argv[0]);
-  process_guess_options(&args);
-
-  char line[MAX_LINE];
-  char outline[MAX_LINE];
-  char parms[MAX_LINE], desc[MAX_LINE], lemma[MAX_LINE];
-  long line_count = 0;
-  
-  Guess guess(dictionary);
-  int words_count=0;
-  time_t start_time = time(NULL);
-  
-  //  Segment seg;
-  Words tab;
-  while (fgets(line, MAX_LINE, inputf))
-    {
-      line_count++;
-      int start, len;
-      
-      //      line[strlen(line)-1] = '\0';
-      
-      if (!process_seg(line, args))
-	fputs(line,outputf);
-      else
-	{
-	  char form[MAX_FORM];
-	  words_count++;
-	  tab.clear();
-	  getfield(line,input_field_prefix,form);
-	  if (form==NULL) continue;//BZDURA
-	  
-	  guess.ana(form, tab);
-	  
-	  if ((tab.count()==0) && (!args.no_fail_flag)) // no guesses - analysis was unsuccessful
-	    fputs(line, failedf);
-	  else
-	    {
-
-// 	      if (copy_processed)
-// 		fputs(line, stdout);
-// 	      continue;
-// 	    }
-	  // we've got some guesses. Do we want to print it?
-// 	      if (args.only_fail_flag)
-// 	    continue;
-
-	      float last_weight=0;
-	      int i=0;
-	      int count=0;
-	      unsigned first=1;
-	      char* parms_end = parms;
-	      char last_lemma[MAX_LINE];
-
-	      count = 1;
-
-	      	      tab.sort();
-	      
-	      while (count < tab.count() && count <= guess_count)
-		if (first || tab[count].w_suf() >= cut_off && tab[count].w_suf() >= delta * last_weight)
-		  {
-		    first=0;
-		    last_weight = tab[i].w_suf();
-		    count++;
-		  }
-		else
-		  break;
-	      
-	      // drukujemy count pierwszych z tab
-
-
-	      if(one_line)
-		{
-		  char* descp=desc;
-		  for (int i=0; i< count; ++i)
-		    {
-		      descp += sprintf(descp," %s%s,%s", output_field_prefix, tab[i].lemma(), tab[i].descr());
-		      if(weights) descp += sprintf(descp,":%d",(int)tab[i].w_suf());
-		    }
-		  strcpy(outline,line);
-		  outline[strlen(outline)-1]='\0';
-		  strcat(outline,desc);
-		  strcat(outline,"\n");
-		  fputs(outline, outputf);
-		  if (copy_processed)
-		    fputs(line,outputf);
-		}
-	      else if(one_field)
-		{
-		  char* descp=desc;
-		  for (int i=0; i< count; ++i)
-		    if(i==0)
-		      {
-			descp += sprintf(descp," %s%s,%s", output_field_prefix, tab[i].lemma(), tab[i].descr());
-			if(weights) descp += sprintf(descp,":%d",(int)tab[i].w_suf());
-		      }
-		    else
-		      {
-			if(strcmp(tab[i].lemma(),tab[i-1].lemma())==0)
-			  descp += sprintf(descp,",%s",tab[i].descr());
-			else
-			  descp += sprintf(descp,";%s,%s",tab[i].lemma(),tab[i].descr());
-			if(weights) descp += sprintf(descp,":%d",(int)tab[i].w_suf());
-		      }
-		  
-		  strcpy(outline,line);
-		  outline[strlen(outline)-1]='\0';
-		  strcat(outline,desc);
-		  strcat(outline,"\n");
-		  fputs(outline, outputf);
-		  if (copy_processed)
-		    fputs(line,outputf);
-		}
-	      else
-		{
-		  for (int i=0; i< count; ++i)
-		    {
-		      // kolejne opisy - kolejne linie.
-		      char* descp=desc;
-		      descp += sprintf(desc, " %s%s,%s", output_field_prefix, tab[i].lemma(), tab[i].descr());
-		      if(weights) descp += sprintf(descp,":%d",(int)tab[i].w_suf());
-		      descp += sprintf(descp,"\n");
-		      strcpy(outline,line);
-		      outline[strlen(outline)-1]='\0';
-		      strcat(outline,desc);
-		      fputs(outline, outputf);
-		    }
-		  if (copy_processed)
-		    fputs(line,outputf);
-		}
-	    }
-	}
-      if(args.interactive_flag) 
-	fflush(outputf), fflush(failedf);
-      
-    }
-  cmdline_parser_free(&args);
-}
-
-
-
-
-
-
-
-
-// 	      while ((i=tab.next()) != -1 && count++<guess_count) {
-// 		/* if we have "one-line" flag then everything goes in one segment as many fields,
-// 		 * if we have "one-field" flag everything goes in one segment as ONE field:
-// 		 * - diferent lemmas are separated with ';', sequent descriptions to one lemma
-// 		 *   are separated with ','
-// 		 */
-// 		if ((!first) && (tab[i].w_suf() < cut_off) || (tab[i].w_suf() < delta * last_weight)) {
-// 		  break;
-// 		}
-// 		if (first) {
-// 		  parms_end += sprintf(parms_end, "%s", output_field_prefix);
-// 		} else if (!args.one_field_flag)
-// 		  parms_end += sprintf(parms_end, "%s", output_field_prefix);
-		
-// 		if (!args.one_field_flag || strcmp(last_lemma, tab[i].lemma()) != 0) {
-// 		  if (args.one_field_flag && !first)
-// 		    parms_end += sprintf(parms_end, ";");
-// 		  parms_end += sprintf(parms_end, "%s", tab[i].lemma());
-// 		  strcpy(last_lemma, tab[i].lemma());
-// 		}
-		
-// 		first=0;
-		
-// 		last_weight = tab[i].w_suf();
-// 		if (!weights)
-// 		  parms_end += sprintf(parms_end, ",%s:%d",  tab[i].descr(), (int)tab[i].w_suf());
-// 		else
-// 		  parms_end += sprintf(parms_end, ",%s", tab[i].descr());
-		
-// 		if (!args.one_field_flag) {
-// 		  seg.addfield(parms);
-// 		  parms_end = parms;
-// 		}
-		
-// 		if (!(args.one_field_flag || args.one_line_flag)) {
-// 		  seg.print(outline);
-// 		  fputs(outline, outputf);
-// 		  --seg.auxn;
-// 		}
-// 		//if (copy_processed)
-// 		//  fputs(outline, stdout);
-// 	      } //while
-	      
-// 	      if (args.one_field_flag)
-// 		seg.addfield(parms);
-	      
-// 	      if (args.one_field_flag || args.one_line_flag){
-// 		seg.print(outline);
-// 		fputs(outline, outputf);
-// 	      }
-// 	    } else { // if (process_segment)
-// 	    // jak to nie jest wyraz - to przepisz token na wyjscie.
-// 	    //      printtok(line, start, len, cat, form);
-// 	    seg.print(outline);
-// 	    fputs(outline, outputf);
-// 	    if (copy_processed)
-// 	      fputs(outline, stdout);
-// 	  }
-// 	}
-//       time_t end_time = time(NULL);
-//       if (per_info) {
-// 	printf("Liczba sÂ³Ã³w: %d\n", words_count);
-// 	printf("Czas analizy: %d sekund\n", end_time-start_time);
-//       }
-//       cmdline_parser_free(&args);
-//     }
-  
Index: p/src/kor/Makefile
===================================================================
--- app/src/kor/Makefile	(revision e28a62525995e07b8d354225ae96189c5c02a06d)
+++ 	(revision )
@@ -1,46 +1,0 @@
-PAR=-Wno-deprecated -m32 -fpermissive -static
-PAR2=-c -Wno-deprecated -m32 -fpermissive
-LIB_PATH=../lib
-COMMON_PATH=../common
-CMDLINE_FILE='"../kor/cmdline.h"'
-
-
-kor: main.cc corr.o corlist.o cmdline.o $(LIB_PATH)/word.o \
-	$(LIB_PATH)/auttools.o cmdline.c common_cor.o common.o 
-	g++ $(PAR) -D _CMDLINE_FILE=$(CMDLINE_FILE) main.cc corlist.o corr.o common.o \
-	$(LIB_PATH)/word.o $(LIB_PATH)/auttools.o cmdline.c common_cor.o \
-	-o kor
-
-corr.o: corr.cc corr.hh cmdline.h
-	g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) corr.cc
-	
-corlist.o: corlist.cc corlist.h cmdline.h
-	g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) corlist.cc
-	
-
-
-common.o: cmdline.h $(COMMON_PATH)/cmdline_common.ggo $(COMMON_PATH)/common.cc \
-	 $(COMMON_PATH)/common.h
-	g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) $(COMMON_PATH)/common.cc
-
-common_cor.o: cmdline.h common_cor.cc common_cor.h
-	g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) common_cor.cc
-
-cmdline.c cmdline.h: cmdline.ggo
-	gengetopt -i cmdline.ggo --conf-parser
-
-cmdline.ggo: cmdline_cor.ggo $(COMMON_PATH)/cmdline_common.ggo
-	cat cmdline_cor.ggo $(COMMON_PATH)/cmdline_common.ggo > cmdline.ggo
-
-copy:
-ifdef UTT_BIN_DIR
-	cp kor ${UTT_BIN_DIR}
-endif
-
-clean: clean.cmdline
-	rm *.o || true
-	rm kor || true
-
-clean.cmdline:
-	rm cmdline.* || true
-
Index: p/src/kor/cmdline_cor.ggo
===================================================================
--- app/src/kor/cmdline_cor.ggo	(revision b3179eb76e65f846cde4eec832f307990dacf31c)
+++ 	(revision )
@@ -1,13 +1,0 @@
-package "kor"
-version "0.1"
-
-option "dictionary-home"	-	"Dictionary home dir." string typestr="FILENAME" no hidden
-option "dictionary"		d	"Dictionary" string typestr="FILENAME" default="cor.bin" no
-option "distance"		D	"Maximal edit distance." int default="1" no
-option "replace"		r	"Replace original form with corrected form, place original form in the cor field. This option has no effect in single mode" flag off
-#option "single"			-	"Place all alternatives in the same line" flag off
-option "weights"		w	"File with translation rules." string typestr="FILENAME" default="weight.cor" no
-option "threshold"		t	"Edit distance threshold" float default="1" no
-option "show-scores"		-	"Show scores" flag off
-option	"count"			n	"Print only count best results" int no
-
Index: p/src/kor/common_cor.cc
===================================================================
--- app/src/kor/common_cor.cc	(revision 40358d23e569b2d0d4697a192451fff347a48e96)
+++ 	(revision )
@@ -1,48 +1,0 @@
-#include <stdlib.h>
-#include <string.h>
-#include "common_cor.h"
-
-#define MAX_PATH_LENGTH 255
-
-char dictionary[MAX_PATH_LENGTH];
-char file_weights[MAX_PATH_LENGTH];
-float threshold;
-bool show_scores = false;
-int result_count;
-
-void process_cor_options(gengetopt_args_info* args)
-{
-  if(args->dictionary_given)
-    {
-      expand_path(args->dictionary_arg,dictionary);
-      if(file_accessible(dictionary)!=0)
-	{
-	  fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary);
-	  exit(1);
-	}
-    }
-  else if (args->dictionary_home_given && args->language_given)
-    {
-      char buf[MAX_PATH_LENGTH];
-      expand_path(args->dictionary_home_arg, buf);
-      sprintf(dictionary,"%s/%s/cor.bin",buf,args->language_arg);
-      if(file_accessible(dictionary)!=0)
-	{
-	  fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary);
-	  exit(1);
-	}
-    }
-  
-  expand_path(args->weights_arg, file_weights);
-  
-  threshold = args->threshold_arg;
-
-  show_scores = args->show_scores_flag;
-
-  if(args->count_given) {
-    result_count = args->count_arg;
-  }
-  else {
-    result_count = 0;
-  }
-}
Index: p/src/kor/common_cor.h
===================================================================
--- app/src/kor/common_cor.h	(revision 13a8a67bce500a27f4c2121c096be175d5daab52)
+++ 	(revision )
@@ -1,25 +1,0 @@
-#ifndef __COMMON_COR_H
-#define __COMMON_COR_H
-
-// SEKCJA STALYCH
-
-#define MAX_LEN 2
-#define PREC 1000
-#define Weight int
-
-// SEKCJA INCLUDOW
-#include "../common/common.h"
-#include "cmdline.h"
-
-
-// SEKCJA GENGETOPT
-extern int change_count;
-extern void process_cor_options(gengetopt_args_info* args);
-extern char dictionary[];
-extern char file_weights[];
-extern float threshold;
-extern bool show_scores;
-extern int result_count;
-
-#endif
-
Index: p/src/kor/corlist.cc
===================================================================
--- app/src/kor/corlist.cc	(revision 2f8d6d8c39e7d4812bd35744328e0ed7e89e92bd)
+++ 	(revision )
@@ -1,70 +1,0 @@
-#include <stdio.h>
-#include <malloc.h>
-#include "corlist.h"
-
-#define min(x,y) ((x<y)?(x):(y))
-
-
-Weight CorList::GetValue(char X[100], char Y[100], Weight (*H2)[100], int i, int j)
-{
-  Weight R = 9999*PREC;  // (+nieskonczonosc)
-  int n;
-  
-  for (n=0; n<total; n++)
-  {
-    int la = List[n].la;
-    int lb = List[n].lb;
-    if (la<=i+1 && lb<=j+1)
-      if (strncmp(List[n].a,X+i+1-la,la)==0 && strncmp(List[n].b,Y+j+1-lb,lb)==0) 
-        R = min(R,H2[i-la][j-lb]+List[n].w);
-    if (la<=j+1 && lb<=i+1)
-      if (strncmp(List[n].b,X+i+1-lb,lb)==0 && strncmp(List[n].a,Y+j+1-la,la)==0) 
-        R = min(R,H2[i-lb][j-la]+List[n].w);
-  }
-  return R;
-}
-
-
-int CorList::loadCWL(char *Name)
-{
-  FILE *f = fopen(Name,"r");
-  int len=MAX_LEN*2+100;
-  char a[100],b[100], buf[len+1];
-  float wtmp;
-  CorWeight w;
-  
-  cor_stdcor = 1 * PREC;
-  cor_xchg   = 1 * PREC;
-  
-  List = (CorWeight*)malloc(sizeof(CorWeight));  // 100 BO NIE DZIALA REALLOC
-  total=0;
-  
-  if (!f) { fprintf(stderr,"\nCan't open correction weight list file!\n"); return -1; }
-  while (!feof(f) && fgets(buf,len,f))
-  {
-    if (buf[0]=='%')
-     {
-      sscanf(buf+1,"%s %f",&a,&wtmp);
-      int ok=0;
-      if (strcmp(a,"stdcor")==0) { ok=1; cor_stdcor=Weight(wtmp*PREC); /*printf("Standard letter correction set to: %1.2f\n",wtmp);*/ }
-      if (strcmp(a,"xchg")==0) { ok=1; cor_xchg=Weight(wtmp*PREC); /*printf("Inverted letters correction set to: %1.2f\n",wtmp);*/ }
-      if (!ok) { fprintf(stderr,"Error in file %s: Unknown keyword: '%s'.\n",Name,a); return -1; }
-     }
-    else
-     { 
-      sscanf(buf,"%s %s %f",&a,&b,&wtmp);
-      w.w=(Weight)(wtmp*PREC);
-      w.la=strlen(a); w.lb=strlen(b);
-      if (w.la>MAX_LEN) { printf("ERROR in file %s: the string '%s' exceeds maximum length of %d characters.\n",Name,a,MAX_LEN); fclose(f); return -1; }
-      if (w.lb>MAX_LEN) { printf("ERROR in file %s: the string '%s' exceeds maximum length of %d characters.\n",Name,b,MAX_LEN); fclose(f); return -1; }
-      strcpy(w.a,a), strcpy(w.b,b);
-      total++;
-      List = (CorWeight*)realloc(List,total*sizeof(CorWeight));
-      List[total-1]=w;
-      //      printf("%s\t<->\t%s\t%1.2f\n",w.a,w.b,((float)w.w/PREC));
-     }
-  }
-  fclose(f);
-  //  printf("Total: %d\n\n",total);
-  return(total);
-}
Index: p/src/kor/corlist.h
===================================================================
--- app/src/kor/corlist.h	(revision ac7d97018efb6419eb3d840b7767294d8be71ed8)
+++ 	(revision )
@@ -1,20 +1,0 @@
-#ifndef _CORLIST_H
-#define _CORLIST_H
-
-//#include <stdio.h>
-#include "common_cor.h"
-
-typedef struct { char a[MAX_LEN+1],b[MAX_LEN+1]; Weight w; short la,lb; } CorWeight;
-
-class CorList
-{
- private:
-   CorWeight *List;
-   int total;
- public:
-   Weight cor_stdcor, cor_xchg;
-   int loadCWL(char *Name);
-   Weight GetValue(char X[100], char Y[100], Weight (*H2)[100], int i, int j);
-};
-
-#endif
Index: p/src/kor/corr.cc
===================================================================
--- app/src/kor/corr.cc	(revision ac7d97018efb6419eb3d840b7767294d8be71ed8)
+++ 	(revision )
@@ -1,163 +1,0 @@
-//---------------------------------------------------------------------------
-#include "common_cor.h"
-#include "corr.hh"
-
-#define MAXPATH 256
-
-#define min(x,y) ((x<y)?(x):(y))
-#define max(x,y) ((x>y)?(x):(y))
-
-
-Weight Corr::ed(int i,int j)
-{
-  if(i==-1)
-    return (j+1)*CL.cor_stdcor;  // moje*  Nie wiem czy tak bêdzie dobrze, ale uzna³em, ¿e poza tablic¹ powinny byæ wartosci przemno¿one przez wagê standardowej zmiany litery
-  if(j==-1)
-    return (i+1)*CL.cor_stdcor;  // moje*
-  if(i==-2 || j==-2)
-    return (n+1)*CL.cor_stdcor;  // moje*
-
-  if(X[i]==Y[j])
-    return min(H2[i-1][j-1], min(CL.cor_stdcor+min(H2[i][j-1],H2[i-1][j]),CL.GetValue(X,Y,H2,i,j)));
-  if(X[i-1]==Y[j] && X[i]==Y[j-1])
-    return min(min(CL.cor_xchg+H2[i-2][j-2],CL.cor_stdcor+min(H2[i][j-1],H2[i-1][j])), CL.GetValue(X,Y,H2,i,j));
-  return min(CL.cor_stdcor+min(H2[i-1][j-1],min(H2[i][j-1],H2[i-1][j])), CL.GetValue(X,Y,H2,i,j));
-
-/*  // wersja z wagami ale dla floatów
-  if(X[i]==Y[j])//zielone->      <-      niebieskie       ->  <-      rózowe        ->
-    return min(H2[i-1][j-1], min(1+min(H2[i][j-1],H2[i-1][j]),CL.GetValue(X,Y,H2,i,j)));
-  if(X[i-1]==Y[j] && X[i]==Y[j-1])
-    return min(1+min(H2[i-2][j-2],min(H2[i][j-1],H2[i-1][j])), CL.GetValue(X,Y,H2,i,j));
-  return min(1+min(H2[i-1][j-1],min(H2[i][j-1],H2[i-1][j])), CL.GetValue(X,Y,H2,i,j));
-*/
-
-/*  // normalna wersja
-  if(X[i]==Y[j])
-    return H2[i-1][j-1];
-  if(X[i-1]==Y[j] && X[i]==Y[j-1])
-    return 1+min(H2[i-2][j-2],min(H2[i][j-1],H2[i-1][j]));
-  return 1+min(H2[i-1][j-1],min(H2[i][j-1],H2[i-1][j]));
-*/
-
-/*
-  if(X[i]==Y[j])
-    return H[(i-1)+2][(j-1)+2];
-  if(X[i-1]==Y[j] && X[i]==Y[j-1])
-    return 1+min(H[(i-2)+2][(j-2)+2],min(H[(i)+2][(j-1)+2],H[(i-1)+2][(j)+2]));
-  return 1+min(H[(i-1)+2][(j-1)+2],min(H[(i)+2][(j-1)+2],H[(i-1)+2][(j)+2]));
-*/
-}
-
-int Corr::load2(char *Name)  // moje
-{
-  return CL.loadCWL(Name);
-}
-
-Weight Corr::cuted(int j)
-{
-  int l=max(0,j-t);
-  int u=min(m,j+t);
-  Weight ce=(j+t)*PREC;   // moje*
-  for(int k=l;k<=u;k++)
-  {
-    if(H2[k][j]<ce)//if(H[(k)+2][(j)+2]<ce)
-      ce=H2[k][j];//ce=H[(k)+2][(j)+2];
-  }
-  return ce;
-}
-
-/*
-void Corr::recomputeH(int j)
-{
-  for(int i=0;i<=m;i++)
-    H[(i)+2][(j)+2]=ed(i,j);
-}
-*/
-
-void Corr::recomputeH(int j)
-{
-  int lo=max(0,j-t-2); 
-  int hi=min(m,j+t+2); 
-  for(int i=lo;i<=hi;++i)
-    H2[i][j]=ed(i,j);//H[(i)+2][(j)+2]=ed(i,j);
-}
-
-
-int Corr::correct(const char* w, Words& tab)
-{
-  long int path[MAXPATH]={0};
-  int i;                                    // row index (X)
-  int j;                                    // column index (Y)
-  long state=0;
-
-  strcpy(X,w);
-  m=strlen(X)-1;
-  n=m+t;
-
-  for(i=(-2);i<=m;i++)
-    H[(i)+2][(-2)+2]=n*PREC;  // moje *PREC
-  for(i=(-1);i<=m;i++)
-    H[(i)+2][(-1)+2]=((i)+1)*PREC; // moje*
-  for(j=(-2);j<=n;j++)
-    H[(-2)+2][(j)+2]=n*1000;  // moje*
-  for(j=(-1);j<=n;j++)
-    H[(-1)+2][(j)+2]=((j)+1)*PREC;  // moje*
-
-  for(j=0; j<=n; ++j)
-    for(i=0; i<=m; ++i)
-      H[i+2][j+2]=(t+1)*PREC;
-
-  int more=1;
-  bool cont=false;
-
-  strcpy(Y,"");
-  j=0;
-  state=0;
-  int count=0;
-  while(more)
-  {
-    if(!empty(state))
-    {
-      Y[j]=input(state);
-      recomputeH(j);
-      if(cuted(j)<=t)
-      {
-        Weight edd;  // moje 
-        if(final(next(state)) && (edd=H[(m)+2][(j)+2])<=t)
-        {
-          char* out=new char[j+2];
-          strncpy(out,Y,j+1);
-          out[j+1]='\0';
-          //          if(cont) putchar(' ');
-          cont=true;
-	  //	            printf("%1.2f %s\n", (float)edd/PREC,out);  // moje
-	  //          cout << out << "(" << edd << ")" << endl;
-		    tab.add(out,(float)edd/PREC);
-	  count++;
-        }
-        path[j++]=state;
-        state=next(state);
-        continue;
-      }
-      else
-        if(continued(state))
-        {
-          state++;
-          continue;
-        }
-    }
-    //backtracking
-    do
-      if(j>0)
-        j--;
-      else
-        more=0;
-    while(more && !continued(path[j]));
-    state=path[j]+1;
-  }
-  return count;
-}
-
-
-//---------------------------------------------------------------------------
-
Index: p/src/kor/corr.hh
===================================================================
--- app/src/kor/corr.hh	(revision ac7d97018efb6419eb3d840b7767294d8be71ed8)
+++ 	(revision )
@@ -1,39 +1,0 @@
-//---------------------------------------------------------------------------
-#ifndef _corr_hh
-#define _corr_hh
-//---------------------------------------------------------------------------
-
-#include "../lib/tfti.h"
-#include "../lib/word.h"
-#include "corlist.h"
-#include "../common/common.h"
-
-class Corr : public TFTiv<char,char>
-{
-private:
-  Weight H[100][100];
-  char X[100];                         // misspelled string
-  char Y[100];                         // (possibly partial) candidate string
-  int m;                               // length of X
-  int n;                               // maximal length of Y
-
-  Weight ed(int,int);
-  Weight cuted(int);
-  void recomputeH(int);
-
-
-public:
-  Weight (*H2)[100];   // moje: zmiana z int na Weight (float)
-  int t;                               // threshold
-  CorList CL;  // moje
-
-  Corr() : H2((Weight(*)[100])&H[2][2]) {};   // moje (int->float)
-  Corr(const char* a) : TFTiv<char,char>(a), H2((Weight(*)[100])&H[2][2]) { };
-
-  int correct(const char* w, Words& tab);
-  
-  int load2(char *Name);  // moje
-};
-
-//---------------------------------------------------------------------------
-#endif
Index: p/src/kor/main.cc
===================================================================
--- app/src/kor/main.cc	(revision b3179eb76e65f846cde4eec832f307990dacf31c)
+++ 	(revision )
@@ -1,174 +1,0 @@
-#include <stdlib.h>
-#include <ctype.h>
-#include "../lib/iotools.h"
-#include "common_cor.h"
-#include "corr.hh"
-#include <locale.h>
-
-
-int main(int argc, char** argv) {
-
-//   setlocale(LC_CTYPE,"");
-//   setlocale(LC_COLLATE,"");
-
-  gengetopt_args_info args;
-
-  if(cmdline_parser(argc, argv, &args) != 0)
-    exit(1);
-
-  process_config_files(&args,argv[0]);
-  process_common_options(&args,argv[0]);
-  process_cor_options(&args);
-
-  Corr cor;
-
-  //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-//  strcpy(dictionary,"cor.bin");
-
-  cor.load(dictionary);
-  cor.t=args.distance_arg;
-
-  //>>>>>>>>>>>>>>>
-  cor.CL.cor_stdcor=1*PREC;
-  cor.CL.cor_xchg=1*PREC;
-  if (cor.load2(file_weights)==-1) return -1;  // moje
-  cor.t=1*PREC; // ODLEGLOSC EDYCYJNA
-  //<<<<<<<<<<<<<<
-
-  char line[MAX_LINE+1];
-  long line_count = 0;
-
-  Segment seg;
-  Words tab;
-  char form1[MAX_LINE];
-  char* form;
-  int formcasing;
-  char corfield[MAX_LINE]="";
-
-  while (fgets(line, MAX_LINE, inputf))
-    {
-      ++line_count;
-      char outline[128];
-
-      if (!process_seg(line, args))
-	fputs(line, outputf);
-      else
-	{
-	  char form[MAX_FORM];
-	  
-	  tab.clear();
-	  getfield(line,input_field_prefix,form);
-	  if (form==NULL) continue;
-	  
-	  formcasing=3;
-	  cor.correct(form, tab);
-	  
-	  if( tab.count() == 0 )
-	    {
-	      formcasing=casing(form);
-	      if( formcasing == 1 || formcasing == 2)
-		tolowers(form, form1), cor.correct(form1, tab);
-	    }
-	  
-	  if ( tab.count() == 0)
-	    fputs(line, failedf);
-	  else 
-	    {
-	      	      tab.sort();
-
-		int max_cnt = 0;
-		if(result_count < 1) {
-			max_cnt = tab.count();
-		}
-		else {
-			max_cnt = (tab.count() < result_count) ? tab.count() : result_count;
-		}
-		
-	      if(args.replace_flag)
-		{
-		  char corfield[128];
-		  strcpy(corfield, input_field_prefix);
-		  strcat(corfield, form);
-		  seg.aux[seg.auxn]=corfield;
-		  ++seg.auxn;
-		  for(int i=0; i<tab.count(); ++i)
-		    {
-		      seg.form=tab[i].form();
-		      restorecasing(seg.form,seg.form,formcasing);
-		      seg.print(outline);
-		      fputs(outline, outputf);
-		    }
-		  --seg.auxn;
-		}
-	      else
-		{
-		  if(one_line)
-		    {
-		      char* p=corfield;
-		      for(int i=tab.count()-1; i >= tab.count()-max_cnt; --i)
-			{
-			  if(tab[i].w_suf() > threshold) continue;
-			  restorecasing(tab[i].form(),tab[i].form(),formcasing);
-			  p += sprintf(p," %s%s",output_field_prefix,tab[i].form());
-			  if(show_scores) {
-			    p += sprintf(p,",%1.2f",tab[i].w_suf());
-			  }
-			}
-		      sprintf(p,"\n");
-
-		      strcpy(outline,line);
-		      outline[strlen(outline)-1]='\0';
-		      strcat(outline,corfield);
-		      fputs(outline, outputf);
-		    }
-		  else if(one_field)
-		    {
-		      char* p=corfield;
-		      p += sprintf(p," %s",output_field_prefix);
-		      for(int i=tab.count()-1; i >= tab.count()-max_cnt; --i)
-			{
-			  if(tab[i].w_suf() > threshold) continue;
-			  restorecasing(tab[i].form(),tab[i].form(),formcasing);
-			  p += sprintf(p,(i==0)?"%s":";%s",tab[i].form());
-			  if(show_scores) {
-			    p += sprintf(p,",%1.2f",tab[i].w_suf());
-			  }
-			}
-		      
-		      sprintf(p,"\n");
-
-		      strcpy(outline,line);
-		      outline[strlen(outline)-1]='\0';
-		      strcat(outline,corfield);
-		      fputs(outline, outputf);
-		    }
-		  else
-		    {
-		      for(int i=tab.count()-1; i >= tab.count()-max_cnt; --i)
-			{
-			  if(tab[i].w_suf() > threshold) continue;
-			  restorecasing(tab[i].form(),tab[i].form(),formcasing);
-			  char* p = corfield;
-			  p += sprintf(p," %s%s",output_field_prefix,tab[i].form());
-			  if(show_scores) {
-				p += sprintf(p,",%1.2f",tab[i].w_suf());
-			  }
-			  p += sprintf(p, "\n");
-			  strcpy(outline,line);
-			  outline[strlen(outline)-1]='\0';
-			  strcat(outline,corfield);
-			  fputs(outline, outputf);
-			}
-		    }
-		}
-	    }
-	}
-      
-      if(args.interactive_flag)
-	{
-        fflush(outputf);
-        fflush(failedf);
-      }
-    }
-  cmdline_parser_free(&args);
-}
Index: p/src/lem/Makefile
===================================================================
--- app/src/lem/Makefile	(revision e28a62525995e07b8d354225ae96189c5c02a06d)
+++ 	(revision )
@@ -1,56 +1,0 @@
-PAR=-Wno-deprecated -m32 -O3 -fpermissive -static
-PAR2=-c -Wno-deprecated -m32 -O3 -fpermissive -static
-LIB_PATH=../lib
-COMMON_PATH=../common
-CMDLINE_FILE='"../lem/cmdline.h"'
-
-
-lem: main.cc lem.o  $(LIB_PATH)/auttools.o $(LIB_PATH)/word.o \
-      cmdline.c common_lem.o common.o symtab.o
-	g++ $(PAR) -D _CMDLINE_FILE=$(CMDLINE_FILE) \
-	main.cc lem.o $(LIB_PATH)/auttools.o \
-	$(LIB_PATH)/word.o cmdline.c common.o common_lem.o \
-	symtab.o -o lem
-
-lem.o: lem.h lem.cc
-	g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) lem.cc
-
-# alphabet.o: $(LIB_PATH)/alphabet.h $(LIB_PATH)/alphabet.cc
-# 	g++ $(PAR2) $(LIB_PATH)/alphabet.cc
-
-# auttools.o: $(LIB_PATH)/auttools.h $(LIB_PATH)/auttools.cc
-# 	g++ $(PAR2) $(LIB_PATH)/auttools.cc
-
-# word.o: $(LIB_PATH)/word.h $(LIB_PATH)/word.cc
-# 	g++ $(PAR2) $(LIB_PATH)/word.cc
-
-# erro.o: $(LIB_PATH)/erro.h $(LIB_PATH)/erro.cc
-# 	g++ $(PAR2) $(LIB_PATH)/erro.cc
-
-common.o: $(COMMON_PATH)/cmdline_common.ggo $(COMMON_PATH)/common.cc \
-	 $(COMMON_PATH)/common.h
-	g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) $(COMMON_PATH)/common.cc
-
-common_lem.o: cmdline.h common_lem.h common_lem.cc
-	g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) common_lem.cc
-
-cmdline.c cmdline.h: cmdline.ggo
-	gengetopt -i cmdline.ggo --conf-parser
-
-cmdline.ggo: cmdline_lem.ggo ../common/cmdline_common.ggo
-	cat cmdline_lem.ggo ../common/cmdline_common.ggo > cmdline.ggo
-
-symtab.o: $(LIB_PATH)/symtab.h $(LIB_PATH)/symtab.cc
-	g++ $(PAR2) $(LIB_PATH)/symtab.cc
-
-clean: clean.cmdline
-	rm *.o || true
-	rm lem || true
-
-clean.cmdline:
-	rm cmdline.* || true
-
-copy:
-ifdef UTT_BIN_DIR
-	cp lem $(UTT_BIN_DIR)
-endif
Index: p/src/lem/cmdline_lem.ggo
===================================================================
--- app/src/lem/cmdline_lem.ggo	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,5 +1,0 @@
-package "lem"
-version "0.1"
-
-option "dictionary-home"	-	"D.h." string typestr="FILENAME" hidden no
-option "dictionary"		d	"Dictionary" string typestr="FILENAME" default="lem.bin" no
Index: p/src/lem/common_lem.cc
===================================================================
--- app/src/lem/common_lem.cc	(revision 40358d23e569b2d0d4697a192451fff347a48e96)
+++ 	(revision )
@@ -1,51 +1,0 @@
-#include <stdlib.h>
-#include <string.h>
-#include "common_lem.h"
-
-char dictionary[255];
-
-void process_lem_options(gengetopt_args_info* args)
-{
-
-  if(args->dictionary_given)
-    {
-      expand_path(args->dictionary_arg,dictionary);
-      if(file_accessible(dictionary)!=0)
-	{
-	  fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary);
-	  exit(1);
-	}
-    }
-  else if (args->dictionary_home_given && args->language_given)
-    {
-      char buf[255];
-      expand_path(args->dictionary_home_arg, buf);
-      sprintf(dictionary,"%s/%s/lem.bin",buf,args->language_arg);
-      if(file_accessible(dictionary)!=0)
-	{
-	  fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary);
-	  exit(1);
-	}
-    }
-}
-
-
-// STARE
-//  if(args.dictionary_given)
-//    strcpy(dictionary, args.dictionary_arg);
-//  else {
-//     char path[256];
-//     //sprintf(path, "/etc/utt/data/%s/%s", args.locale_arg, DICT_FILE);
-//     //if (file_accessible(path) == 0)
-//     //  strcpy(dictionary, path);
-//     //else {
-//       sprintf(path, "%s/%s", utt_dir, DICT_FILE);
-//       if (file_accessible(path) == 0)
-// 	strcpy(dictionary, path);
-//       else {
-// 	fprintf(stderr, "Cannot find dictionary!\n");
-// 	exit(1);
-//       }
-//       //}
-//   }
-
Index: p/src/lem/common_lem.h
===================================================================
--- app/src/lem/common_lem.h	(revision 13a8a67bce500a27f4c2121c096be175d5daab52)
+++ 	(revision )
@@ -1,15 +1,0 @@
-#ifndef __COMMON_LEM__H
-#define __COMMON_LEM__H
-
-#include <stdio.h>
-#include "../common/common.h"
-
-#include "cmdline.h"
-
-#define DICT_FILE "lem.bin"
-
-extern char dictionary[];
-
-extern void process_lem_options(gengetopt_args_info* args);
-
-#endif
Index: p/src/lem/lem.cc
===================================================================
--- app/src/lem/lem.cc	(revision 2f8d6d8c39e7d4812bd35744328e0ed7e89e92bd)
+++ 	(revision )
@@ -1,153 +1,0 @@
-#include "lem.h"
-
-#include <stdlib.h>
-#include <assert.h>
-
-
-/* Znajduje opisy slownikowe dla wyrazu.
- * Parametry:
- * form - wyraz,
- * tab - referencja do tablicy Words (miejsce na wyniki)
- * Wartosc:
- * liczba dodanych opisow
- */
-int Lem::ana(const char* form, Words& tab) {
-
-  // sprawdzamy czy parametry wywolania sa poprawne
-  assert(form && &tab);
-  int count0 = tab.count();
-  long l;
-  if ((l=_dict.next(_dict.gtra(0, form, FT::ftMAXPATH), ';'))>=0)
-    add_to_table(tab, form, l);
-  return tab.count()-count0;
-}
-
-
-/* Szukamy opisu slownikowego nastepnego wyrazu w buforze.
- * Parametry:
- * buf - bufor
- * tab - miejsce na wyniki
- * Wartosc:
- * ilosc dodanych opisow
- */
-int Lem::pref(char* buf, Words& tab) {
-
-  // sprawdzamy czy parametry wywolania sa poprawne
-  assert(buf && &tab);
-
-  int count0 = tab.count();
-  long l;
-  char* buf0 = buf;
-
-  if((l=_dict.pref(buf, ';'))>=0) {
-    char form[MAX_FORM];
-    int len=buf-buf0;
-    form[len]='\0';
-    add_to_table(tab,form,l);
-  }
-  return tab.count() - count0;
-}
-
-/* Dodaje kolejne opisy do tablicy wynikow.
- * Parametry:
- * tab - tablica wynikow,
- * f - wyraz,
- * s - stan, na ktorym zaczyna sie pierwszy opis
- */
-void Lem::add_to_table(Words& tab, const char* f, long s) {
-
-  // sprawdzenie parametrow
-  assert(&tab);
-  assert(f);
-
-  char des[FT::ftMAXPATH];
-
-  while (_dict.cont(s, des)) {
-    char* des1;
-    if ((des1=strtok(des, ";")) != NULL)
-      do {
-	if (tab.count() >= MAX_ALT) break;
-	tab.add(f, des1);
-	des1=strtok(NULL, ";");
-      } while (des1!=NULL);
-    s=-1;
-  }
-}
-
-void Lem::prn_dict()
-{
- 
-  char des[FT::ftMAXPATH];
-
-  long s=0;
-
-  while (_dict.cont(s, des)) 
-    {
-      printf("%s\n",des);
-      s=-1;
-    }
-}
-
-
-AuxLem::AuxLem(const char* filename)
-        : Lem(), _dict(SIZE)
-{
-  FILE* f;
-  char buf[MAX_LINE+2];
-  f=fopen(filename,"r");
-  for(long i=0; i<SIZE; ++i) info[i]=(char*)NULL;
-  while(fgets(buf,MAX_LINE,f))
-  {
-    int l=strlen(buf);
-    if(l>=MAX_LINE-1) continue; // BEZ isalpha!
-    buf[l-1]='\0';
-    char* sep=strchr(buf,';');
-    if(sep==NULL) continue;
-    *sep='\0';
-    long formind=_dict.add(buf);
-    if(formind>=0)
-    {
-      char* desc=strdup(sep+1);
-      info[formind]=desc;
-    }
-    else
-      fprintf(stderr,"AuxLem: Form not added: %s;%s.\n", buf,sep+1);
-  }
-  fclose(f);
-};
-
-//---------------------------------------------------------------------------
-
-AuxLem::~AuxLem()
-{
-//  for(long i=0; i<_dict.count(); ++i)
-//    free(info[_dict.hashindex(i)]);
-  for(long i=0; i<SIZE; ++i)
-    if(info[i]) free(info[i]);
-}
-
-//---------------------------------------------------------------------------
-
-int AuxLem::ana(const char* form, Words& tab)
-{
-  if(!form) return 0;
-  int count0=tab.count();
-  char des[MAX_LINE];
-  long ind=_dict[form];
-  if(ind>=0)
-  {
-    strcpy(des,info[ind]);
-    char* des1;
-    if((des1=strtok(des,";"))!=NULL)
-      do
-      {
-        if(tab.cnt>=MAXALT) break;
-        tab.add(form,des1);
-        des1=strtok(NULL,";");
-      } while(des1!=NULL);
-  }
-  return tab.count()-count0;
-}
-
-//---------------------------------------------------------------------------
-
Index: p/src/lem/lem.h
===================================================================
--- app/src/lem/lem.h	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,50 +1,0 @@
-#include "../lib/tfti.h"
-#include "../lib/word.h"
-#include "../lib/symtab.h"
-#include "../lib/const.h"
-
-class Lem {
-
- protected:
-  //  Alphabet& _alpha;
-
-  // slownik
-  TFTiv<char,char> _dict;
-
-  void add_to_table(Words& tab, const char* f, long s);
-
- public:
-
-  Lem() {};
-  Lem(const char* d)
-    : _dict(d) {};
-  virtual int ana(const char* form, Words& tab);
-  int pref(char* form, Words& tab);
-  void prn_dict();
-
-};
-
-
-class AuxLem : public Lem {
-public:
-
-  static const int SIZE=1500000;
-  //  static const int MAXLINE=1000;
-  static const int MAXALT=256;
-
-  AuxLem(const char* filename);
-  ~AuxLem();
-
-//  int ana(const char* form, Grams& tab);
-  int ana(const char* form, Words& tab);
-
-//  operator bool() { return _dict && info; }
-
-private:
-  SymbolTable _dict;
-  char* info[SIZE];
-
-};
-
-
-
Index: p/src/lem/main.cc
===================================================================
--- app/src/lem/main.cc	(revision 0e3df7e06ad71d2e763b970d4420a4374e473cdd)
+++ 	(revision )
@@ -1,131 +1,0 @@
-#include "../lib/iotools.h"
-//do wyrzucenia - definicja w Makefile! #define _CMDLINE_FILE "../lem/cmdline.h"
-#include "../common/common.h"
-#include "common_lem.h"
-#include "lem.h"
-#include "cmdline.h"
-#include <locale.h>
-
-int main(int argc, char** argv) {
-
-//   setlocale(LC_CTYPE,""); //PO CO TO?
-//   setlocale(LC_COLLATE,""); //
-
-  gengetopt_args_info args;
-
-  if(cmdline_parser(argc, argv, &args) != 0)
-    exit(1);
-
-  process_config_files(&args,argv[0]);
-  process_common_options(&args,argv[0]);
-  process_lem_options(&args);
-  
-  char line[MAX_LINE+1];
-  char outline[MAX_LINE+1];
-  char parms[MAX_LINE+1], desc[MAX_LINE+1], lemma[MAX_LINE+1];
-  long line_count = 0;
-
-  Lem* lem;
-  
-  if(strcmp(dictionary+strlen(dictionary)-4,".bin")==0)
-    lem = new Lem(dictionary);
-  else if(strcmp(dictionary+strlen(dictionary)-4,".dic")==0)
-    lem = new AuxLem(dictionary);
-  else
-    fprintf(stderr,"lem: Invalid dictionary file extension.\n");
-
-  Words tab;
-//   Segment seg;
-
-  while (fgets(line, MAX_LINE, inputf))
-    {
-      ++line_count;
-      int start, len;
-      
-      if (!process_seg(line, args)) // TO POWINNO BYC WCZESNIEJ ZABEZPIECZONE
-	fputs(line, outputf);
-      else
-	{
-	  char form[MAX_FORM];
-
-	  tab.clear();
-	  getfield(line,input_field_prefix,form);
-	  
-	  if (form==NULL) continue;//BZDURA
-	  
-	  lem->ana(form, tab);
-	  if(tab.count()==0)
-	    {
-	      char form1[MAX_FORM]; // tymczasowo tak, trzeba zmienic ana
-	      char* p;
-	      strcpy(form1,form);
-	      for(p=form1;*p;++p) *p=tolower(*p);
-	      p=form1;
-	      lem->ana(p,tab);
-	    }
-	  
-	  if (tab.count() == 0) 
-	    fputs(line, failedf);
-	  else 
-	    { // mamy jakies opisy w slowniku
-	      
-	      if(one_line)
-		{
-		  char* descp=desc;
-		  for (int i=0; i< tab.count(); ++i)
-		    {
-		      descp += sprintf(descp," %s%s,%s", output_field_prefix, tab[i].lemma(), tab[i].descr());
-		    }
-		  strcpy(outline,line);
-		  outline[strlen(outline)-1]='\0';
-		  strcat(outline,desc);
-		  strcat(outline,"\n");
-		  fputs(outline, outputf);
-		  if (copy_processed)
-		    fputs(line,outputf);
-		}
-	      else if(one_field)
-		{
-		  char* descp=desc;
-		  for (int i=0; i< tab.count(); ++i)
-		    if(i==0)
-		      descp += sprintf(descp," %s%s,%s", output_field_prefix, tab[i].lemma(), tab[i].descr());
-		    else
-		      {
-			if(strcmp(tab[i].lemma(),tab[i-1].lemma())==0)
-			  descp += sprintf(descp,",%s",tab[i].descr());
-			else
-			  descp += sprintf(descp,";%s,%s",tab[i].lemma(),tab[i].descr());
-		      }
-		  
-		  strcpy(outline,line);
-		  outline[strlen(outline)-1]='\0';
-		  strcat(outline,desc);
-		  strcat(outline,"\n");
-		  fputs(outline, outputf);
-		  if (copy_processed)
-		    fputs(line,outputf);
-		}
-	      else
-		{
-		  for (int i=0; i< tab.count(); ++i)
-		    {
-		      // kolejne opisy - kolejne linie.
-		      sprintf(desc, " %s%s,%s\n", output_field_prefix, tab[i].lemma(), tab[i].descr());
-		      strcpy(outline,line);
-		      outline[strlen(outline)-1]='\0';
-		      strcat(outline,desc);
-		      fputs(outline, outputf);
-		    }
-		  if (copy_processed)
-		    fputs(line,outputf);
-		}
-	    } 
-	}
-      
-      if(args.interactive_flag) 
-	fflush(outputf), fflush(failedf);
-      
-    }
-  cmdline_parser_free(&args);
-}
Index: p/src/lib/Makefile
===================================================================
--- app/src/lib/Makefile	(revision 8d3e6ab33b2b6727eb54bb3498a0ba2af9ca9ea1)
+++ 	(revision )
@@ -1,21 +1,0 @@
-PAR=-Wno-deprecated -m32 -O3
-PAR2=-c -Wno-deprecated -m32 -O3 -fpermissive
-# -static
-LIB_PATH=../lib
-COMMON_PATH=../common
-
-main: auttools.o word.o copy
-
-auttools.o: auttools.h auttools.cc
-	g++ $(PAR2) auttools.cc
-
-word.o: word.h word.cc
-	g++ $(PAR2) word.cc
-
-clean:
-	rm *.o
-
-copy:
-#ifdef UTT_LIB_DIR
-#	cp -r perl $(UTT_LIB_DIR)/
-#endif
Index: p/src/lib/auttools.cc
===================================================================
--- app/src/lib/auttools.cc	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,164 +1,0 @@
-#include "auttools.h"
-//#include "/src/cpp-comm/plx/Plx.h"
-
-void fullform(const char* b, const char* d, char* f)
-{
-  int i,j=0;
-  int n1, n2=0;
-  bool g=false;
-  char s1[200], s2[200], temps[200];
-  while(d[j]>='0' && d[j]<='9')j++;
-  strncpy(temps,d,j); temps[j]='\0';
-  n1=atoi(temps);
-  i=j;
-  while(!ispunct(d[j]) || d[j]=='*') j++;
-  strncpy(s1,d+i,j-i);
-  s1[j-i]='\0';
-  if(d[j++]=='-')
-  {
-    i=j;
-    while(d[j]>='0' && d[j]<='9')j++;
-    strncpy(temps,d+i,j-i); temps[j]='\0';
-    n2=atoi(temps);
-    i=j;
-    while(!ispunct(d[j]) || d[j]=='*') j++;
-    strncpy(s2,d+i,j-i);
-    s2[j-i]='\0';
-    g=true;
-  }
-
-  int blen=strlen(b);
-  if(g)
-    if(n1+n2<=blen)
-    {
-      strcpy(f,s1);
-      strcat(f,b+n1);
-      f[strlen(f)-n2]='\0';
-      strcat(f,s2);
-    }
-    else
-      strcpy(f,"<ERR>");
-  else
-    if(n1<=blen)
-    {
-      strcpy(f,b);
-      f[strlen(f)-n1]='\0';
-      strcat(f,s1);
-    }
-    else
-      strcpy(f,"<ERR>");
-}
-
-void compose(char* stem, char* ending, char* form)
-{
-  bool suffix=true;
-  while(*stem)
-    if(*stem=='*')
-    {
-      strcpy(form,ending);
-      form+=strlen(ending);
-      suffix=false;
-      stem++;
-    }
-    else
-      *(form++)=*(stem++);
-  if(suffix)
-  {
-    strcpy(form,ending);
-    form+=strlen(ending);
-  }
-  *form='\0';
-}
-
-void autodescr(const char* f, const char* des, char* lemma, char* pos, char* attr)
-{
-  char lemd[MAXWORDLEN];
-  int o,l=strcspn(des,",");
-  strncpy(lemd,des,l);
-  lemd[l]='\0';
-  fullform(f,lemd,lemma);
-  o=l+1;
-  l=strcspn(des+o,"/:");
-  strncpy(pos,des+o,l);
-  pos[l]='\0';
-  o=o+l;
-  if(des[o]=='/')
-  {
-    o++;
-    strcpy(attr,des+o);
-  }
-  else
-    attr[0]='\0';
-}
-
-
-int common_prefix(const char* s, const char* t)
-{
-  int n=0;
-  while(*s==*t && *s!='\0')
-  { s++,t++;n++; }
-  return n;
-}
-
-int strdiff(const char* s, const char* t,
-            int& frontcut, char* prefix, int& endcut, char* suffix)
-{
-  int slen=strlen(s);
-  int tlen=strlen(t);
-  int ss, ss_max=0;                 /* ss - s shift */
-  int ts, ts_max=0;                 /* ts - t shift */
-  int common, common_max=0;
-  for(ss=0;ss<slen;ss++)
-    for(ts=0;ts<tlen;ts++)
-      if( (common=common_prefix(s+ss,t+ts))>common_max
-          && (common>4 || (ss==0 && ts==0 && common>1)) )
-      {
-        ss_max=ss;
-        ts_max=ts;
-        common_max=common;
-      }
-  //  print "--", tsmax,"\n"
-  printf("--%d\n", ts_max);
-  frontcut=ss_max;
-  strncpy(prefix,t,ts_max); prefix[ts_max]='\0';
-  endcut=slen-ss_max-common_max;
-  strcpy(suffix,t+ts_max+common_max);
-  return common_max;
-}
-
-void fprndiff(FILE* f, const char* s, const char* t)
-{
-  int frontcut,endcut;
-  char pref[MAXWORDLEN],suff[MAXWORDLEN];
-  strdiff(s,t,frontcut,pref,endcut,suff);
-  if(frontcut!=0 || pref[0]!='\0')
-    fprintf(f,"%d%s-%d%s",frontcut,pref,endcut,suff);
-  else
-    fprintf(f,"%d%s",endcut,suff);
-}
-
-void sprndiff(char* outstr, const char* s, const char* t)
-{
-  int frontcut,endcut;
-  char pref[MAXWORDLEN],suff[MAXWORDLEN];
-  strdiff(s,t,frontcut,pref,endcut,suff);
-  if(frontcut!=0 || pref[0]!='\0')
-    sprintf(outstr,"%d%s-%d%s",frontcut,pref,endcut,suff);
-  else
-    sprintf(outstr,"%d%s",endcut,suff);
-}
-
-
-void despos(const char* des, char* pos)
-{
-  int di=0;
-  int pi=0;
-  while(des[di]!=',' && des[di]!='\0') ++di;
-  if(des[di]==',')
-  {
-    ++di;
-    while(isupper(des[di])) pos[pi++]=des[di++];
-  }
-  pos[pi]='\0';
-}
-
Index: p/src/lib/auttools.h
===================================================================
--- app/src/lib/auttools.h	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,39 +1,0 @@
-
-#ifndef _Auttools_h
-#define _Auttools_h
-
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-#include <stdlib.h>
-
-/* #define ISALPHAG(c) ((c>='A' && c<='Z') || (c>='a' && c<='z') || \ */
-/*                       c=='¡' || c=='±' || c=='Æ' || c=='æ' || \ */
-/*                       c=='Ê' || c=='ê' || c=='£' || c=='³' || \ */
-/*                       c=='Ñ' || c=='ñ' || c=='Ó' || c=='ó' || \ */
-/*                       c=='Š' || c=='¶' || c=='¬' || c=='Œ' || \ */
-/*                       c=='¯' || c=='¿' || c=='*') */
-
-#define MAXWORDLEN 64
-
-extern void fullform(const char* b, const char* d,          // in
-                     char* f);                              // out
-
-extern void compose(char* stem, char* ending,               // in
-                    char* form);                            // out
-
-extern void autodescr(const char* f, const char* des,       // in
-                      char* lemma, char* pos, char* attr);  // out
-
-extern int strdiff(char* s, char* t,                        // in
-                   int& frontcut, char* prefix,             // out
-                   int& endcut, char* suffix);              // out
-
-extern void fprndiff(FILE* f, const char* s, const char* t);// in
-
-extern void sprndiff(char* outstr, const char* s, const char* t); // in
-
-extern void despos(const char* des,                           // in
-                   char* pos);                                // out
-
-#endif
Index: p/src/lib/const.h
===================================================================
--- app/src/lib/const.h	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,24 +1,0 @@
-
-
-
-// maksymalna dlugosc wyrazu
-#define  MAX_FORM 80
-
-// maksymalna dlugosc opisu
-#define MAX_DESC 80
-
-// maksymalna dlogosc lini w pliku przejsciowym
-#define MAX_LINE 1024
-
-// separator pol w pliku posrednim
-#define FIELD_SEP " \t\n"
-
-// maksymalna liczba alternatywnych opisow
-#define MAX_ALT 256
-
-// plik ze slownikiem dla guessa
-#define GUESS_DICT_FILE "slownik.fsa"
-
-// katalogi z plikami konfiguracyjnymi
-#define SYSTEM_CONFIG_DIR "/usr/local/etc/utt"
-#define USER_CONFIG_DIR "~/.utt" 
Index: p/src/lib/iotools.h
===================================================================
--- app/src/lib/iotools.h	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#include "const.h"
-#include <string.h>
-#include <stdio.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-
-// napisy zostaj na miejscu (w line), tylko wskazniki sa ustawian
-// i zara dopisywane zera s dopisywane
-
-inline
-int parsetok(char* line, int* a, int* b, char** c, char** d, char** e, char** f)
-{
-  char* field;
-  if((field=strtok(line,FIELD_SEP))!=NULL)
-    *a=atoi(field); // nie sprawdzana poprawnosc
-  else
-    return 0;
-  if((field=strtok(NULL,FIELD_SEP))!=NULL)
-    *b=atoi(field); // nie sprawdzana poprawnosc
-  else return 1;
-  if((*c=strtok(NULL,FIELD_SEP))==NULL) return 2;
-  if((*d=strtok(NULL,FIELD_SEP))==NULL) return 3;
-  if((*e=strtok(NULL,FIELD_SEP))==NULL) return 4;
-  if((*f=strtok(NULL,FIELD_SEP))==NULL) return 6;
-  return 6;
-}
-
-// napisy s kopiowane
-inline
-int scantok(const char* line, int* a, int* b, char* c, char* d, char* e=NULL, char* f=NULL)
-{
-  return sscanf(line," %d %d %s %s %s %s", a, b, c, d, e, f);
-}
-
-inline
-int printtok(char* line, int a, int b, char* c, char* d, char* e, char* f, char* parms)
-{
-  sprintf(line,"%04d %02d %s %s %s %s `%s\n", a, b, c, d, e, f, parms);
-}
-
-inline
-int printtok(char* line, int a, int b, char* c, char* d, char* e, char* f)
-{
-  sprintf(line,"%04d %02d %s %s %s %s\n", a, b, c, d, e, f);
-}
-
-inline
-int printtok(char* line, int a, int b, char* c, char* d)
-{
-  sprintf(line,"%04d %02d %s %s\n", a, b, c, d);
-}
Index: p/src/lib/matchdescr.cc
===================================================================
--- app/src/lib/matchdescr.cc	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,86 +1,0 @@
-#include <ctype.h>
-#include <stdio.h>
-
-inline
-bool inline_matchattr(const char* a, const char* b)
-{
-  const char *p, *q; // pomocnicze wskazniki
-  while(*a && *b)
-  {
-    p=a; q=b; 
-    while(isupper(*p) && isupper(*q)) // rowny prefiks
-      if(*p==*q) ++p, ++q;
-      else if(*p<*q) // a jest mniejszy
-      {
-        // przesywamy a do nastepnego atr
-        a=p;
-        while(isupper(*a)) ++a; while(islower(*a)) ++a; 
-        goto end;
-      } 
-      else
-      {
-        // przesuwamy b do nastepnego atr
-        b=q;
-        while(isupper(*b)) ++b; while(islower(*b)) ++b; 
-        goto end;
-      }
-
-    if(islower(*p) && islower(*q)) // rowne atrybuty
-    {
-      a=p; b=q; // przesuwamy wskaznik, sprawdzamy wartosci
-      while(*a != *b)
-      {
-        if(*a > *b && !islower(*++b)) return false;
-        if(*a < *b && !islower(*++a)) return false;
-      }
-      // znaleziono rowna wartosc, przesywamy a i b do nast atr
-      while(isupper(*a)) ++a; while(islower(*a)) ++a; 
-      while(isupper(*b)) ++b; while(islower(*b)) ++b;
-      goto end;
-    }
- 
-    if(islower(*p)) // a jest krotszy, czyli mniejszy
-    { // przesuwamy a do nastepnego atrybutu
-      a=p;
-      while(islower(*a)) ++a; 
-      goto end;
-    }
-
-    if(islower(*q)) // b jest krotszy, czyli mniejszy
-    { // przesuwamy b do nastepnego atrybutu
-      b=q;
-      while(islower(*b)) ++b; 
-      goto end;
-    }
-  end: ;
-  }
-  return true;
-}
-
-
-bool matchattr(const char* a, const char* b)
-{
-  return inline_matchattr(a,b);
-}
-
-bool matchdescr(const char* a, const char* b)
-{
-  while(isupper(*a) && isupper(*b) && *a==*b) ++a, ++b;
-  if(*a=='\0')
-    if(*b=='\0' || *b=='/') return true;
-    else return false;
-
-  if(*a=='/')
-    if(*b=='\0') return true;
-    else if(*b=='/') return inline_matchattr(++a, ++b);
-
-  return false;
-}
-
-
-int main()
-{
-  char a[100], b[100];
-  while(scanf("%s %s", a, b)==2)
-    printf("%s & %s = %d\n", a, b, matchdescr(a,b));
-}
Index: p/src/lib/matchdescr.h
===================================================================
--- app/src/lib/matchdescr.h	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,10 +1,0 @@
-
-// obie funkcje wymagaja by deskrypcje byly w postaci kanonicznej
-// obslugiwane sa tylko krotkie (jednoliterowe) atrybuty
-
-// test czy zgadzaja sie deskrypcje
-bool matchdescr(const char* a, const char* b);
-
-// test czy zgadaja sie same atrybuty (czyli to, co po ukosniku)
-bool matchattr(const char* a, const char* b);
-
Index: p/src/lib/symtab.cc
===================================================================
--- app/src/lib/symtab.cc	(revision 2f8d6d8c39e7d4812bd35744328e0ed7e89e92bd)
+++ 	(revision )
@@ -1,171 +1,0 @@
-#include "symtab.h"
-#include <values.h>
-#include <stdio.h>
-#include <malloc.h>
-#include <stdlib.h>
-//---------------------------------------------------------------------------
-
-SymbolTable::SymbolTable(int n, int (*h)(const char*,int), const char* filename)
-             : _mx(n), _cnt(0), hash(h)
-{
-  _sz=first(n);
-  _key=new char*[_sz];
-  _defind=new int[_sz];
-  _hashind=new int[_sz];
-  _def=new char*[_mx];
-  for(int i=0; i<_sz; i++) _key[i]=NULL;
-  if(filename)
-    add_from_file(filename);
-}
-
-//---------------------------------------------------------------------------
-
-SymbolTable::SymbolTable(int n, const char* filename)
-             : _mx(n), _cnt(0), hash(hash1)
-{
-  _sz=first(n);
-  _key=new char*[_sz];
-  _defind=new int[_sz];
-  _hashind=new int[_sz];
-  _def=new char*[_mx];
-  for(int i=0; i<_sz; ++i) _key[i]=NULL;
-  if(filename)
-    add_from_file(filename);
-}
-
-//---------------------------------------------------------------------------
-
-SymbolTable::~SymbolTable()
-{
-  clear();
-  delete[] _key;
-  delete[] _defind;
-  delete[] _hashind;
-  delete[] _def;
-}
-
-//---------------------------------------------------------------------------
-
-void SymbolTable::clear()
-{
-  for(int i=0; i<_sz; ++i)
-    if(_key[i])
-      free(_key[i]);
-}
-
-//---------------------------------------------------------------------------
-
-bool SymbolTable::add_from_file(const char* filename)
-{
-  FILE* in=fopen(filename,"r");
-  char buf[MAXKEYLEN+1];
-
-  if(in)
-    while(fscanf(in,"%s",buf)==1)
-    {
-      if(strlen(buf)==MAXKEYLEN || add(buf)<0)
-        return false;
-    }
-  return true;
-}
-
-//---------------------------------------------------------------------------
-
-int SymbolTable::add(const char* s)
-{
-  if(_cnt<_mx)
-  {
-    int ind=hash(s,_sz);
-    while(_key[ind])
-      if(strcmp(_key[ind],s))
-        ind=++ind%_sz;
-      else
-        return _defind[ind];
-    _key[ind]=strdup(s);
-    _defind[ind]=_cnt;
-    _hashind[_cnt]=ind;
-    _def[_cnt]=_key[ind];
-    _cnt++;
-    return _cnt-1;
-  }
-  else
-    return -1;
-}
-
-//---------------------------------------------------------------------------
-
-int SymbolTable::operator[](const char* s)
-{
-  int ind=hash(s,_sz);
-  while(_key[ind])
-    if(strcmp(_key[ind],s)==0)
-      return _defind[ind];
-    else
-      ind=++ind % _sz;
-  return -1;
-}
-
-//---------------------------------------------------------------------------
-
-int SymbolTable::first(unsigned int n)
-{
-  int fi=n;
-  int bound=(n/2 < MAXKEYLEN)? n/2 : MAXKEYLEN;
-  bool found;
-  do
-  {
-    found=true;
-    if(fi++ == MAXINT) return -1;
-    for(int i=2; i<bound; i++)
-      if(fi%i==0) { found=false; break; }
-  } while(!found);
-  return fi;
-}
-
-float SymbolTable::search_rate()
-{
-  long s=0;
-  for(int i=0; i<_sz; i++)
-    if(_key[i])
-      s+=(i+_sz-hash(_key[i],_sz))%_sz+1;
-  return _cnt ? (float)s/(float)_cnt : 0;
-}
-
-//---------------------------------------------------------------------------
-
-int hash1(const char* s, int _sz)
-{
-  int l=strlen(s);
-  if(l>=4)
-    return abs((*((int*)(s+(l/2-2)))+(int)(*s * s[l-1])) % _sz);
-  else
-  {
-    int i=0;
-    strcpy((char*)&i,s);
-    return abs((i+(int)(*s * s[l-1])) % _sz);
-  }
-}
-
-//---------------------------------------------------------------------------
-
-int hash2(const char* s, int _sz)
-{
-  int l=strlen(s);
-  if(l>=6)
-  {
-    unsigned int i1,i2,i3;
-    strncpy((char*)&i1,s,sizeof(int));
-    strncpy((char*)&i2,s+(l/2-2),sizeof(int));
-    strncpy((char*)&i3,s+(l-4),sizeof(int));
-    return abs((i1+i2+i3) % _sz);
-  }
-  else
-  {
-    int i=0;
-    strncpy((char*)&i,s,sizeof(int));
-    return abs((i+(int)(*s * s[l-1])) % _sz);
-  }
-}
-
-//---------------------------------------------------------------------------
-
Index: p/src/lib/symtab.h
===================================================================
--- app/src/lib/symtab.h	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,52 +1,0 @@
-#ifndef _HashTable_h
-#define _HashTable_h
-//---------------------------------------------------------------------------
-#include <stddef.h>
-#include <string.h>
-//---------------------------------------------------------------------------
-int hash1(const char* s, int sz);
-int hash2(const char* s, int sz);
-//---------------------------------------------------------------------------
-
-class SymbolTable
-{
-  int _mx;
-  int _sz;
-  int _cnt;
-  char** _key;
-  char** _def;
-  int* _defind;
-  int* _hashind;        // s¹ tu redundancje
-
-public:
-  static const unsigned int MAXKEYLEN=2000;
-
-  SymbolTable(int n, int (*h)(const char*,int), const char* filename=NULL);
-  SymbolTable(int n, const char* filename=NULL);
-  ~SymbolTable();
-
-  void clear();
-
-  int (*hash)(const char*, int);
-
-  bool add_from_file(const char* filename);
-
-  int add(const char* s);
-  int operator[](const char* s);
-  const char* operator[](int i){if(i<0||i>=_cnt)return NULL;else return _def[i];}
-  int index(const char* s) { return this->operator[](s); };
-  int index(int i) { if(i<0||i>=_cnt) return -1; else return i; };
-  int hash_index(int i) { return _hashind[i]; }
-  const char* symbol(int i) { if(i<0||i>=_cnt)return NULL; else return _def[i];}
-
-  int capacity() { return _mx; }
-  int size() { return _sz; }
-  int count() { return _cnt; }
-  float search_rate();
-
-private:
-  static int first(unsigned int n);
-};
-
-//---------------------------------------------------------------------------
-#endif
Index: p/src/lib/tft.h
===================================================================
--- app/src/lib/tft.h	(revision 2f8d6d8c39e7d4812bd35744328e0ed7e89e92bd)
+++ 	(revision )
@@ -1,881 +1,0 @@
-#ifndef _TFT_h
-#define _TFT_h
-//---------------------------------------------------------------------------
-#include <stddef.h>
-#include <iostream>
-#include <typeinfo>
-#include <string.h>
-
-#include <stdio.h>
-
-//#include "top.h"
-#include "ttrans.h"
-
-using namespace std;
-//---------------------------------------------------------------------------
-
-/// Klasa bazowa przetwornika skoñczonego.
-/**
-    \remark Po co ta klasa? Co dotyczy samych przej¶æ, przenie¶æ do TTrans,
-    resztê wcieliæ do TFT.
-*/
-class FT
-{
-public:
-  FT() : copy_default(false), print_mode(OO), ttn(0) {};
-
-//print mode
-  enum OUTPUT { II,                         ///< tylko symbole wej¶ciowe
-                OO,                         ///< tylko symbole wyj¶ciowe
-                IOIO,                       ///< symbol wyj¶ciowy po wej¶ciowym
-                OIOI,                       ///< symbol wyj¶ciowy przed wej¶ciowym
-                IIOO,                       ///< ca³e wej¶cie, potem ca³e wyj¶cie
-                OOII                        ///< ca³e wyj¶cie, potem ca³e wej¶cie
-
-              };
-
-/// maks d³ugo¶æ ¶cie¿ki
-  static const unsigned int ftMAXPATH=500;
-
-/// maks d³ugo¶æ opisu typu symbolu we/wy
-/**
-    \remark Przenie¶æ do TTrans
-*/
-  static const unsigned int ftTYPELEN=32;
-
-/// specjalny symbol dla warto¶ci 'epsilon'
-/**
-    \remark Przenie¶æ do TTrans
-*/
-  static const char ftEPSILON='~';
-
-/// specialny symbol dla warto¶ci 'default'
-/**
-    \remark Przenie¶æ do TTrans
-*/
-  static const char ftDEFAULT='@';
-
-/// domy¶lny symbol wyj¶ciowy (true-'@', flase-'~')
-/**
-    \remark Przenie¶æ do TTrans(???)
-*/
-  bool copy_default;
-
-/// tryb wyj¶cia
-  OUTPUT print_mode;
-
-/// false, je¶li automat nie ma przej¶æ
-  operator bool() { return (bool)ttn; };
-
-  virtual const char* intype() { return itype; };
-  virtual const char* outtype() { return otype; };
-
-protected:
-
-/// liczba elementów tablicy tt
-  unsigned long ttn;
-
-/// liczba stanów
-  unsigned long states;
-
-/// liczba przej¶æ
-  unsigned long transitions;
-
-/// typ symboli wej¶ciowych (napis)
-/**
-    \remark Przenie¶æ do TTrans(???)
-*/
-  char itype[ftTYPELEN];
-
-/// typ symboli wyj¶ciowych (napis)
-/**
-    \remark Przenie¶æ do TTrans(???)
-*/
-  char otype[ftTYPELEN];
-};
-
-//---------------------------------------------------------------------------
-
-/// Szablon przetwornika skoñczonego
-/**
-    \param I - typ symbolu wej¶ciowego
-    \param Ipass - typ, jaki ma byæ u¿yty przy przekazywaniu symbolu we jako parametru
-                   do funkcji (metody), równy \a I lub \a I&
-    \param O - typ symbolu wyj¶ciowego
-    \param Opass - typ, jaki ma byæ u¿yty przy przekazywaniu symbolu wy jako parametru
-                   do funkcji (metody), równy \a O lub \a O&
-    \param - typ przej¶cia, musi byæ podklas± TTrans
-*/
-template<class I, class Ipass, class O, class Opass, class TT>
-class TFT : public FT
-{
-
-
-public:
-
-  TFT() : FT(), tt(NULL) { setiotypes(); };
-
-/**
-\name Metody poziomu 1
-Poziom przej¶æ.
-*/
-
-//@{
-
-/// Test, czy przej¶cie \a t akceptuje symbol \a in.
-  bool accepts(long t, Ipass in) const;
-
-/// Test, czy lista przej¶æ dla aktualnego stanu jest kontynuowana po \a t.
-  bool continued(long t) const;
-
-/// Stan, do którego prowadzi przej¶cie \a t.
-/**
-    \pre !empty(t)
-*/
-  long next(long t) const;
-
-/// Symbol wej¶ciowy przej¶cia \a t.
-  Ipass input(long t) const;
-
-/// Symbol wyj¶ciowy przej¶cia \a t.
-  Opass output(long t) const;
-
-/// Zwraca \c true, je¶li symbolem we przej¶cia \a t jest epsilon.
-  bool epsi(long t) const;
-
-/// Zwraca \c true, je¶li symbolem we przej¶cia \a t jest symbol domy¶lny.
-  bool defi(long t) const;
-
-/// Zwraca \c true, je¶li symbolem wy przej¶cia \a t jest epsilon.
-  bool epso(long t) const;
-
-/// Zwraca \c true, je¶li symbolem wy przej¶cia \a t jest symbol domy¶lny.
-  bool defo(long t) const;
-
-/// Indeks przej¶cia przez \a in.
-  long tra(long t, Ipass in) const;
-
-/// Indeks przej¶cia przez \a in - non-deterministic.
-  long tra_nd(long t, Ipass in, long nth) const;
-
-//@}
-
-/**
-\name Poziom 2
-Poziom stanów. Stan (indeks stanu) = indeks jego pierwszego przej¶cia
-*/
-//@{
-/// Zwraca \c true je¶li stan \a s jest pusty (nie ma z niego przej¶æ).
-  bool empty(long s) const { return tt[s].empty(); }
-
-/// Zwraca \c true je¶li stan \a s jest stanem koñcowym.
-  bool final(long s) const { return tt[s].final(); }
-
-  long next(long t, Ipass in) const;
-
-//long trans(const I* si, I* so, long& olen) const;
-
-  long gtra(long s, const I* w, long maxpath=ftMAXPATH) const;
-
-//@}
-
-/**
-\name Poziom 3
-Poziom ...
-*/
-//@{
-  long cont(long s=-1, I* c=NULL) const;
-
-  long match(const I* w=NULL, long* p=NULL) const;
-
-  long match_nd(const I* w=NULL, long* p=NULL) const;
-
-  long lgstmatch(const I* w, long* p, long& plen, long maxpath=ftMAXPATH) const;
-
-  /*NOWE*/
-
-  long lgstpath(I*& buf, long*& path, long start=0) const;
-
-  long pref(I*& buf, I sep, long start=0) const;
-
-//@}
-
-protected:
-
-  TT* tt;                // tablica przej¶æ
-
-  long prn(const I* si, long* p, O* so) const;
-
-  void prntt(ostream& os);
-
-  void sort();
-
-  void setiotypes();     // NIE DZIA£A (dlaczego???)
-
-//  friend ostream& operator<<(ostream&,const CDFA&);
-//  friend istream& operator>>(istream&,CDFA&);
-
-private:
-  long prn_oo(const I* si, long* p, O* so) const;
-  long prn_ioio(const I* si, long* p, O* so) const;
-  long prn_oioi(const I* si, long* p, O* so) const;
-  long prn_iioo(const I* si, long* p, O* so) const;
-  long prn_ooii(const I* si, long* p, O* so) const;
-};
-
-
-//---------------------------------------------------------------------------
-//---------------------------------------------------------------------------
-
-/**
-    stan = indeks pierwszego przej¶cia
-
-    state(t) = stan, do którego nale¿y t
-
-    symbol zerowy = symbol s, dla którego (bool)s zwraca \c false,
-    w przypadku znaków - '\0'
-*/
-
-//---------------------------------------------------------------------------
-//---------------------------------------------------------------------------
-
-
-template <class I, class Ipass, class O, class Opass, class TT>
-inline
-bool TFT<I,Ipass,O,Opass,TT>::accepts(long t, Ipass in) const
-{ return tt[t].accepts(in); }
-
-/// Test whether the transition list continues after \a t.
-template <class I, class Ipass, class O, class Opass, class TT>
-inline
-bool TFT<I,Ipass,O,Opass,TT>::continued(long t) const
-{ return tt[t].continued(); }
-
-/**
-    \pre !empty(t)
-*/
-template <class I, class Ipass, class O, class Opass, class TT>
-inline
-long TFT<I,Ipass,O,Opass,TT>::next(long t) const
-{ return tt[t].next(); }
-
-template <class I, class Ipass, class O, class Opass, class TT>
-inline
-Ipass TFT<I,Ipass,O,Opass,TT>::input(long t) const
-{ return tt[t].in(); }
-
-template <class I, class Ipass, class O, class Opass, class TT>
-inline
-Opass TFT<I,Ipass,O,Opass,TT>::output(long t) const
-{ return tt[t].out(); }
-
-template <class I, class Ipass, class O, class Opass, class TT>
-inline
-bool TFT<I,Ipass,O,Opass,TT>::epsi(long t) const
-{ return tt[t].epsi(); }
-
-template <class I, class Ipass, class O, class Opass, class TT>
-inline
-bool TFT<I,Ipass,O,Opass,TT>::defi(long t) const
-{ return tt[t].defi(); }
-
-template <class I, class Ipass, class O, class Opass, class TT>
-inline
-bool TFT<I,Ipass,O,Opass,TT>::epso(long t) const
-{ return tt[t].epso(); }
-
-template <class I, class Ipass, class O, class Opass, class TT>
-inline
-bool TFT<I,Ipass,O,Opass,TT>::defo(long t) const
-{ return tt[t].defo(); }
-
-/**
-    \param +t - indeks przej¶cia
-    \param +in - symbol we
-    \return Indeks przj¶cia (>=\a t) dla bie¿±cego stanu, które
-    akceptuje symbol we \a in lub -1, je¶li nie ma takiego przej¶cia
-*/
-template <class I, class Ipass, class O, class Opass, class TT>
-long TFT<I,Ipass,O,Opass,TT>::tra(long t, Ipass in) const
-{
-  if(t<0 || t>=ttn)
-    return -1;
-
-  if(empty(t)) return -1;
-  while(!accepts(t,in))
-    if(continued(t))
-      t++;
-    else
-      return -1;
-  return t;
-}
-
-//---------------------------------------------------------------------------
-/// Indeks przej¶cia - wersja dla automatu niedeterministycznego.
-/**
-    \param +t  - indeks przej¶cia
-    \param +in - symbol we
-    \return Indeks przj¶cia (>=\a t) dla bie¿±cego stanu, które
-    akceptuje symbol we \a in lub -1, je¶li nie ma takiego przej¶cia
-    Je¶li nth==0, t1>=t, w przeciwnym razie t1>t.
-*/
-template <class I, class Ipass, class O, class Opass, class TT>
-long TFT<I,Ipass,O,Opass,TT>::tra_nd(long t, Ipass in, long nth) const
-{
-  if(t<0 || t>=ttn)
-    return -1;
-
-  if(nth)
-    if(continued(t))
-      t++;
-    else
-      return -1;
-  else
-  { if(empty(t)) return -1; }
-
-  while(!accepts(t,in))
-    if(continued(t))
-      t++;
-    else
-      return -1;
-
-  return t;
-}
-
-//}
-
-//---------------------------------------------------------------------------
-//----------------------------------------------------------------------------
-
-
-/// Funkcja przej¶cia.
-/**
-    \param t - stan
-    \param in - symbol we
-    \return Stan, do którego mo¿na przej¶æ z \a t po wp³ywem symbolu \a in
-    lub -1, je¶li nie ma przej¶cia przez \a in
-
-*/
-template <class I, class Ipass, class O, class Opass, class TT>
-long TFT<I,Ipass,O,Opass,TT>::next(long t, Ipass in) const
-{
-  if(t<0 || (unsigned long)t>=ttn)
-    return -1;
-
-  if(empty(t)) return -1;
-  while(!accepts(t,in))
-    if(continued(t))
-      t++;
-    else {
-      return -1;
-    }
-
-  return next(t);
-}
-
-//---------------------------------------------------------------------------
-
-//----------------------------------------------------------------------------
-/// Uogólniona funkcja przejscia.
-/**
-    \param +s - stan
-    \param +w - wskaŒnik pierwszego elementu ci±gu symboli we, zakoñczonego symbolem zerowym
-    \param maxpath maksymalna d³ugo¶æ ¶cie¿ki, domy¶lnie ftMAXPATH
-    \return stan osi±galny z \a s pod wp³ywem \a w (na ¶cie¿ce mog± siê pojawiæ
-    epsilon-przej¶cia
-*/
-template <class I, class Ipass, class O, class Opass, class TT>
-long TFT<I,Ipass,O,Opass,TT>::gtra(long s, const I* w, long maxpath) const
-{
-  if(s<0 || (unsigned long)s>=ttn)
-    return -1;
-
-  long i=0;
-  while(*w)
-  {
-    if(i>maxpath || empty(s)) return -1;
-    while(!accepts(s,*w))
-      if(continued(s))
-        s++;
-      else
-        return -1;
-    if(!epsi(s)) w++;
-    s=next(s);
-    i++;
-  }
-  return s;
-}
-
-//----------------------------------------------------------------------------
-
-/// Kontynuacja.
-/**
-...
-\param +s stan, je¶li -1 - poszukiwane jest nastêpne rozwi±zanie
-\param -c ci±g symboli we ze ¶cie¿ki prowadz±cej z \a s do
-       stanu koñcowego
-\return d³ugo¶æ ci±gu \a c (= d³ugo¶æ ¶cie¿ki)
-\remark DZIA£A TYLKO DLA ZNAKÓW!!!
-        EPSILON-PRZEJŠCIA NIEDOZWOLONE!!!
-*/
-template <class I, class Ipass, class O, class Opass, class TT>
-long TFT<I,Ipass,O,Opass,TT>::cont(long s, I* c) const
-{
-  static unsigned long path[ftMAXPATH]={0};
-  static unsigned long  i=0;
-  static bool more=false;
-
-  bool found=false;
-
-  if(s!=-1)
-  {
-    if(s<0 || (unsigned long)s>=ttn)
-      more=false;
-    else
-    {
-      i=0;
-      c[0]=0;
-      path[0]=s;
-      more=true;
-      if(final(s))
-        found=true;
-    }
-  }
-
-  while(more && !found)
-  {
-    if(!empty(path[i]) && i<ftMAXPATH)
-    {
-      path[i+1]=next(path[i]);
-      c[i]=input(path[i]);
-      i++;
-    }
-    else
-    {
-      do
-      {
-        if(i>0)
-          c[--i]=0;
-        else
-          more=false;
-      }while(more && !continued(path[i]));
-      path[i]=path[i]+1;
-    }
-    if(final(path[i]))
-    {
-      found=true;
-      c[i]=0;
-    }
-  }
-  return i;
-}
-
-//----------------------------------------------------------------------------
-/// Dopasowannie.
-/**
-    \remark Nie zaimplementowane.
-*/
-template <class I, class Ipass, class O, class Opass, class TT>
-long TFT<I,Ipass,O,Opass,TT>::match(const I* w, long* p) const
-{}
-
-//----------------------------------------------------------------------------
-/// Dopasowanie niedeterministyczne.
-/**
-    \param +w - wskaŒnik pierwszego elementu ci±gu symboli we, zakoñczonego symbolem zerowym,
-    je¶li NULL - poszukiwane jest nastêpne rozwi±zanie
-    \param -p ci±g przej¶æ zakoñczony -1
-    \return d³ugo¶æ dopasowania (PO CO?)
-*/
-template <class I, class Ipass, class O, class Opass, class TT>
-long TFT<I,Ipass,O,Opass,TT>::match_nd(const I* w, long* p) const
-{
-  static bool more=false;
-  static I *w0, *wc;
-  static long s=0, *p0, *pc, *pc_bound;
-
-  bool found=false;
-
-  if(w)
-  {
-    wc=w0=w;
-    pc=p0=p;
-    more=true;
-    pc_bound=pc+ftMAXPATH;
-    if(final(s=0))
-    {
-      *pc=-1; return 0;
-    }
-  }
-
-  while(more)
-  {
-    if(*wc && pc<pc_bound && (*pc=trand(s,*wc,0))>=0)
-    { if(!epsi(*pc)) wc++; s=next(*pc); pc++; }
-    else
-      while(true)
-      {
-        if(pc==p0) { more=false; return -1; }
-        if(!epsi(*(--pc))) wc--;
-        if((*pc=trand(*pc,*wc,1))>=0)
-        { if(!epsi(*pc)) wc++; s=next(*pc); pc++; break; }
-      }
-    if(final(s)) { *pc=-1; return wc-w0; }
-  }
-  return -1;
-}
-
-//----------------------------------------------------------------------------
-/// Najd³u¿sze dopasowanie.
-/**
-    \param +w wskaŒnik pierwszego elementu ci±gu symboli wej¶ciowych
-    \param -p ¶cie¿ka
-    \param -plen d³ugo¶æ ¶cie¿ki
-    \param +maxpath maks dd³ugo¶æ ¶cie¿ki, domy¶lnie FT::ftMAXPATH
-    \return d³ugo¶æ skonsumowanego wej¶cia
-*/
-template <class I, class Ipass, class O, class Opass, class TT>
-long TFT<I,Ipass,O,Opass,TT>
-        ::lgstmatch(const I* w, long* p, long& plen, long maxpath) const
-{
-  long s=0;
-  long t;
-  long i=0;
-  const char* w0=w;
-  long ilen=0;
-  while(*w && i<maxpath && (t=tra(s,*w))>=0)
-  {
-    if(!epsi(t)) w++;
-    s=next(t);
-    i++;
-    *(p++)=t;
-    if(final(s)) { plen=i; ilen=w-w0; }
-  }
-  *p=-1;
-  return ilen;
-}
-
-//----------------------------------------------------------------------------
-/// Najd³u¿sza ¶cie¿ka.
-/**
-    \param +buf  wskaŒnik pierwszego elementu ci±gu symboli wej¶ciowych
-    \param -buf  pozycja jeden za skonsumowanym prefiksem
-    \param +path wskaŒnik pierwszego elementu wektora przej¶æ
-    \param -path wskaŒnik jeden za ostatnim przej¶ciem
-    \return d³ugo¶æ skonsumowanego prefiksu (PO CO? LEPIEJ D£ ŠCIE¯KI)
-*/
-template <class I, class Ipass, class O, class Opass, class TT>
-long TFT<I,Ipass,O,Opass,TT>
-        ::lgstpath(I*& buf, long*& path, long start) const
-{
-  long s=start;
-  long t;
-  const char* buf0=buf;
-  const long* pathlimit=path+FT::ftMAXPATH;
-  while(*buf && path<pathlimit && (t=tra(s,*buf))>=0)
-  {
-    if(!epsi(t)) buf++;
-    s=next(t);
-    *(path++)=t;
-  }
-  return buf-buf0;
-}
-
-//----------------------------------------------------------------------------
-/// Najd³u¿szy prefiks.
-/**
-    \param +buf  wskaŒnik pierwszego elementu ci±gu symboli wej¶ciowych
-    \param -buf  pozycja jeden za skonsumowanym prefiksem
-    \param +sep  separator
-    \return stan po przej¶ciu przez \a sep
-    \remark Dzia³a tylko dla automatów deterministycznych, minimalnych, eps-wolnych,
-              gdzie d³. ¶cie¿ki == d³. dopasowania.
-*/
-template <class I, class Ipass, class O, class Opass, class TT>
-long TFT<I,Ipass,O,Opass,TT>
-        ::pref(I*& buf, I sep, long start) const
-{
-  static long pathtab[ftMAXPATH];
-  //  static long* path=pathtab;	
-  long* path=pathtab;
-  static bool more;
-
-  long s;
-  if(*buf)                     // pierwsze wywo³anie
-  {
-    if(!lgstpath(buf,path,start))
-      return -1;
-    --path;
-    more=true;
-  }
-  else                         // kolejne  wywo³anie
-    --buf,--path;
-  while(more)
-    if(path>=pathtab)
-      if((s=next(next(*path),sep))>=0) {
-        return s;
-      }
-      else
-        --buf, --path;
-    else
-    {
-      more=false;
-      return -1;
-    }
-  return -1;
-}
-
-//----------------------------------------------------------------------------
-
-/*
-template <class I, class Ipass, class O, class Opass, class TT>
-long TFT<I,Ipass,O,Opass,TT>::trans(const I* si, O* so, long& olen) const
-{
-  long p[ftMAXPATH];
-  long ilen;
-  long plen;
-  if((ilen=lgstmatch(si,p,plen))>0)
-    olen=prn(si,p,so);
-  else
-    ilen=olen=0;
-  return ilen;
-}
-*/
-//----------------------------------------------------------------------------
-
-template <class I, class Ipass, class O, class Opass, class TT>
-long TFT<I,Ipass,O,Opass,TT>::prn(const I* si, long* p, O* so) const
-{
-  switch(print_mode)
-  {
-    case OO: return prn_oo(si,p,so);
-    case IOIO: return prn_ioio(si,p,so);
-    case OIOI: return prn_oioi(si,p,so);
-    case IIOO: return prn_iioo(si,p,so);
-    case OOII: return prn_ooii(si,p,so);
-  }
-}
-
-//----------------------------------------------------------------------------
-
-template <class I, class Ipass, class O, class Opass, class TT>
-long TFT<I,Ipass,O,Opass,TT>::prn_oo(const I* si, long* p, O* so) const
-{
-  char* so0=so;
-  while(*p>=0)
-  {
-    long t=*p;
-    if(!epso(t))
-    {
-      if(defo(t))
-        *(so++)=*si;
-      else
-        *(so++)=output(t);
-    }
-    if(!epsi(t)) si++;
-    p++;
-
-  }
-  return so-so0;
-}
-
-//----------------------------------------------------------------------------
-
-
-template <class I, class Ipass, class O, class Opass, class TT>
-long TFT<I,Ipass,O,Opass,TT>::prn_ioio(const I* si, long* p, O* so) const
-{
-  char* so0=so;
-  while(*p>=0)
-  {
-    long t=*p;
-    if(!epsi(t))
-      *(so++)=*si;
-    if(!epso(t))
-      if(defo(t))
-        *(so++)=*si;
-      else
-        *(so++)=output(t);
-    if(!epsi(t)) si++;
-    p++;
-  }
-  return so-so0;
-}
-
-
-//----------------------------------------------------------------------------
-
-template <class I, class Ipass, class O, class Opass, class TT>
-long TFT<I,Ipass,O,Opass,TT>::prn_oioi(const I* si, long* p, O* so) const
-{
-  char* so0=so;
-  while(*p>=0)
-  {
-    long t=*p;
-    if(!epso(t))
-    {
-      if(defo(t))
-        *(so++)=*si;
-      else
-        *(so++)=output(t);
-    }
-    if(!epsi(t))
-      *(so++)=*(si++);
-    p++;
-  }
-  return so-so0;
-}
-
-//----------------------------------------------------------------------------
-
-template <class I, class Ipass, class O, class Opass, class TT>
-long TFT<I,Ipass,O,Opass,TT>::prn_iioo(const I* si, long* p, O* so) const
-{
-  const char* si0=si;
-  long* p0=p;
-  char* so0=so;
-  while(*p>=0)
-  {
-    long t=*p;
-    if(!epsi(t))
-    {
-      *(so++)=*si;
-      si++;
-    }
-    p++;
-  }
-  si=si0;
-  p=p0;
-  while(*p>=0)
-  {
-    long t=*p;
-    if(!epso(t))
-      if(defo(t))
-        *(so++)=*si;
-      else
-        *(so++)=output(t);
-    if(!epsi(t)) si++;
-    p++;
-  }
-  return so-so0;
-}
-
-//----------------------------------------------------------------------------
-
-template <class I, class Ipass, class O, class Opass, class TT>
-long TFT<I,Ipass,O,Opass,TT>::prn_ooii(const I* si, long* p, O* so) const
-{
-
-  const char* si0=si;
-  long* p0=p;
-  char* so0=so;
-  while(*p>=0)
-  {
-    long t=*p;
-    if(!epso(t))
-    {
-      if(defo(t))
-        *(so++)=*si;
-      else
-        *(so++)=output(t);
-    }
-    if(!epsi(t)) si++;
-    p++;
-  }
-  si=si0;
-  p=p0;
-  while(*p>=0)
-  {
-    long t=*p;
-    if(!epsi(t))
-      *(so++)=*(si++);
-    p++;
-  }
-  return so-so0;
-}
-
-//---------------------------------------------------------------------------
-
-template<class I, class Ipass, class O, class Opass, class TT>
-void TFT<I,Ipass,O,Opass,TT>::sort()
-{
-  long t=0;
-  while(t<ttn)
-  {
-    long t0=t;
-    long tn=1;
-    while(continued(t++)) tn++;
-    if(tn>1)
-    {
-      long eps=-1;
-      long def=-1;
-      for(int i=0; i<tn; i++)
-      {
-        if(defi(t0+i))
-          if(epsi(t0+i)) eps=i; else def=i;
-      }
-      if(eps>=0 && eps<tn-1)
-      {
-        TT temp=tt[t0+eps];
-        memmove(tt+t0+eps+1,tt+t0+eps,tn-eps-1);
-        tt[t-1]=temp;
-      }
-      if(def>eps) def--;
-      if(def>=0 && def<tn-1)
-      {
-        TT temp=tt[t0+def];
-        if(eps>=0)
-        {
-          memmove(tt+t0+def+1,tt+t0+def,tn-eps-2);
-          tt[t-2]=temp;
-        }
-        else
-        {
-          memmove(tt+t0+def+1,tt+t0+def,tn-eps-2);
-          tt[t-1]=temp;
-        }
-      }
-      while(t0<t-1)
-        tt[t0++].continued(true);
-      tt[t-1].continued(false);
-    }
-  }
-}
-
-//---------------------------------------------------------------------------
-
-template <class I, class Ipass, class O, class Opass, class TT>
-void TFT<I,Ipass,O,Opass,TT>::setiotypes()
-{
-  int i=0;
-  const char* it=typeid(I).name();
-  while(*it)
-    if(*it==' ')
-    { it++; continue; }
-    else
-      itype[i++]=*(it++);
-  itype[i]='\0';
-
-  i=0;
-  const char* ot=typeid(O).name();
-  while(*ot)
-    if(*ot==' ')
-    { ot++; continue; }
-    else
-      otype[i++]=*(ot++);
-  otype[i]='\0';
-};
-
-//---------------------------------------------------------------------------
-
-template <class I, class Ipass, class O, class Opass, class TT>
-void TFT<I,Ipass,O,Opass,TT>::prntt(ostream& os)
-{
-  for(long i=0; i<ttn; ++i)
-  {
-    os << i << ':';
-    os << tt[i];
-  }
-}
-
-#endif
Index: p/src/lib/tfti.h
===================================================================
--- app/src/lib/tfti.h	(revision 2f8d6d8c39e7d4812bd35744328e0ed7e89e92bd)
+++ 	(revision )
@@ -1,527 +1,0 @@
-#ifndef TFTiH
-#define TFTiH
-//---------------------------------------------------------------------------
-#include <fstream>
-#include <math.h>
-#include <iomanip>
-//#include <typeinfo.h>
-
-#include "tft.h"
-//---------------------------------------------------------------------------
-
-
-using namespace std;
-
-
-template<class I, class Ipass, class O, class Opass>
-class TFTi : public TFT<I,Ipass,O,Opass,TTrans_i<I,Ipass,O,Opass> >
-{
-public:
-  TFTi() : TFT<I,Ipass,O,Opass,TTrans_i<I,Ipass,O,Opass> >() {};
-  TFTi(const char* filename)
-  : TFT<I,Ipass,O,Opass,TTrans_i<I,Ipass,O,Opass> >() { load(filename); };
-
-  void read(const char* filename);
-  void read(istream& is=cin);
-  void write(const char* filename);
-  void write(ostream& os=cout);
-  void load(const char* filename);
-  void load(FILE* f=stdin);
-  void save(const char* filename);
-  void save(FILE* f=stdout);
-  void clear();
-  using TFT<I,Ipass,O,Opass,TTrans_i<I,Ipass,O,Opass> >::ttn;
-  using TFT<I,Ipass,O,Opass,TTrans_i<I,Ipass,O,Opass> >::states;
-  using TFT<I,Ipass,O,Opass,TTrans_i<I,Ipass,O,Opass> >::transitions;
-  using TFT<I,Ipass,O,Opass,TTrans_i<I,Ipass,O,Opass> >::itype;
-  using TFT<I,Ipass,O,Opass,TTrans_i<I,Ipass,O,Opass> >::ftTYPELEN;
-  using TFT<I,Ipass,O,Opass,TTrans_i<I,Ipass,O,Opass> >::otype;
-  using TFT<I,Ipass,O,Opass,TTrans_i<I,Ipass,O,Opass> >::tt;
-  using TFT<I,Ipass,O,Opass,TTrans_i<I,Ipass,O,Opass> >::copy_default;
-  using TFT<I,Ipass,O,Opass,TTrans_i<I,Ipass,O,Opass> >::print_mode;
-
-
-//  friend istream& operator>>(istream&, TFTi<I,Ipass,O,Opass>&);
-//  friend ostream& operator<<(ostream&, const TFTi<I,Ipass,O,Opass>&);
-};
-
-//---------------------------------------------------------------------------
-
-template<class I, class Ipass, class O, class Opass>
-void TFTi<I,Ipass,O,Opass>::read(const char* filename)
-{
-  ifstream is(filename);
-  if(!is) { fprintf(stderr,"Failed to open input file."); exit(1); }
-  read(is);
-}
-
-template<class I, class Ipass, class O, class Opass>
-void TFTi<I,Ipass,O,Opass>::read(istream& is)
-{
-  long *si;                             // state-index relation
-  long ci=0;                            // current index
-  char ch;                              // character read;
-  int empty=0;                          // no of states with 0 trans?
-  char intype[FT::ftTYPELEN];
-  char outtype[FT::ftTYPELEN];
-
-  clear();
-
-  is >> states >> transitions >> intype >> outtype;
-
-//  if(strcmp(intype,itype)!=0 ||
-//     strcmp(outtype,otype)!=0 && strcmp(outtype,"void")!=0)
-//    { is.clear(ios::badbit); goto end; };
-
-  while(is.peek()==' ' || is.peek()=='\t') is.get(ch);
-  while(is.peek()!='\n')
-  {
-    char s[20];
-    is >> s;
-    if(strcmp(s,"COPY")==0 && strcmp(intype,outtype)==0) copy_default=true;
-    else if(strcmp(s,"NOCOPY")==0) copy_default=false;
-    else if(strcmp(s,"II")==0) print_mode=FT::II;
-    else if(strcmp(s,"OO")==0) print_mode=FT::OO;
-    else if(strcmp(s,"IOIO")==0) print_mode=FT::IOIO;
-    else if(strcmp(s,"OIOI")==0) print_mode=FT::OIOI;
-    else if(strcmp(s,"IIOO")==0) print_mode=FT::IIOO;
-    else if(strcmp(s,"OIOI")==0) print_mode=FT::OIOI;
-    while(is.peek()==' ' || is.peek()=='\t') is.get(ch);
-  }
-
-  ttn=transitions+2;      // 1 state without trans., 1 additional
-  si=new long[states];
-  tt=new TTrans_i<I,Ipass,O,Opass>[ttn];
-
-  for(long cs=0;cs<states;cs++)
-  {
-    long tc;                             // transition counter
-    si[cs]=ci;
-    long cscheck;
-
-    if(!is) goto end;
-    while(is.peek()==' ' || is.peek()=='\t') is.get(ch);
-    is >> cscheck;
-    if(cs!=cscheck) goto end;
-
-    while(is.peek()==' ' || is.peek()=='\t') is.get(ch);
-
-    is.get(ch);
-    if(!is) goto end;
-    switch(ch)
-    {
-      case '-': tt[ci].final(false); break;
-      case '+': tt[ci].final(true); break;
-      default: goto end;
-    }
-    tc=0, tt[ci].continued(false);
-
-    while(is.peek()==' ' || is.peek()=='\t') is.get(ch);
-    while(is && is.peek()!='\n')
-    {
-      switch(is.peek())
-      {
-        case '~': tt[ci].epsi(true); tt[ci].defi(true); is.get(ch);
-                  break;
-        case '@': tt[ci].epsi(false); tt[ci].defi(true); is.get(ch);
-                  break;
-        default : tt[ci].geti(is);
-      }
-      if(!is) goto end;
-      if(is.peek()=='/')
-      {
-        is.get(ch);
-        switch(is.peek())
-        {
-          case '~': tt[ci].epso(true); tt[ci].defo(true); is.get(ch);
-                    break;
-          case '@': tt[ci].epso(false); tt[ci].defo(true); is.get(ch);
-                    break;
-          default : tt[ci].geto(is);
-        }
-      }
-      else
-      {
-        tt[ci].defo(true);
-        if(copy_default) tt[ci].epso(false); else tt[ci].epso(true);
-      }
-      if(!is) goto end;
-
-      unsigned long transition;
-      is >> transition;
-      tt[ci].next(transition);
-
-      tt[ci].continued(false);
-      tt[ci].empty(false);
-
-      if(tc>0) tt[ci-1].continued(true);
-      tc++,ci++;
-    }
-    if(tc==0)
-    {
-      if(++empty>2) { fprintf(stderr, "Nondeterministic automaton."); exit(1); }
-      tt[ci].empty(true);
-      ci++;
-    }
-    is.get(ch);
-    if(ch!='\n') { is.clear(ios::badbit); goto end; }
-  }
-
-  ttn=transitions+empty;
-  if(ttn!=ci) { is.clear(ios::badbit); goto end; };
-  for(long i=0;i<ttn;i++)
-    tt[i].next(si[tt[i].next()]);
-  delete[] si;
-  sort();
-
-end:
-  if(is.bad()) { fprintf(stderr,"Input error."); exit(1); }
-}
-
-//---------------------------------------------------------------------------
-
-template<class I, class Ipass, class O, class Opass>
-void TFTi<I,Ipass,O,Opass>::write(const char* filename)
-{
-  ofstream os(filename);
-  if(!os) err("Failed to open output file.");
-  write(os);
-}
-
-template<class I, class Ipass, class O, class Opass>
-void TFTi<I,Ipass,O,Opass>::write(ostream& os)
-{
-  os << states << ' ' << transitions << ' ';
-//  os << itype << ' ' << otype << ' ';
-  os << "char void";
-//  os << (copy_default ? "COPY" : "NOCOPY") << ' ';
-//  switch(print_mode)
-//  {
-//    case FT::II  : os << "II"; break;
-//    case FT::OO  : os << "OO"; break;
-//    case FT::IOIO: os << "IOIO"; break;
-//    case FT::OIOI: os << "OIOI"; break;
-//    case FT::IIOO: os << "IIOO"; break;
-//    case FT::OOII: os << "OOII";
-//  }
-  os << '\n';
-
-  long* si=new long[ttn];
-  long cs=0;
-  for(long i=0;i<ttn;i++)
-  {
-    si[i]=cs;
-    if(continued(i)==false) cs++;
-  }
-
-  int statefieldwidth=log10(cs+1);
-
-  bool first=true;
-  for(long i=0;i<ttn;i++)
-  {
-    if(first)
-    {
-      os << setw(statefieldwidth) << si[i] << " ";
-      if(final(i)) os << '+'; else os << '-';
-    }
-
-
-    if(!empty(i))
-    {
-      os << ' ';
-      if(epsi(i))
-        os << FT::ftEPSILON;
-      else
-      if(defi(i))
-        os << FT::ftDEFAULT;
-      else
-        os << input(i);
-
-      if(epso(i))
-      { if(copy_default) os << '/' << FT::ftEPSILON; }
-      else
-      if(defo(i))
-      { if(!copy_default) os << '/' << FT::ftDEFAULT; }
-      else
-      { os << '/' << output(i); }
-
-      if(strcmp(itype,"char")!=0 || strcmp(otype,"char")!=0)
-        os << ' ';
-      os << si[next(i)];
-    }
-    if(continued(i))
-      first=false;
-    else
-    { os << '\n'; first=true; }
-  }
-}
-
-//---------------------------------------------------------------------------
-
-template<class I, class Ipass, class O, class Opass>
-void TFTi<I,Ipass,O,Opass>::load(const char* filename)
-{
-  FILE* f;
-  if(*filename)
-    f=fopen(filename,"rb");
-  else
-    f=stdin;
-  if(!f) { fprintf(stderr, "Cannot open automaton file."); return; }
-  load(f);
-}
-
-template<class I, class Ipass, class O, class Opass>
-void TFTi<I,Ipass,O,Opass>::load(FILE* f)
-{
-
-  clear();
-
-  if(fread(&ttn,sizeof(ttn),1,f)!=1) { fprintf(stderr, "Binary input error."); return;}
-  if(fread(&states,sizeof(states),1,f)!=1) { fprintf(stderr, "Binary input error."); return;}
-  if(fread(&transitions,sizeof(transitions),1,f)!=1) { fprintf(stderr, "Binary input error."); return;}
-  if(fread(itype,sizeof(char),ftTYPELEN,f)!=ftTYPELEN) { fprintf(stderr, "Binary input error."); return;}
-  if(fread(otype,sizeof(char),ftTYPELEN,f)!=ftTYPELEN) { fprintf(stderr, "Binary input error."); return;}
-  if(fread(&copy_default,sizeof(copy_default),1,f)!=1) { fprintf(stderr, "Binary input error."); return;}
-  if(fread(&print_mode,sizeof(print_mode),1,f)!=1) { fprintf(stderr, "Binary input error."); return;}
-  if((tt=new TTrans_i<I,Ipass,O,Opass>[ttn])==NULL) { fprintf(stderr, "Cannot allocate memory for tt."); return;}
-  if(fread(tt,sizeof(TTrans_i<I,Ipass,O,Opass>),ttn,f)!=ttn) { fprintf(stderr, "Binary input error."); return; }
-  fclose(f);
-
-
-}
-
-//---------------------------------------------------------------------------
-
-template<class I, class Ipass, class O, class Opass>
-void TFTi<I,Ipass,O,Opass>::save(const char* filename)
-{
-  FILE* f;
-  if(*filename)
-    f=fopen(filename,"wb");
-  else
-    f=stdout;
-  if(!f) err("Cannot open file.");
-  save(f);
-}
-
-template<class I, class Ipass, class O, class Opass>
-void TFTi<I,Ipass,O,Opass>::save(FILE* f)
-{
-  if(fwrite(&ttn,sizeof(ttn),1,f)!=1) { fprintf(stderr,"Binary output error."); exit(1); }
-  if(fwrite(&states,sizeof(states),1,f)!=1) { fprintf(stderr,"Binary output error."); exit(1); }
-  if(fwrite(&transitions,sizeof(transitions),1,f)!=1) { fprintf(stderr,"Binary output error."); exit(1); }
-  if(fwrite(itype,sizeof(char),ftTYPELEN,f)!=ftTYPELEN) { fprintf(stderr,"Binary output error."); exit(1); }
-  if(fwrite(otype,sizeof(char),ftTYPELEN,f)!=ftTYPELEN) { fprintf(stderr,"Binary output error."); exit(1); }
-  if(fwrite(&copy_default,sizeof(copy_default),1,f)!=1) { fprintf(stderr,"Binary output error."); exit(1); }
-  if(fwrite(&print_mode,sizeof(print_mode),1,f)!=1) { fprintf(stderr,"Binary output error."); exit(1); }
-  if(fwrite(tt,sizeof(TTrans_i<I,Ipass,O,Opass>),ttn,f)!=ttn) { fprintf(stderr,"Binary output error."); exit(1); }
-  fclose(f);
-}
-
-//---------------------------------------------------------------------------
-
-template<class I, class Ipass, class O, class Opass>
-void TFTi<I,Ipass,O,Opass>::clear()
-{
-  if(tt) delete[] tt;
-  ttn=0;
-}
-
-//---------------------------------------------------------------------------
-/*
-template<class I, class Ipass, class O, class Opass>
-istream& operator>>(istream& is, TFTi<I,Ipass,O,Opass>& ft)
-{
-  long *si;                             // state-index relation
-  long ci=0;                            // current index
-  char ch;                              // character read;
-  int empty=0;                          // no of states with 0 trans?
-  char intype[FT::ftTYPELEN];
-  char outtype[FT::ftTYPELEN];
-
-  ft.clear();
-
-  is >> ft.states >> ft.transitions >> intype >> outtype;
-
-  if(strcmp(intype,ft.itype)!=0 ||
-     strcmp(outtype,ft.otype)!=0 && strcmp(outtype,"void")!=0)
-    { is.clear(ios::badbit); return is; };
-
-  while(is.peek()==' ' || is.peek()=='\t') is.get(ch);
-  while(is.peek()!='\n')
-  {
-    char s[20];
-    is >> s;
-    if(strcmp(s,"COPY")==0 && strcmp(intype,outtype)==0) ft.copy_default=true;
-    else if(strcmp(s,"NOCOPY")==0) ft.copy_default=false;
-    else if(strcmp(s,"II")==0) ft.print_mode=FT::II;
-    else if(strcmp(s,"OO")==0) ft.print_mode=FT::OO;
-    else if(strcmp(s,"IOIO")==0) ft.print_mode=FT::IOIO;
-    else if(strcmp(s,"OIOI")==0) ft.print_mode=FT::OIOI;
-    else if(strcmp(s,"IIOO")==0) ft.print_mode=FT::IIOO;
-    else if(strcmp(s,"OIOI")==0) ft.print_mode=FT::OIOI;
-    while(is.peek()==' ' || is.peek()=='\t') is.get(ch);
-  }
-
-  ft.ttn=ft.transitions+2;      // 1 state without trans., 1 additional
-  si=new long[ft.states];
-  ft.tt=new TTrans_i<I,Ipass,O,Opass>[ft.ttn];
-
-  for(long cs=0;cs<ft.states;cs++)
-  {
-    long tc;                             // transition counter
-    si[cs]=ci;
-    do is >> ch; while(ch!='+' && ch!='-');
-    switch(ch)
-    {
-      case '-': ft.tt[ci].final(false); break;
-      case '+': ft.tt[ci].final(true); break;
-      default: return is;
-    }
-    tc=0, ft.tt[ci].continued(false);
-    while((is.get(ch),ch==' '))
-    {
-      if(!is) return is;
-      switch(is.peek())
-      {
-        case '~': ft.tt[ci].epsi(true); ft.tt[ci].defi(true); is.get(ch);
-                  break;
-        case '@': ft.tt[ci].epsi(false); ft.tt[ci].defi(true); is.get(ch);
-                  break;
-        default : ft.tt[ci].geti(is);
-      }
-      if(!is) return is;
-      if(is.peek()=='/')
-      {
-        is.get(ch);
-        switch(is.peek())
-        {
-          case '~': ft.tt[ci].epso(true); ft.tt[ci].defo(true); is.get(ch);
-                    break;
-          case '@': ft.tt[ci].epso(false); ft.tt[ci].defo(true); is.get(ch);
-                    break;
-          default : ft.tt[ci].geto(is);
-        }
-      }
-      else
-      {
-        ft.tt[ci].defo(true);
-        if(ft.copy_default) ft.tt[ci].epso(false); else ft.tt[ci].epso(true);
-      }
-      if(!is) return is;
-
-      unsigned long transition;
-      is >> transition;
-      ft.tt[ci].next(transition);
-
-      ft.tt[ci].continued(false);
-
-      ft.tt[ci].empty(false);
-      if(tc>0) ft.tt[ci-1].continued(true);
-      tc++,ci++;
-    }
-    if(tc==0)
-    {
-      if(++empty>2) err("Nondeterministic automaton.");
-      ft.tt[ci].empty(true);
-      ci++;
-    }
-    if(ch!='\n') { is.clear(ios::badbit); return is; }
-  }
-
-  ft.ttn=ft.transitions+empty;
-  if(ft.ttn!=ci) { is.clear(ios::badbit); return is; };
-  for(long i=0;i<ft.ttn;i++)
-    ft.tt[i].next(si[ft.tt[i].next()]);
-  delete[] si;
-  ft.sort();
-  return is;
-}
-*/
-//---------------------------------------------------------------------------
-/*
-template<class I, class Ipass, class O, class Opass>
-ostream& operator<<(ostream& os, const TFTi<I,Ipass,O,Opass>& ft)
-{
-  os << ft.states << ' ' << ft.transitions << ' '
-     << ft.itype << ' ' << ft.otype << ' ';
-  os << (ft.copy_default ? "COPY" : "NOCOPY") << ' ';
-  switch(ft.print_mode)
-  {
-    case FT::II  : os << "II"; break;
-    case FT::OO  : os << "OO"; break;
-    case FT::IOIO: os << "IOIO"; break;
-    case FT::OIOI: os << "OIOI"; break;
-    case FT::IIOO: os << "IIOO"; break;
-    case FT::OOII: os << "OOII";
-  }
-  os << ' ' << '\n';
-
-  long* si=new long[ft.ttn];
-  long cs=0;
-  for(long i=0;i<ft.ttn;i++)
-  {
-    si[i]=cs;
-    if(ft.continued(i)==false) cs++;
-  }
-
-  bool first=true;
-  for(long i=0;i<ft.ttn;i++)
-  {
-    if(first)
-      if(ft.final(i)) os << '+'; else os << '-';
-
-    if(!ft.empty(i))
-    {
-      os << ' ';
-      if(ft.epsi(i))
-        os << FT::ftEPSILON;
-      else
-      if(ft.defi(i))
-        os << FT::ftDEFAULT;
-      else
-        os << ft.input(i);
-
-      if(ft.epso(i))
-      { if(ft.copy_default) os << '/' << FT::ftEPSILON; }
-      else
-      if(ft.defo(i))
-      { if(!ft.copy_default) os << '/' << FT::ftDEFAULT; }
-      else
-      { os << '/' << ft.output(i); }
-
-      if(strcmp(ft.itype,"char")!=0 || strcmp(ft.otype,"char")!=0)
-
-        os << ' ';
-      os << si[ft.next(i)];
-    }
-    if(ft.continued(i))
-      first=false;
-    else
-    { os << '\n'; first=true; }
-  }
-  return os;
-}
-*/
-//---------------------------------------------------------------------------
-//---------------------------------------------------------------------------
-
-template<class I, class O>
-class TFTiv : public TFTi<I,I,O,O>
-{
-public:
-  TFTiv() : TFTi<I,I,O,O>() {};
-  TFTiv(const char* filename) : TFTi<I,I,O,O>(filename) {};
-};
-
-//---------------------------------------------------------------------------
-
-template<class I, class O>
-class TFTir : public TFTi<I,I&,O,O&>
-{
-public:
-  TFTir() : TFTi<I,I,O,O>() {};
-};
-
-//---------------------------------------------------------------------------
-#endif
Index: p/src/lib/ttrans.h
===================================================================
--- app/src/lib/ttrans.h	(revision 2f8d6d8c39e7d4812bd35744328e0ed7e89e92bd)
+++ 	(revision )
@@ -1,207 +1,0 @@
-#ifndef _TTransi_h
-#define _TTransi_h
-//---------------------------------------------------------------------------
-#include <iostream>
-//---------------------------------------------------------------------------
-
-
-using namespace std;
-
-//! The template for a transition with input and output symbols stored internally.
-/*!
-    A state is identified with the set of its outgoing transitions.
-    The state index is the index of the first transition for it.
-    A state with no outgoing transition is represented as an empty transition.
-*/
-template<class I, class Ipass, class O, class Opass>
-class TTrans_i
-{
-public:
-//private:
-//! Input symbol
-  I i;
-//! Output symbol
-  O o;
-
-public:
-
-//! state is final
-  static const unsigned char BITf=0x01;
-//! transition list is continued
-  static const unsigned char BITc=0x02;
-//! no transition
-  static const unsigned char BITe=0x04;
-//! epsilon input
-  static const unsigned char BITepsi=0x08;
-//! default input
-  static const unsigned char BITdefi=0x10;
-//! epsilon output
-  static const unsigned char BITepso=0x20;
-//! default output
-  static const unsigned char BITdefo=0x40;
-
-//! Flags
-  unsigned char flags;
-
-//! The index of the next state
-  long nxt;
-
-//! Input symbol.
-//! \return The input symbol of the transition.
-  Ipass in() const { return i; }
-
-//! Output symbol.
-//! \return The output symbol of the transition.
-  Opass out() const { return o; }
-
-//! Set the input symbol.
-//! \param in input symbol
-  void in(Ipass in) { i=in; }
-
-//! Set the output symbol.
-//! \param out output symbol
-  void out(Opass out) { o=out; }
-
-//! remark Is this needed?
-  I& iref() { return i; }
-
-//! remark Is this needed?
-  O& oref() { return o; }
-
-//! Test whether an input symbol is accepted.
-//! \remark Simplified. Should rely on a test function provided by the user.
-  bool accepts(Ipass in) { return defi() || in==i; }
-
-//! Next state.
-//! \return Destination state of the transition.
-  long next() const { return nxt; };
-
-//! Set the next state.
-//! \param t destination state of the transition
-  void next(long t) { nxt=t; };
-
-//! Is the state final?
-//! \return \c true if the state is final, false otherwise.
-  bool final() const { return flags&BITf; };
-
-//! Set the \b final flag.
-//! \param b \c true if the state is final, \c false otherwise.
-  void final(bool b) { if(b) flags|=BITf; else flags&=~BITf; };
-
-//! Is the transition list continued?
-//! \return \c true if the transition is not the last transition for the state,
-//! \c false otherwise.
-  bool continued() const { return flags&BITc; };
-
-//! Set the \b continuation flag.
-//! \param b \c true if the transition is not the last one for the state, \c false otherwise.
-  void continued(bool b) { if(b) flags|=BITc; else flags&=~BITc; };
-
-//! Is the transition empty?
-//! \return \c true if the transition is empty (represents a state with no outgoing transitions),
-//! \c false otherwise.
-  bool empty() const { return flags&BITe; };
-
-//! Set the \b empty flag.
-//! \param b \c true if the transition is empty, \c false otherwise.
-  void empty(bool b) { if(b) flags|=BITe; else flags&=~BITe; };
-
-  bool epsi() const { return flags&BITepsi; };
-  void epsi(bool b) { if(b) flags|=BITepsi; else flags&=~BITepsi; };
-
-  bool defi() const { return flags&BITdefi; };
-  void defi(bool b) { if(b) flags|=BITdefi; else flags&=~BITdefi; };
-
-  bool epso() const { return flags&BITepso; };
-  void epso(bool b) { if(b) flags|=BITepso; else flags&=~BITepso; };
-
-  bool defo() const { return flags&BITdefo; };
-  void defo(bool b) { if(b) flags|=BITdefo; else flags&=~BITdefo; };
-
-  void geti(istream&);
-  void geto(istream&);
-
-//  friend ostream& operator<<(ostream& os, const TTrans_i<I,Ipass,O,Opass>& t);
-
-};
-
-//---------------------------------------------------------------------------
-
-template<char>
-void getsym(istream& is, char& c)
-{
-  is >> c;
-  if(c=='\\')
-    {
-      is.get(c);
-      switch(c)
-      {
-        case 'n':c='\n';break;
-        case 't':c='\t';break;
-      }
-    }
-}
-
-template<class T>
-void getsym(istream& is, T& s)
-{ is >> s; }
-
-//---------------------------------------------------------------------------
-
-template<class I, class Ipass, class O, class Opass>
-void TTrans_i<I,Ipass,O,Opass>::geti(istream& is)
-{ getsym<I>(is,iref()); };
-
-template<class I, class Ipass, class O, class Opass>
-void TTrans_i<I,Ipass,O,Opass>::geto(istream& is)
-{ getsym<I>(is,oref()); };
-
-//---------------------------------------------------------------------------
-/*
-template<class I, class Ipass, class O, class Opass>
-ostream& operator<<(ostream& os, const TTrans_i<I,Ipass,O,Opass>& t)
-{
-  os << (t.final() ? '+' : '-');
-  os << ' ';
-
-  if(!t.empty())
-  {
-    if(t.defi())
-      os << (t.epsi() ? '~' : '@');
-    else
-      switch(t.in())
-      {
-        case ' ': os << "\\ "; break;
-        case '\n': os << "\\n"; break;
-        case '\t': os << "\\t"; break;
-        default:   os << t.in();
-      }
-
-    os << '/';
-
-    if(t.defo())
-      os << (t.epso() ? '~' : '@');
-    else
-      switch(t.out())
-      {
-        case ' ': os << "\\ "; break;
-        case '\n': os << "\\n"; break;
-        case '\t': os << "\\t"; break;
-        default:   os << t.out();
-      }
-
-    os << ' ' << t.next();
-  }
-
-  os << '\n';
-
-  if(!t.continued())
-    os << '\n';
-
-  return os;
-}
-*/
-
-//---------------------------------------------------------------------------
-#endif
-
Index: p/src/lib/word.cc
===================================================================
--- app/src/lib/word.cc	(revision 2f8d6d8c39e7d4812bd35744328e0ed7e89e92bd)
+++ 	(revision )
@@ -1,250 +1,0 @@
-//---------------------------------------------------------------------------
-#include "word.h"
-#include "auttools.h"
-#include <istream>
-//---------------------------------------------------------------------------
-
-using namespace std;
-
-//---------------------------------------------------------------------------
-
-void Word::autodescr(const char* fo, const char* de)
-{
-  strcpy(f,fo);
-  //  len=strlen(f);
-
-  char lemd[MAXDESCRLEN];
-  int i=strcspn(de,",");
-  strncpy(lemd,de,i);
-  lemd[i]='\0';
-  if(isdigit(lemd[0]))
-    fullform(f,lemd,l);  // jeÂ¶li lemat zakodowany
-  else
-    strcpy(l,lemd);     // jeÂ¶li lemat w peÂ³nej postaci
-  strcpy(d,de+i+1);
-}
-
-//---------------------------------------------------------------------------
-bool Word::cmp_w(Word a, Word b) {
-  return (a.w_suf() > b.w_suf());
-}
-//---------------------------------------------------------------------------
-bool Word::cmp_w_rev(Word a, Word b) {
-  return (a.w_suf() < b.w_suf());
-}
-//---------------------------------------------------------------------------
-bool cmp_w_fun(Word a, Word b) {
-  return (a.w_suf() > b.w_suf());
-}
-//---------------------------------------------------------------------------
-bool cmp_w_rev_fun(Word a, Word b) {
-  return (a.w_suf() < b.w_suf());
-}
-//---------------------------------------------------------------------------
-
-istream& operator>>(istream& is, Word& w)
-{
-  char temp[Word::MAXLEN+1];
-  char c;
-
-  int i=0;
-  while(i<Word::MAXLEN && is.get(c) && isalpha(c)) temp[i++]=c;
-  if(i==Word::MAXLEN) {
-    fprintf(stderr, "To long word");
-  }
-  if(i==0) is.clear(ios::badbit);
-  temp[i]='\0';
-  if(is)
-    is.putback(c);
-  strcpy(w.f,temp);
-  //  w.len=i;
-  return is;
-}
-
-//---------------------------------------------------------------------------
-
-ostream& operator<<(ostream& os, Word& w)
-{
-  if(*(w.f))
-    os << "<W " << w.form()
-       << ";" << w.lemma()
-       << ',' << w.descr() << '>';
-  return os;
-}
-
-//---------------------------------------------------------------------------
-Words::~Words() {
-  //   for (int i=0; i<tab.size(); ++i)
-//     delete(tab[i]);
-}
-//---------------------------------------------------------------------------
-
-int Words::find(const char* word) {
-  for (int i=0; i<cnt; ++i) {
-    if (strcmp(word, tab[i].form()) == 0) {
-	return i;
-    }
-  }
-  return -1;
-}
-
-
-//---------------------------------------------------------------------------
-
-int Words::find(const char* word, const char* descr) {
-  for (int i=0; i<cnt; ++i) {
-    if ((strcmp(word, tab[i].form()) == 0) && (strcmp(descr, tab[i].descr()) == 0)) {
-	return i;
-    }
-  }
-  return -1;
-}
-
-//---------------------------------------------------------------------------
-/* zwraca index nastepnego wyniku, podczas pierwszego wywolania
- * zwraca index wyniku o najwiekszej wadze, przy drugim wywolaniu
- * wynik z druga najwyzsza waga, itd.
- * Jezeli nie ma juz wynikow - zwraca -1.
- */
-int Words::next() {
-  float max = -1;
-  int result = -1;
-  for (int i=0; i<cnt; ++i) {
-    float w = tab[i].w_suf();
-    if (w>max && !tab[i].returned) {
-      max = w;
-      result = i;
-    }
-  }
-  if (result != -1)
-    tab[result].returned = 1;
-  return result;
-}
-
-//---------------------------------------------------------------------------
-void Words::sort() {
-//  sort(tab.begin(), tab.end(), Word::cmp_w); //NIE DZIALA
-}
-
-//---------------------------------------------------------------------------
-void Words::sort_rev() {
-//  sort(tab.begin(), tab.end(), cmp_w_rev_fun); // NIE DZIALA
-}
-
-//---------------------------------------------------------------------------
-
-int Words::add(const char* fo)
-{
-  int i = find(fo);
-  if(i!=-1) {
-    return i;
-  }
-  
-  if (cnt>=tab.capacity()-1)
-    tab.resize(tab.size()*2);
-  
-
-  Word o;
-  o.form(fo);
-  o.w_suf(0.0);
-  tab.push_back(o);
-//  tab[cnt].form(fo);
-//  tab[cnt].w_suf(0.0);
-
-
-  //  if(cnt<MAX-1) {
-  /* tab.push_back(new Word());
-    tab[cnt]->form(fo);
-    tab[cnt]->w_suf(0.0);
-    tab[cnt]->w_pref(0.0);*/
-    return cnt++;
-    //  }
-    //return -1;
-}
-
-//---------------------------------------------------------------------------
-
- //TYMCZASOWO TAK(DLA CORA)
-int Words::add(const char* fo, float weight)
-{
-  int i = find(fo);
-  if(i!=-1) {
-    return i;
-  }
-  
-  if (cnt>=tab.capacity()-1)
-    tab.resize(tab.size()*2);
-  
-  Word o;
-  o.form(fo);
-  o.w_suf(weight);
-  tab.push_back(o);
-//  tab[cnt].form(fo);
-//  tab[cnt].w_suf(weight);
-  
-    return cnt++;
-    //  }
-    //return -1;
-}
-
-//---------------------------------------------------------------------------
-
-int Words::add(const char* fo, const char* des)
-{
-  char d[Word::MAXDESCRLEN];
-  int l=strcspn(des,",");
-  int ok=1;
-  if( *(des+l) == ',' )
-    {
-      strcpy(d,des+l+1);
-      //  printf("\t%s->%s,\n", des, d);
-      int i=find(fo, d);
-      if(i!=-1)
-        return i;
-    }
-  else
-    ok=0;
-
-  if (cnt>=tab.capacity()-1)
-    tab.resize(tab.size()*2);
-
-  tab[cnt].form(fo);
-  if(ok)
-    tab[cnt].autodescr(fo, des);
-  else
-    tab[cnt].autodescr(fo, "?,?");
-  
-  tab[cnt].w_suf(0.0);
-  tab[cnt].returned = 0;
-  /*
-  //  if(cnt<MAX-1) {
-    tab.push_back(new Word());
-    tab[cnt]->form(fo);
-    tab[cnt]->autodescr(fo,des);
-    tab[cnt]->w_suf(0.0);
-    tab[cnt]->w_pref(0.0);
-    //    printf("ok!\n");*/
-    return cnt++;
-    //  }
-    //  printf("hm\n");
-  return -1;
-}
-
-//---------------------------------------------------------------------------
-void Words::prn(ostream& os)
-{
-  for(int i=0; i<count(); ++i)
-    os << "<W " << tab[i].lemma() << ',' << tab[i].descr() << ">";
-}
-
-//---------------------------------------------------------------------------
-
-ostream& operator<<(ostream& os, Words& tab)
-{
-  /*  for(int i=0; i<tab.count(); ++i)
-    os << i << ". " << tab[i] << '\n';
-    return os;*/
-}
-
-//---------------------------------------------------------------------------
-
Index: p/src/lib/word.h
===================================================================
--- app/src/lib/word.h	(revision 2f8d6d8c39e7d4812bd35744328e0ed7e89e92bd)
+++ 	(revision )
@@ -1,161 +1,0 @@
-//---------------------------------------------------------------------------
-#ifndef _Word_h
-#define _Word_h
-//---------------------------------------------------------------------------
-//#include "alphabet.h"
-//#include "erro.h"
-#include "const.h"
-#include <iostream>
-
-#include <string.h>
-
-#include <vector>
-//---------------------------------------------------------------------------
-
-using namespace std;
-
-
-
-class Word
-{
-public:
-  static const int MAXLEN=64;          // dac do global
-  static const int MAXDESCRLEN=80;     // dac do global
-
-private:
-  /// word form
-  char f[MAX_FORM];                // w wolnej chwili nazwy mozna zamienic na dluzsze
-
-  /// length
-  int _len_suf;  // dlugosc dopasowania koncowki...
-  //  int _len_pref; // ... i prefiksu
-
-  /// lemma
-  char l[MAX_FORM];
-
-  /// description
-  char d[MAX_DESC];
-
-  /// weight (probability)
-  float _w_suf; 
-  //  float _w_pref;
-public:
-  static bool cmp_w(Word a, Word b);
-  static bool cmp_w_rev(Word a, Word b);
-
-  Word() : _len_suf(-1) { *f='\0'; returned=0; };
-  Word(const char* fo, const char* des) : _len_suf(-1) { autodescr(fo,des); _w_suf=1.0; returned=0; };
-
-  Word(const Word& w);
-
-  char* form() { return f; }  // przywrocic const
-  char* lemma() { return l; } // przywrocic const
-  char* descr() { return d; }
-  float w_suf() { return _w_suf; };
-  int len_suf() { return _len_suf; }
-
-
-  void form(const char* s) { strcpy(f,s); }
-  void lemma(const char* s) { strcpy(l,s); }
-  void descr(const char* s) { strcpy(d,s); };
-  void w_suf(float x) { _w_suf=x; };
-  void len_suf(int n) { _len_suf=n; };
-
-  bool operator==(const Word& w);
-  bool operator!=(const Word& w);
-  int cmp(const Word&);
-  int cmpi(const Word&);
-
-  char* operator!() { return f; };
-
-  operator bool() { return _len_suf>0; };
-
-  char* str() { return f; }
-
-  void autodescr(const char* fo, const char* des);
-
-  friend istream& operator>>(istream& is, Word& m);
-  friend ostream& operator<<(ostream& os, Word& m);
-
-  bool returned;
-
-};
-
-
-inline Word::Word(const Word& word)
-{ strcpy(f,word.f); strcpy(l,word.l); strcpy(d,word.d); _len_suf=word._len_suf; _w_suf=word._w_suf; returned = 0; }
-
-//---------------------------------------------------------------------------
-
-inline bool Word::operator==(const Word& w)
-{return _len_suf==w._len_suf && 
-   !strcmp(f,w.f) && !strcmp(l,w.l) && !strcmp(d,w.d); }
-
-//---------------------------------------------------------------------------
-
-inline bool Word::operator!=(const Word& w)
-{return _len_suf!=w._len_suf || 
-   strcmp(f,w.f) || strcmp(l,w.l) || strcmp(d,w.d);}
-
-//---------------------------------------------------------------------------
-
-inline int Word::cmp(const Word& w) { return strcmp(f,w.f); }
-
-//---------------------------------------------------------------------------
-
-//inline int Word::cmpi(const Word& w) { return PL.cmpi(f,w.f); }
-
-//---------------------------------------------------------------------------
-
-
-
-
-bool cmp_w_fun(Word a, Word b);
-bool cmp_w_rev_fun(Word a, Word b);
-
-
-//---------------------------------------------------------------------------
-//---------------------------------------------------------------------------
-
-class Words
-{
- private:
-  int find(const char* word);
-  int find(const char* word, const char* descr);
- public:
-
-  static const int MAX=1024;
-
-  Words() : cnt(0) {tab.resize(MAX); };
-  ~Words();
-  Word& operator[](int i) { return tab[i]; }
-  int count() const { return cnt; }
-  void clear() { cnt=0; tab.clear(); }
-  int add(const char* fo);
-  int add(const char* fo, float weight);
-  int add(const char* fo, const char* des);
-
-  /* zwraca index nastepnego wyniku, podczas pierwszego wywolania
-   * zwraca index wyniku o najwiekszej wadze, przy drugim wywolaniu
-   * wynik z druga najwyzsza waga, itd.
-   * Jezeli nie ma juz wynikow - zwraca -1.
-   */
-  int next();
-
-  void sort();
-  void sort_rev();
-
-  void prn(ostream& os);
-
-//  friend class Lem;
-//  friend class AuxLem;
-  friend ostream& operator<<(ostream& os, Words& tab);
-  vector<Word> tab;
-  int cnt;
-
-};
-
-//---------------------------------------------------------------------------
-
-#endif
-
Index: p/src/sen-nl/Makefile
===================================================================
--- app/src/sen-nl/Makefile	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,9 +1,0 @@
-
-sen-nl:
-
-copy:
-ifdef UTT_BIN_DIR
-	cp sen-nl ${UTT_BIN_DIR}
-endif
-
-clean:
Index: p/src/sen-nl/sen-nl
===================================================================
--- app/src/sen-nl/sen-nl	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,3 +1,0 @@
-#!/bin/bash
-
-sed -r '1 s/^(([0-9]+)[ \t][0-9]+[ \t].*)$/\2 00 BOS \*\n\1/;t;$! s/(([0-9]+)[ \t][0-9]+[ \t][[:alpha:]]+[ \t]+[[:print:]]*\\n.*)$/\2 00 EOS *\n\2 00 BOS *\n\1/; $ s/^(([0-9]+) .*)$/\1\n\2 00 EOS */'
Index: p/src/tags/Makefile
===================================================================
--- app/src/tags/Makefile	(revision 8d3e6ab33b2b6727eb54bb3498a0ba2af9ca9ea1)
+++ 	(revision )
@@ -1,8 +1,0 @@
-main:
-
-copy:
-ifdef UTT_BIN_DIR
-	cp *.tag2re ${UTT_BIN_DIR}
-endif
-
-clean:
Index: p/src/tags/README
===================================================================
--- app/src/tags/README	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,5 +1,0 @@
-In this directory files specific to different tag formats are stored.
-
-TAGSET.tag2re are command-line programs which translate a tag constraint 
-specification into a character-level regular expression matching 
-all tags in the TAGSET format meeting the specified constraint.
Index: p/src/tags/ipi.tag2re
===================================================================
--- app/src/tags/ipi.tag2re	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,1 +1,0 @@
-#TODO
Index: p/src/tok.c/Makefile
===================================================================
--- app/src/tok.c/Makefile	(revision 13a8a67bce500a27f4c2121c096be175d5daab52)
+++ 	(revision )
@@ -1,37 +1,0 @@
-PAR=-Wno-deprecated -O3
-PAR2=-c -Wno-deprecated -O3
-LIB_PATH=../lib
-CMDLINE_FILE='"../tok.c/cmdline.h"'
-
-
-tok: tok.o cmdline.c common_tok.o common.o
-	g++ $(PAR) -D _CMDLINE_FILE=$(CMDLINE_FILE) \
-	tok.c cmdline.c common.o common_tok.o -o tok
-
-tok.o: tok.c cmdline.h 
-	g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) tok.c
-
-common_tok.o: cmdline.h  common_tok.cc common_tok.h
-	g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) common_tok.cc
-
-common.o: $(COMMON_PATH)/cmdline_common.ggo $(COMMON_PATH)/common.cc \
-	$(COMMON_PATH)/common.h
-	g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) $(COMMON_PATH)/common.cc
-
-cmdline.ggo: cmdline_tok.ggo ../common/cmdline_common.ggo
-	cat cmdline_tok.ggo ../common/cmdline_common.ggo > cmdline.ggo
-
-cmdline.c cmdline.h: cmdline.ggo
-	gengetopt -i cmdline.ggo --conf-parser
-
-copy:
-ifdef UTT_BIN_DIR
-    cp tok ${UTT_BIN_DIR}/
-endif
-
-
-clean: clean.cmdline
-	rm *.o
-
-clean.cmdline:
-	rm cmdline.*
Index: p/src/tok.c/cmdline_tok.ggo
===================================================================
--- app/src/tok.c/cmdline_tok.ggo	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,4 +1,0 @@
-package "tok"
-version "0.1"
-
-
Index: p/src/tok.c/common_tok.cc
===================================================================
--- app/src/tok.c/common_tok.cc	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,27 +1,0 @@
-#include <stdlib.h>
-#include <string.h>
-#include "common_tok.h"
-
-char dictionary[255];
-
-void process_tok_options(gengetopt_args_info args)
-{
-  if(args.dictionary_given)
-    strcpy(dictionary, args.dictionary_arg);
-  else {
-    char path[256];
-    sprintf(path, "/etc/utt/%s", DICT_FILE);
-    if (file_accessible(path) == 0)
-      strcpy(dictionary, path);
-    else {
-      sprintf(path, "%s/.utt/%s", getenv("HOME"), DICT_FILE);
-      if (file_accessible(path) == 0)
-	strcpy(dictionary, path);
-      else {
-	fprintf(stderr, "Cannot find dictionary!\n");
-	exit(1);
-      }
-    }
-  }
-
-}
Index: p/src/tok.c/common_tok.h
===================================================================
--- app/src/tok.c/common_tok.h	(revision 13a8a67bce500a27f4c2121c096be175d5daab52)
+++ 	(revision )
@@ -1,15 +1,0 @@
-#ifndef __COMMON_TOK__H
-#define __COMMON_TOK__H
-
-#include <stdio.h>
-#include "../common/common.h"
-
-#include "cmdline.h"
-
-#define DICT_FILE "data/tok.bin"
-
-extern char dictionary[];
-
-extern void process_tok_options(gengetopt_args_info args);
-
-#endif
Index: p/src/tok.c/tok.c
===================================================================
--- app/src/tok.c/tok.c	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,83 +1,0 @@
-
-#include <ctype.h>
-#include <stdio.h>
-#include <string.h>
-#include <locale.h>
-
-
-#include <stdlib.h>
-//#include "../lib/iotools.h"
-
-#include "cmdline.h"
-
-
-char buf[257];
-int filepos=0;
-char* tokstart;
-char* tokend;
-char tmp;
-char tag;
-
-
-gengetopt_args_info args;
-
-
-inline
-void printtoken(char tag)
-{
-  tmp=*tokend;
-  *tokend='\0';
-  printf("%04d %02d %c %s\n", filepos, tokend-tokstart, tag, tokstart);
-  *tokend=tmp;
-  filepos+=tokend-tokstart;
-  tokstart=tokend;
-  if(args.interactive_flag) fflush(stdout);
-}
-
-main(int argc, char** argv)
-{
-
-  if (cmdline_parser(argc, argv, &args) != 0)
-    exit(1);
-
-  printf("inter:%d\n",args.interactive_flag);
-
-  //  process_common_options(&args, argv[0]);
-  //  process_tok_options(args);
-
-  setlocale(LC_CTYPE,"");
-  setlocale(LC_COLLATE,"");
-
-  while(fgets(buf,256,stdin))
-  {
-
-    tokstart=tokend=buf;
-    while(*tokend)
-    {
-      char *prev=tokend;
-      ++tokend;
-      if(isalpha(*prev) && !isalpha(*tokend))
-         printtoken('W');
-      else if(isdigit(*prev) && !isdigit(*tokend))
-        printtoken('N');
-      else if(isspace(*prev))
-        {
-          switch(*prev)
-            {
-            case ' ': *prev='_'; break;
-            case '\t':*prev='t'; break;
-            case '\r':*prev='r'; break;
-            case '\f':*prev='f'; break;
-            case '\n':*prev='n';
-            }
-          if(!isspace(*tokend))
-            printtoken('S');
-        }
-      else if(ispunct(*prev))
-         printtoken('P');
-    }
-  }
-
-  cmdline_parser_free(&args);
-}
-
Index: p/src/tok/Makefile
===================================================================
--- app/src/tok/Makefile	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,6 +1,0 @@
-tok:
-
-copy:
-ifdef UTT_BIN_DIR
-	cp tok ${UTT_BIN_DIR}
-endif
Index: p/src/tok/tok
===================================================================
--- app/src/tok/tok	(revision ac7d97018efb6419eb3d840b7767294d8be71ed8)
+++ 	(revision )
@@ -1,125 +1,0 @@
-#!/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 $max_form_length = 50;
-
-my $interactive=0;
-my $help;
-
-my $systemconfigfile='/usr/local/etc/utt/tok.conf';
-#my $userconfigfile="$ENV{'HOME'}/.utt/tok.conf";
-my $userconfigfile=home()."/.utt/tok.conf";
-
-#read configuration files###########################
-my $file;
-foreach $file ($systemconfigfile, $userconfigfile){
-	if(open(CONFIG, $file)){
-		while (<CONFIG>) {
-    			chomp;
-    			s/#.*//;
-			s/^\s+//;
-    			s/\s+$//;
-    			next unless length;
-    			my ($name, $value) = split(/\s*=\s*/, $_, 2);
-    			if(($name eq "interactive")or($name eq "i")){
-				$interactive=1;
-    			}
-    			elsif(($name eq "help")or($name eq "h")){
-				$help=1;
-    			}
-		}
-		close CONFIG;
-	}
-}
-#########################################################s
-
-GetOptions("interactive|i" => \$interactive,
-	   "help|h" => \$help);
-
-if($help)
-{
-    print <<'END'
-Usage: tok [OPTIONS]
-
-Options:
-   --interactive		Interactive (no output buffering).
-   --help -h			Help.
-END
-;
-    exit 0;
-}
-
-
-$| = $interactive;
-
-my $offset = 0;
-
-while(<>)
-{
-    1 while
-	/ [[:alpha:]]+   (?{seg('W',$&)})
-	| \d+            (?{seg('N',$&)})
-	| \s+            (?{seg('S',$&)})
-	| [[:punct:]]    (?{seg('P',$&)})
-	| .		 (?{seg('B',$&)})
-	/gxo;
-}
-
-#	| [^[:print:]]	 (?{seg("B",$&)})
-
-sub min {
-  my ($val1, $val2) = @_;
-  if($val1 < $val2) {
-  	return $val1;
-  }
-  else {
-  	return $val2;
-  }
-}
-
-
-sub seg
-{
-    my ($tag,$match) = @_;
-    my $length = length $match;
-    my $idx = 0;
-    while($idx < $length) {
-	my $l = min $max_form_length, $length - $idx;
-	my $m = substr $match, $idx, $l;
-    
-	printf "%04d %02d %s ", $offset + $idx, $l, $tag;
-    if($tag eq 'S')
-    {
-	for(my $i=0; $i<$l; ++$i)
-	{
-	    my $c = substr $m, $i, 1;
-	    print '_' if $c eq ' ';
-	    print '\n' if $c eq "\n";
-	    print '\t' if $c eq "\t";
-	    print '\r' if $c eq "\r";
-	    print '\f' if $c eq "\f";
-	}
-    }
-    elsif($tag eq 'B')
-    {
-	printf "\\x%02X", ord($m);
-    }
-    else
-    {
-	print $m;
-    }
-    print "\n";
-    $idx += $l;
-    } # while($idx < $length)
-    $offset += $length;
-} #sub seg
-
Index: ng/Makefile
===================================================================
--- lang/Makefile	(revision e28a62525995e07b8d354225ae96189c5c02a06d)
+++ 	(revision )
@@ -1,40 +1,0 @@
-
-CUR_DIR=$(shell pwd)
-
-#directory with dictionary source
-export UTT_DIC_SRC_HOME=${CUR_DIR}/src
-#directory with configuration files
-export UTT_DIC_CONF_HOME=${CUR_DIR}/conf
-#directory where compiled dictionaries will be placed
-export UTT_DIC_BIN=$(CUR_DIR)/dic
-#directory where distribution will be placed
-export UTT_DIC_OUTPUT=${CUR_DIR}
-
-export LANG_MODULES=pl_PL.ISO-8852-2 pl_PL.UTF-8
-
-# path to dictionary compiler
-DIC_COMPILER=../app/src/compiledic/compiledic
-
-
-
-.PHONY: compile
-compile:
-	#$DIC_COMPILER ...
-	
-
-
-.PHONY: distribute
-distribute: compile dist_tarball
-	@echo "Distribution ready!"
-	
-	
-.PHONY: dist_tarball
-dist_tarball:
-	cd dist && make tarball; cd ${CUR_DIR};
-	
-	
-.PHONY: dist_tarball_pl_PL.ISO-8859-2
-dist_tarball:
-	export DIC_LANG=pl_PL.ISO-8859-2 && \
-	cd dist && make tarball; cd ${CUR_DIR};
-	
Index: ng/README
===================================================================
--- lang/README	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,1 +1,0 @@
-the directory contains 
Index: ng/README.developers
===================================================================
--- lang/README.developers	(revision ef85bd7e83d1ab6ee403fb373e64f271ac6e1648)
+++ 	(revision )
@@ -1,10 +1,0 @@
-To create dictionary distribution, use:
-    make dist_tarball
-or
-    make dist_tarball DIC_LANG=pl_PL.ISO-8859-2
-    
-The fisrt version will create tarball for all dictionaries, 
-the second only for selected language and encoding.
-The tarball file will be placed in current directory.
-
-Next distribution will be prepared soon.
Index: ng/conf/pl_PL.ISO-8859-2/pl_PL.ISO-8859-2.sym
===================================================================
--- lang/conf/pl_PL.ISO-8859-2/pl_PL.ISO-8859-2.sym	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,8 +1,0 @@
-lcase   a ± b c æ d e ê f g h i j k l ³ m n ñ o ó
-lcase   p q r s ¶ t u v w x y z Œ ¿ é ö ü ä
-ucase   A ¡ B C Æ D E Ê F G H I J K L £ M N Ñ O Ó
-ucase   P Q R S Š T U V W X Y Z ¬ ¯
-letter  lcase ucase
-digit   0 1 2 3 4 5 6 7 8 9
-punct   , . @ / ' ~ ; _ - + ? \ 
-all     letter digit signs sem
Index: ng/conf/pl_PL.UTF-8/pl_PL.utf-8.sym
===================================================================
--- lang/conf/pl_PL.UTF-8/pl_PL.utf-8.sym	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ 	(revision )
@@ -1,9 +1,0 @@
-lcase   a Ä
- b c Ä d e Ä f g h i j k l Å m n Å o Ã³
-lcase   p q r s Å t u v w x y z Åº ÅŒ Ã© Ã¶ ÃŒ Ã€
-ucase   A Ä B C Ä D E Ä F G H I J K L Å M N Å O Ã
-ucase   P Q R S Å T U V W X Y Z Å¹ Å»
-letter  lcase ucase
-digit   0 1 2 3 4 5 6 7 8 9
-punct   , . @ / ' ~ ; _ - + ? \ 
-all     letter digit signs sem
Index: ng/dist/Makefile
===================================================================
--- lang/dist/Makefile	(revision ef85bd7e83d1ab6ee403fb373e64f271ac6e1648)
+++ 	(revision )
@@ -1,37 +1,0 @@
-
-# some variables
-
-# -----------------------------------------------------------
-# default task should display options
-.PHONY: default
-defaul:
-	@echo "Using: make tarball|rpm|deb"
-
-
-# -----------------------------------------------------------
-# this task will create tar.gz distribution
-.PHONY: tarball
-tarball:
-	cd tarball && make
-
-# -----------------------------------------------------------
-# this task should compile utt (if nesessery) and create rpm version
-.PHONY: rpm
-rpm:
-	@#we build rpm (see spec/README for details)
-	cd spec && make
-
-# -----------------------------------------------------------
-# this task should compile utt (if nesessery) and create deb version
-.PHONY: deb
-deb:
-	@#we build deb (see deb/README for details)
-	cd deb && make
-
-# -----------------------------------------------------------
-# this task should remove compiled files and directories
-.PHONY: clean
-clean:
-	# finally the line below should be uncomment
-	#rm -fr ${UTT_DIST_TMP}
-
Index: ng/dist/tarball/Makefile
===================================================================
--- lang/dist/tarball/Makefile	(revision e28a62525995e07b8d354225ae96189c5c02a06d)
+++ 	(revision )
@@ -1,41 +1,0 @@
-# This makefile builds tarball distribution for utt dictionary.
-
-#
-# Some variables
-#
-DIR=$(shell pwd)
-
-# Common info about version and release
-_UTT_VER=$(shell cat ../../../app/dist/common/version.def)
-_UTT_REL=$(shell cat ../../../app/dist/common/release.def)
-
-# Temp vars
-_TARBALL_ROOT=$(DIR)/utt-$(_UTT_VER).$(_UTT_REL)
-_UTT_DIC_HOME=share/utt
-_TAR_FILE_NAME=utt.$(_UTT_VER)_$(_UTT_REL)
-
-
-#defualt task
-.PHONY: default
-default:
-	@echo Build directory: ${UTT_DIC_BIN}
-	@echo Output directory for tarball: ${UTT_DIC_OUTPUT}
-	mkdir -p ${_TARBALL_ROOT}/${_UTT_DIC_HOME}
-	if [[ -n "${DIC_LANG}" && -d ${UTT_DIC_BIN}/${DIC_LANG} ]]; \
-	then \
-	    echo "Tworze dystrybucje ${DIC_LANG}"; \
-	    mkdir -p ${_TARBALL_ROOT}/${_UTT_DIC_HOME}/${DIC_LANG}; \
-	    cp -fr ${UTT_DIC_BIN}/${DIC_LANG}/* ${_TARBALL_ROOT}/${_UTT_DIC_HOME}/${DIC_LANG}/; \
-	    cp -fr ${UTT_DIC_CONF_HOME}/${DIC_LANG}/* ${_TARBALL_ROOT}/${_UTT_DIC_HOME}/${DIC_LANG}/; \
-	    rm -rf ${_TARBALL_ROOT}/${_UTT_DIC_HOME}/${DIC_LANG}/.svn ; \
-	    tar -czf ${UTT_DIC_OUTPUT}/${_TAR_FILE_NAME}.${DIC_LANG}.tar.gz utt*; \
-	else \
-	    echo "Tworze pelna dystrybucje!"; \
-	    cp -fr ${UTT_DIC_BIN}/* ${_TARBALL_ROOT}/${_UTT_DIC_HOME}/; \
-	    cp -fr ${UTT_DIC_CONF_HOME}/* ${_TARBALL_ROOT}/${_UTT_DIC_HOME}/; \
-	    find ${_TARBALL_ROOT}/${_UTT_DIC_HOME} -type d -path '*/.svn' -exec rm -rf {} \; ; \
-	    tar -czf ${UTT_DIC_OUTPUT}/${_TAR_FILE_NAME}.all.tar.gz utt*; \
-	fi
-
-	rm -rf ${_TARBALL_ROOT}
-
Index: wszelkiwypadek/tools/cor_dic/makeLabels.pl
===================================================================
--- nawszelkiwypadek/tools/cor_dic/makeLabels.pl	(revision f1563c0f0270f57e03d1fba3f2ce99a3828b3b8c)
+++ 	(revision )
@@ -1,11 +1,0 @@
-#!/usr/bin/perl
-
-use locale;
-
-print "lcase	a ± b c æ d e ê f g h i j k l ³ m n ñ o ó p q r s ¶ t u v w x y z Œ ¿ é ö ü ä\n";
-print "ucase	A ¡ B C Æ D E Ê F G H I J K L £ M N Ñ O Ó P Q R S Š T U V W X Y Z ¬ ¯\n";
-print "letter	lcase ucase\n";
-print "digit	0 1 2 3 4 5 6 7 8 9\n";
-print "signs    , . @ \/ \'\n _";
-print "sem	~ ; - \\ \n";
-print "all	letter digit signs sem\n";
Index: wszelkiwypadek/tools/cor_dic/prep.pl
===================================================================
--- nawszelkiwypadek/tools/cor_dic/prep.pl	(revision f1563c0f0270f57e03d1fba3f2ce99a3828b3b8c)
+++ 	(revision )
@@ -1,67 +1,0 @@
-#! /usr/bin/perl
-
-use locale;
-use strict;
-
-my $file = shift;
-
-if ($file eq "") {
-    print "Podaj nazwê pliku.\n";
-    exit(0);
-}
-
-
-`makeLabels.pl > labels.sym`;
-
-`lexmakelab labels`;
-
-print "Pobieram informacje ze s³ownika..........................";
-
-`cut -d \\; -f 1 <$file > temp1`;
-
-`sort -u < temp1 > temp2`;
-
-print "OK\n";
-
-print "Kompilujê automat........................................";
-
-`lexcomplex -l labels.lab -S labels.scl <temp2 > temp1`;
-
-print "OK\n";
-
-print "Usuwam epsilon-przejscia.................................";
-
-`fsmrmepsilon temp1> temp2`;
-
-print "OK\n";
-
-print "Determinizujê automat....................................";
-
-`fsmdeterminize temp2 > temp1`;
-
-print "OK\n";
-
-print "Minimalizujê automat.....................................";
-
-`fsmminimize temp1> temp2`;
-
-print "OK\n";
-
-print "Konwertujê automat do formatu fsa........................";
-
-`fsmprint -i labels.lab temp2> temp1`;
-
-`../fsm2aut temp1> temp2`;
-
-`../aut2fsa < temp2> cor.dic`;
-
-print "OK\n";
-
-print "Czyszczê pliki pomocnicze................................";
-
-`rm temp2`;
-`rm temp1`;
-`rm labels.*`;
-
-print "OK\n";
-
Index: wszelkiwypadek/tools/dist/Makefile
===================================================================
--- nawszelkiwypadek/tools/dist/Makefile	(revision f1563c0f0270f57e03d1fba3f2ce99a3828b3b8c)
+++ 	(revision )
@@ -1,47 +1,0 @@
-# main makefile
-
-BIN=bin
-SRC=src
-DIR=$(shell pwd)
-##############################
-# CONFIGURATION
-
-# UTT_BIN_DIR - directory for executables
-# UTT_SHARE_DIR - directory for data and stuff
-# UTT_DOC_DIR - directory for documentation
-
-# example (site installation)
-# UTT_BIN_DIR=/usr/local/bin
-# UTT_DOC_DIR=/usr/share/doc/utt
-
-UTT_BIN_DIR=~/utt/bin
-UTT_SHARE_DIR=~/.utt
-UTT_DOC_DIR=~/utt/doc
-UTT_LIB_DIR=$(UTT_SHARE_DIR)/lib
-##############################
-
-install: make_dirs install_dta install_lib #install_doc install_components
-	@echo "Installation completed successfully!"
-
-install_components:
-	cp -r bin/* $(UTT_BIN_DIR)/
-
-install_dta:
-	if [ -d data ]; then cp -r data/* $(UTT_SHARE_DIR)/; fi
-
-install_doc:
-	cp -r doc/* $(UTT_DOC_DIR)/
-
-install_lib:
-	cp -r lib/* $(UTT_LIB_DIR)/
-
-make_dirs:
-	#if [ -d $(UTT_BIN_DIR) ]; then true; else mkdir -p $(UTT_BIN_DIR); fi
-	if [ -d $(UTT_SHARE_DIR) ]; then true; else mkdir -p $(UTT_SHARE_DIR); fi
-	if [ -d $(UTT_LIB_DIR) ]; then true; else mkdir -p $(UTT_LIB_DIR); fi
-	#if [ -d $(UTT_DOC_DIR) ]; then true; else mkdir -p $(UTT_DOC_DIR); fi
-
-uninstall:
-	rm -r $(UTT_SHARE_DIR)
-	#rm -r $(UTT_BIN_DIR)
-	#rm -r $(UTT_DOC_DIR)
Index: wszelkiwypadek/tools/dist/README
===================================================================
--- nawszelkiwypadek/tools/dist/README	(revision f1563c0f0270f57e03d1fba3f2ce99a3828b3b8c)
+++ 	(revision )
@@ -1,5 +1,0 @@
-Instalacja:
-
-1) Przeniesc katalog .utt do swojego katalogu domowego.
-2) Dopisac do $PATH sciezke do katalogu bin.
-
Index: wszelkiwypadek/tools/fsm2aut
===================================================================
--- nawszelkiwypadek/tools/fsm2aut	(revision f1563c0f0270f57e03d1fba3f2ce99a3828b3b8c)
+++ 	(revision )
@@ -1,44 +1,0 @@
-#!/usr/bin/perl
-
-my $currstate=-1;
-my @states;
-my @final;
-my $tn=0;
-
-while(<>)
-{
-  if(/^\s*([0-9]+)\s+([0-9]+)\s+(.)(\s*)?$/)
-  {
-    push @{$states[$1]}, ($3, $2);
-    $#states=$2 if $#states<$2;
-    $tn++;
-  }
-  elsif(/^\s*([0-9]+)\s*$/)
-  {
-    $final[$1]=1;
-    $#states=$1 if $#states<$1;
-  }
-  else
-  {
-    die("Input error.");
-  }
-}
-
-print scalar(@states)," ",$tn," char void\n";
-
-my $i=0;
-my $width=int(log(@states+1)/log(10));
-foreach $stateref (@states)
-{
-  $f = ($final[$i]?"+":"-");
-  printf "%${width}d %s",$i++,$f;
-  while(@$stateref)
-  {
-    $c=shift @$stateref;
-    $s=shift @$stateref;
-    print " $c $s";
-  }
-  print "\n";
-}
-
-  
Index: wszelkiwypadek/tools/gue_dic/README
===================================================================
--- nawszelkiwypadek/tools/gue_dic/README	(revision f1563c0f0270f57e03d1fba3f2ce99a3828b3b8c)
+++ 	(revision )
@@ -1,28 +1,0 @@
-How to prepare gue dictionary?
-
-1. Preparing input file.
-
-Lines in input file should look like this:
-
-prefix*suffix~weight;description
-
-where:
-prefix - is the prefix of a word
-suffix - is the suffix of a word
-weight - is the weight saying how importand information in this line is
-description - is a description of the word
-	(in any format - description will be in output of gue)
-
-
-2. Compiling a dictionary.
-
-Let's say we have input file named "dict.in".
-Commands compiling dictionary:
-
-prep_user_dict.pl < dict.in > dict.temp
-compile_user_dict.pl dict.temp
-
-Those should create file called "gue.bin" which is dictionary
-for gue component.
-
-Good luck.
Index: wszelkiwypadek/tools/gue_dic/attr.pm
===================================================================
--- nawszelkiwypadek/tools/gue_dic/attr.pm	(revision f1563c0f0270f57e03d1fba3f2ce99a3828b3b8c)
+++ 	(revision )
@@ -1,110 +1,0 @@
-package attr;
-
-use locale;
-use strict;
-
-
-sub match(\@\@)
-{
-    my ($cat1,$avs1)= @{shift @_};
-    my ($cat2,$avs2)= @{shift @_};
-
-    if($cat1 ne $cat2)
-    {
-	return 0; 
-    }
-    else
-    {
-      ATTR:for my $attr (keys %$avs1)
-      {
-	  if($avs2->{$attr})
-	  {
-	      for my $val (keys %{$avs1->{$attr}})
-	      {
-		  next ATTR if $avs2->{$attr}->{$val};
-	      }
-	      return 0;
-	      last ATTR;
-	  }
-      }
-    }
-
-    return 1;
-}
-
-# funkcja parse
-# arg:     deskrypcja
-# warto¶æ: referencja do tablicy [<cat>, <avs>],
-#          gdzie <avs> jest referencja do hasza, zawierajacego pary
-#          atrybut=>hasz warto¶ci (pary warto¶æ=>1), czyli np.
-
-#         [
-#           'ADJ',
-#           {
-#             'KOLEDZY' => {
-#                            '<alojzy>' => 1,
-#                            '<karol>' => 1,
-#                            '<jan>' => 1
-#                          },
-#             'C' => {
-#                      'p' => 1,
-#                      'a' => 1,
-#                      'i' => 1
-#                    },
-#             'N' => {
-#                      'p' => 1
-#                    }
-#           }
-#         ];
-
-sub parse ($)
-{
-    my ($dstr)=@_;
-    my $avs={};
-    my ($cat,$attrlist) = split '/', $dstr;
-  attr:
-    while( $attrlist =~ /([[:upper:]]+)((?:[[:lower:]+?!*-]|<[^>\n]+>)+)/g )
-    {
-	my ($attrstr,$valstr)=($1,$2);
-	my %vals;
-	while($valstr =~ /[[:lower:]+?!*-]|<[^>\n]+>/g)
-	{
-	    my $val = $&;
-	    next attr if $val eq '*';
-	    $val =~ s/^<([[:lower:]])>$/$1/;
-	    $vals{$val}=1;
-	}
-	
-	$avs->{$attrstr} = \%vals; # dlaczego to dziala? %vals jest lokalne
-    }
-    [$cat, $avs];
-}
-
-# funkcja unparse
-# arg:     jak warto¶æ parse
-# warto¶æ: deskrypcja - napis
-
-sub unparse (\@)
-{
-    my ($cat,$avs)= @{shift @_};
-    my $dstr=$cat;
-    my @attrs = keys %$avs;
-    if(@attrs)
-    {
-	$dstr .= '/';
-	for my $attr ( sort @attrs )
-	{
-	    $dstr .= $attr . (join '', sort keys %{$avs->{$attr}});
-	}
-    }
-    $dstr;
-}
-
-
-sub canonize ($)
-{
-    unparse @{parse @_[0]} ;
-}
-
-
-1;
Index: wszelkiwypadek/tools/gue_dic/canon.pl
===================================================================
--- nawszelkiwypadek/tools/gue_dic/canon.pl	(revision f1563c0f0270f57e03d1fba3f2ce99a3828b3b8c)
+++ 	(revision )
@@ -1,9 +1,0 @@
-#!/usr/bin/perl
-
-use locale;
-use attr;
-
-while (<>) {
-    s/,(.*)$/','.attr::canonize($1)/e;
-    print;
-}
Index: wszelkiwypadek/tools/gue_dic/compile_user_dict.pl
===================================================================
--- nawszelkiwypadek/tools/gue_dic/compile_user_dict.pl	(revision f1563c0f0270f57e03d1fba3f2ce99a3828b3b8c)
+++ 	(revision )
@@ -1,197 +1,0 @@
-#! /usr/bin/env perl
-
-use locale;
-#use strict;
-
-#
-##################################################
-$linesPerFile = 20000;
-
-if (@ARGV < 1) {
-    print "usage: prep_user_dict.pl dictionary_file\n";
-    exit;
-}
-
-$file = shift; # @ARGV;
-
-# Przygotowanie etykiet
-
-`makeLabels.pl > labels.sym`;
-
-`lexmakelab labels`;
-
-# Analiza pliku s³ownika
-
-
-print "Kanonizujê opisy.........................................";
-
-`canon.pl <$file >temp1`;
-
-print "OK\n";
-
-print "Sortujê plik.............................................";
-
-`sort -t \\~ -k1,1 -k2,2nr <temp1 > temp2`;
-
-print "OK\n";
-
-print "Minimalizujê plik s³ownika...............................";
-
-#`rmDup.pl < temp2 > temp1`;
-#`rmDup2.pl < temp1 > temp2`;
-
-`cp temp1 temp2`;
-
-`rm temp1`;
-
-print "OK\n";
-
-print "Czyszczê pliki...........................................";
-
-`sed -r "s/([[:punct:]])/[\\1]/g" < temp2 > temp1`;
-
-`cp temp1 temp2`;
-`rm temp1`;
-
-print "OK\n";
-
-#dzielimy plik na wiele czê¶ci, uruchamiamy lexcomplex dla ka¿dej
-#czê¶ci osobno, nastêpnie ³±czymy to za pomoc± programu fsmunion
-
-print "Dzielê s³ownik na mniejsze czê¶ci........................";
-
-open(IN, "./temp2");
-
-$lineCount = 0;
-$fileCount = 0;
-
-`mkdir LemTEMP`;
-
-open(FILE, ">LemTEMP/slo_0");
-
-while (<IN>) {
-
-    if (++$lineCount >= $linesPerFile) {
-	$fileCount++;
-	$lineCount = 0;
-
-	close(FILE);
-#	print "Tworzê nowy plik tymczasowy: slo_".$fileCount."\n";
-	open(FILE, ">LemTEMP/slo_".$fileCount);
-    }
-
-    print(FILE $_);
-}
-
-print "OK\n";
-
-print "Tworzê automaty po¶rednie";
-
-#32 kropki, fileCount plikow
-$filesPerDot = $fileCount/32;
-$files=$filesPerDot;
-$dots=0;
-
-for ($i=0; $i<=$fileCount; $i++) {
-
-    if ($files >= $filesPerDot) {
-	$files = 0;
-	print ".";
-	$dots++;
-    }
-    $files++;
-
-    $command = "lexcomplex -l labels.lab -S labels.scl < LemTEMP/slo_".$i." > LemTEMP/slownik_".$i.".fsm";
-
-    `$command`;
-
-}
-if ($dots < 32) {
-    for ($i=0; $i<32 - $dots; $i++) {
-	print ".";
-    }
-}
-
-print "OK\n";
-
-`rm LemTEMP/slo_*`;
-
-print "Tworzê automat koñcowy";
-
-#35 kropek...
-$filesPerDot = $fileCount/35;
-$files=$filesPerDot;
-$dots=0;
-
-`cp LemTEMP/slownik_0.fsm slownik1.fsm`;
-
-for ($i=1; $i<=$filecount; $i++) {
-
-    if ($files >= $filesPerDot) {
-	$files = 0;
-	print ".";
-	$dots++;
-    }
-    $files++;
-
-    $command = "fsmunion LemTEMP/slownik_".$i." slownik1.fsm > slownik2.fsm";
-
-    `$command`;
-
-    `mv slownik2.fsm slownik1.fsm`;
-}
-
-if ($dots < 35) {
-    for ($i=0; $i<35 - $dots; $i++) {
-	print ".";
-    }
-}
-
-`fsmunion LemTEMP/* > slownik1.fsm`;
-
-print "OK\n";
-
-print "Usuwam epsilon-przejscia.................................";
-
-`fsmrmepsilon slownik1.fsm > slownik2.fsm`;
-
-`rm slownik1.fsm`;
-
-print "OK\n";
-
-print "Determinizujê automat....................................";
-
-`fsmdeterminize slownik2.fsm > slownik1.fsm`;
-
-`rm slownik2.fsm`;
-
-print "OK\n";
-
-print "Minimalizujê automat.....................................";
-
-`fsmminimize slownik1.fsm > slownik.fsm`;
-
-`rm slownik1.fsm`;
-
-print "OK\n";
-
-print "Konwertujê automat do formatu fsa........................";
-
-`fsmprint -i labels.lab slownik.fsm > slownik.txt`;
-
-`../fsm2aut slownik.txt > slownik.aut`;
-
-`../aut2fsa < slownik.aut > gue.bin`;
-
-print "OK\n";
-
-print "Czyszczê pliki pomocnicze................................";
-
-`rm LemTEMP/*`;
-`rmdir LemTEMP`;
-`rm temp2`;
-`rm slownik.fsm`;
-`rm slownik.txt`;
-`rm slownik.aut`;
-
-print "OK\n";
Index: wszelkiwypadek/tools/gue_dic/count_prefs.pl
===================================================================
--- nawszelkiwypadek/tools/gue_dic/count_prefs.pl	(revision f1563c0f0270f57e03d1fba3f2ce99a3828b3b8c)
+++ 	(revision )
@@ -1,86 +1,0 @@
-#! /usr/bin/perl
-
-use locale;
-use strict;
-
-my @prefs;
-
-sub addPref {
-
-    my $pref = shift;
-    my $desc = shift;
-    my $i;
-    for ($i=0; $i< @prefs; ++$i) {
-	my @tab = @{$prefs[$i]};
-      	if (${@{$prefs[$i]}}[0] =~ /^$pref/) {
-     	    ${@{$prefs[$i]}}[1]{$desc}++;
-	    return;
-	}
-    }
-    my @new;
-    my %hash;
-
-    $hash{$desc}++;
-    push(@new, $pref);
-    push(@new, \%hash);
-
-    push(@prefs, \@new);
-}
-
-sub printPrefs {
-
-    my $i;
-    for $i (@prefs) {
-	my @tab = @$i;
-#	print $tab[0]."\t";
-	my $pref = $tab[0];
-	my %hash = %{$tab[1]};
-	my @keys = keys(%hash);
-#	print(@keys."\n");
-	my $sum = 0;
-	my $key;
-	for $key (@keys) {
-	    $sum += $hash{$key};
-	}
-	for $key (@keys) {
-	    print $pref."\t";
-	    print $key."\t";
-	    print $hash{$key}."\t";
-	    print $sum."\n";
-	}
-    }
-}
-
-if (@ARGV < 2) {
-    print "USAGE: count_prefs.pl MIN_PREF_LEN MAX_PREF_LEN\n";
-    exit;
-}
-
-my $MIN = shift;
-my $MAX = shift;
-my $PART = shift;
-
-if ($MIN > $MAX) {
-    print "MIN_PREF_LEN > MAX_PREF_LEN! ($MIN > $MAX)\n";
-    exit;
-}
-my $begin = "";
-while (<>) {
-    my $len = $MIN;
-    $_ =~ /(\w+);(.*)$/;
-    my $pref = $1;
-    my $desc = $2;
-    if ($begin eq "")  {
-	$begin = substr($pref, 0, $MIN);
-    }
-    if ($pref !~ /^$begin.*/) {
- 	printPrefs();
-	undef(@prefs);
-	$begin = "";
-    }
-    while ($len <= $MAX) {
-	addPref(substr($pref, 0, $len++), $desc);
-    }
-}
-
-printPrefs();
Index: wszelkiwypadek/tools/gue_dic/cut_prefs.pl
===================================================================
--- nawszelkiwypadek/tools/gue_dic/cut_prefs.pl	(revision f1563c0f0270f57e03d1fba3f2ce99a3828b3b8c)
+++ 	(revision )
@@ -1,60 +1,0 @@
-#! /usr/bin/perl
-
-use locale;
-use strict;
-
-if (@ARGV < 3) {
-    print "USAGE: cut_prefs.pl CUT_OFF TOTAL_PER ABS_CUT\n\n";
-    print "Obcina wpisy ma³o wa¿ne, opis nie jest uwzglêdniany\n";
-    print "je¿eli zachodzi jeden z warunków:\n";
-    print " - jezeli liczba wystapien danego opisu jest mniejsza\n";
-    print "   od \$CUT_OFF*(liczba wystapien poprzedniego opisu)\n";
-    print " - jezeli liczba wystapien danego opisu jest mniejsza\n";
-    print "   od \$TOTAL_PER*(suma wszystkich wystapien)\n";
-    print " - jezeli liczba wystapien danego opisu jest mniejsza\n";
-    print "   od \$ABS_CUT\n";
-    exit;
-}
-
-# jezeli liczba wystapien danego opisu jest mniejsza
-# od $CUT_OFF*(liczba wystapien poprzedniego opisu) - opis nie jest uwzgledniany
-my $CUT_OFF = shift;
-
-# jezeli liczba wystapien danego opisu jest mniejsza
-# od $TOTAL_PER*(suma wszystkich wystapien) - opis nie jest uwzgledniany
-my $TOTAL_PER = shift;
-
-# jezeli liczba wystapien danego opisu jest mniejsza
-# od $ABS_CUT - opis nie jest uwzgledniany
-my $ABS_CUT = shift;
-
-my $pref = "";
-my $oldPref = " ";
-my $countTotal = -1;
-my $count = -1;
-
-while (<>) {
-
-    if (($count == -1) && ($_ =~ /^$oldPref\t.*/)) {
-	next;
-    }
-
-    if ($pref =~ //) {
-	$_ =~ /^(\w+)\t.+\t(\d+)\t(\d+)/;
-	$pref = $1;
-	$count = $2;
-	$countTotal = $3;
-#  	print "\$pref=$pref\t\$count=$count\t\$countTotal=$countTotal\n";
-    }
-    $_ =~ /\w+\t.+\t(\d+)\t\d+/;
-    my $c = $1;
-#     print "\$c=$c\t\$CUT_OFF*\$count=$CUT_OFF*$count\t\$TOTAL_PER*\$countTotal=".$TOTAL_PER*$countTotal."\n";
-    if (($CUT_OFF*$count < $c) && ($TOTAL_PER*$countTotal < $c) && ($ABS_CUT < $c)) {
-	$count = $c;
-	print $_;
-    } else {
-	$count = -1;
-	$oldPref = $pref;
-	$pref = "";
-    }
-}
Index: wszelkiwypadek/tools/gue_dic/labels.lab
===================================================================
--- nawszelkiwypadek/tools/gue_dic/labels.lab	(revision f1563c0f0270f57e03d1fba3f2ce99a3828b3b8c)
+++ 	(revision )
@@ -1,95 +1,0 @@
-<epsilon>	0
-a	1
-±	2
-b	3
-c	4
-æ	5
-d	6
-e	7
-ê	8
-f	9
-g	10
-h	11
-i	12
-j	13
-k	14
-l	15
-³	16
-m	17
-n	18
-ñ	19
-o	20
-ó	21
-p	22
-q	23
-r	24
-s	25
-¶	26
-t	27
-u	28
-v	29
-w	30
-x	31
-y	32
-z	33
-Œ	34
-¿	35
-é	36
-ö	37
-ü	38
-ä	39
-A	40
-¡	41
-B	42
-C	43
-Æ	44
-D	45
-E	46
-Ê	47
-F	48
-G	49
-H	50
-I	51
-J	52
-K	53
-L	54
-£	55
-M	56
-N	57
-Ñ	58
-O	59
-Ó	60
-P	61
-Q	62
-R	63
-S	64
-Š	65
-T	66
-U	67
-V	68
-W	69
-X	70
-Y	71
-Z	72
-¬	73
-¯	74
-0	75
-1	76
-2	77
-3	78
-4	79
-5	80
-6	81
-7	82
-8	83
-9	84
-,	85
-.	86
-@	87
-/	88
-'	89
-_	90
-~	91
-;	92
--	93
-\	94
Index: wszelkiwypadek/tools/gue_dic/labels.scl
===================================================================
--- nawszelkiwypadek/tools/gue_dic/labels.scl	(revision f1563c0f0270f57e03d1fba3f2ce99a3828b3b8c)
+++ 	(revision )
@@ -1,356 +1,0 @@
-lcase	1
-lcase	2
-lcase	3
-lcase	4
-lcase	5
-lcase	6
-lcase	7
-lcase	8
-lcase	9
-lcase	10
-lcase	11
-lcase	12
-lcase	13
-lcase	14
-lcase	15
-lcase	16
-lcase	17
-lcase	18
-lcase	19
-lcase	20
-lcase	21
-lcase	22
-lcase	23
-lcase	24
-lcase	25
-lcase	26
-lcase	27
-lcase	28
-lcase	29
-lcase	30
-lcase	31
-lcase	32
-lcase	33
-lcase	34
-lcase	35
-lcase	36
-lcase	37
-lcase	38
-lcase	39
-sem	91
-sem	92
-sem	93
-sem	94
-<sigma>	1
-<sigma>	2
-<sigma>	3
-<sigma>	4
-<sigma>	5
-<sigma>	6
-<sigma>	7
-<sigma>	8
-<sigma>	9
-<sigma>	10
-<sigma>	11
-<sigma>	12
-<sigma>	13
-<sigma>	14
-<sigma>	15
-<sigma>	16
-<sigma>	17
-<sigma>	18
-<sigma>	19
-<sigma>	20
-<sigma>	21
-<sigma>	22
-<sigma>	23
-<sigma>	24
-<sigma>	25
-<sigma>	26
-<sigma>	27
-<sigma>	28
-<sigma>	29
-<sigma>	30
-<sigma>	31
-<sigma>	32
-<sigma>	33
-<sigma>	34
-<sigma>	35
-<sigma>	36
-<sigma>	37
-<sigma>	38
-<sigma>	39
-<sigma>	40
-<sigma>	41
-<sigma>	42
-<sigma>	43
-<sigma>	44
-<sigma>	45
-<sigma>	46
-<sigma>	47
-<sigma>	48
-<sigma>	49
-<sigma>	50
-<sigma>	51
-<sigma>	52
-<sigma>	53
-<sigma>	54
-<sigma>	55
-<sigma>	56
-<sigma>	57
-<sigma>	58
-<sigma>	59
-<sigma>	60
-<sigma>	61
-<sigma>	62
-<sigma>	63
-<sigma>	64
-<sigma>	65
-<sigma>	66
-<sigma>	67
-<sigma>	68
-<sigma>	69
-<sigma>	70
-<sigma>	71
-<sigma>	72
-<sigma>	73
-<sigma>	74
-<sigma>	75
-<sigma>	76
-<sigma>	77
-<sigma>	78
-<sigma>	79
-<sigma>	80
-<sigma>	81
-<sigma>	82
-<sigma>	83
-<sigma>	84
-<sigma>	85
-<sigma>	86
-<sigma>	87
-<sigma>	88
-<sigma>	89
-<sigma>	90
-<sigma>	91
-<sigma>	92
-<sigma>	93
-<sigma>	94
-ucase	40
-ucase	41
-ucase	42
-ucase	43
-ucase	44
-ucase	45
-ucase	46
-ucase	47
-ucase	48
-ucase	49
-ucase	50
-ucase	51
-ucase	52
-ucase	53
-ucase	54
-ucase	55
-ucase	56
-ucase	57
-ucase	58
-ucase	59
-ucase	60
-ucase	61
-ucase	62
-ucase	63
-ucase	64
-ucase	65
-ucase	66
-ucase	67
-ucase	68
-ucase	69
-ucase	70
-ucase	71
-ucase	72
-ucase	73
-ucase	74
-letter	1
-letter	2
-letter	3
-letter	4
-letter	5
-letter	6
-letter	7
-letter	8
-letter	9
-letter	10
-letter	11
-letter	12
-letter	13
-letter	14
-letter	15
-letter	16
-letter	17
-letter	18
-letter	19
-letter	20
-letter	21
-letter	22
-letter	23
-letter	24
-letter	25
-letter	26
-letter	27
-letter	28
-letter	29
-letter	30
-letter	31
-letter	32
-letter	33
-letter	34
-letter	35
-letter	36
-letter	37
-letter	38
-letter	39
-letter	40
-letter	41
-letter	42
-letter	43
-letter	44
-letter	45
-letter	46
-letter	47
-letter	48
-letter	49
-letter	50
-letter	51
-letter	52
-letter	53
-letter	54
-letter	55
-letter	56
-letter	57
-letter	58
-letter	59
-letter	60
-letter	61
-letter	62
-letter	63
-letter	64
-letter	65
-letter	66
-letter	67
-letter	68
-letter	69
-letter	70
-letter	71
-letter	72
-letter	73
-letter	74
-all	1
-all	2
-all	3
-all	4
-all	5
-all	6
-all	7
-all	8
-all	9
-all	10
-all	11
-all	12
-all	13
-all	14
-all	15
-all	16
-all	17
-all	18
-all	19
-all	20
-all	21
-all	22
-all	23
-all	24
-all	25
-all	26
-all	27
-all	28
-all	29
-all	30
-all	31
-all	32
-all	33
-all	34
-all	35
-all	36
-all	37
-all	38
-all	39
-all	40
-all	41
-all	42
-all	43
-all	44
-all	45
-all	46
-all	47
-all	48
-all	49
-all	50
-all	51
-all	52
-all	53
-all	54
-all	55
-all	56
-all	57
-all	58
-all	59
-all	60
-all	61
-all	62
-all	63
-all	64
-all	65
-all	66
-all	67
-all	68
-all	69
-all	70
-all	71
-all	72
-all	73
-all	74
-all	75
-all	76
-all	77
-all	78
-all	79
-all	80
-all	81
-all	82
-all	83
-all	84
-all	85
-all	86
-all	87
-all	88
-all	89
-all	90
-all	91
-all	92
-all	93
-all	94
-digit	75
-digit	76
-digit	77
-digit	78
-digit	79
-digit	80
-digit	81
-digit	82
-digit	83
-digit	84
-signs	85
-signs	86
-signs	87
-signs	88
-signs	89
-signs	90
Index: wszelkiwypadek/tools/gue_dic/labels.sym
===================================================================
--- nawszelkiwypadek/tools/gue_dic/labels.sym	(revision f1563c0f0270f57e03d1fba3f2ce99a3828b3b8c)
+++ 	(revision )
@@ -1,7 +1,0 @@
-lcase	a ± b c æ d e ê f g h i j k l ³ m n ñ o ó p q r s ¶ t u v w x y z Œ ¿ é ö ü ä
-ucase	A ¡ B C Æ D E Ê F G H I J K L £ M N Ñ O Ó P Q R S Š T U V W X Y Z ¬ ¯
-letter	lcase ucase
-digit	0 1 2 3 4 5 6 7 8 9
-signs    , . @ / ' _
-sem	~ ; - \ 
-all	letter digit signs sem
Index: wszelkiwypadek/tools/gue_dic/makeLabels.pl
===================================================================
--- nawszelkiwypadek/tools/gue_dic/makeLabels.pl	(revision f1563c0f0270f57e03d1fba3f2ce99a3828b3b8c)
+++ 	(revision )
@@ -1,11 +1,0 @@
-#!/usr/bin/perl
-
-use locale;
-
-print "lcase	a ± b c æ d e ê f g h i j k l ³ m n ñ o ó p q r s ¶ t u v w x y z Œ ¿ é ö ü ä\n";
-print "ucase	A ¡ B C Æ D E Ê F G H I J K L £ M N Ñ O Ó P Q R S Š T U V W X Y Z ¬ ¯\n";
-print "letter	lcase ucase\n";
-print "digit	0 1 2 3 4 5 6 7 8 9\n";
-print "signs    , . @ \/ \' _\n";
-print "sem	~ ; - \\ \n";
-print "all	letter digit signs sem\n";
Index: wszelkiwypadek/tools/gue_dic/prep.pl
===================================================================
--- nawszelkiwypadek/tools/gue_dic/prep.pl	(revision f1563c0f0270f57e03d1fba3f2ce99a3828b3b8c)
+++ 	(revision )
@@ -1,213 +1,0 @@
-#! /usr/bin/perl
-
-use locale;
-
-$linesPerFile = 20000;
-
-if (@ARGV < 1) {
-    print "usage: prep.pl dictionary_file\n";
-    exit;
-}
-
-$file = shift; # @ARGV;
-$kind = shift;
-
-if ($kind eq "") {
-    $kind="suf";
-}
-
-# Przygotowanie etykiet
-
-`makeLabels.pl > labels.sym`;
-
-`lexmakelab labels`;
-
-# Analiza pliku s³ownika
-
-
-print "Kanonizujê opisy.........................................";
-
-`canon.pl <$file >temp2`;
-
-print "OK\n";
-
-print "Analizuje prefiksy.......................................";
-
-`count_prefs.pl 2 4 < temp2 > prefs`;
-`sort -k1,1 -k3,3nr prefs > prefsS`;
-`cut_prefs.pl 0.5 0.01 100 prefsS > prefs`;
-`rm prefsS`;
-
-print "OK\n";
-
-print "Analizujê plik s³ownika";
-
-if ($kind eq "pre") {
-    print "(pre).............................";
-    `stat_pre.pl temp2 > temp1`;
-} else {
-    print "(suf).............................";
-    `stat.pl prefs < temp2 > temp1`;
-}
-
-print "OK\n";
-
-# zmniejszamy plik...
-
-print "Sortujê plik.............................................";
-
-`sort -t \\~ -k1,1 -k2,2nr <temp1 > temp2`;
-
-print "OK\n";
-
-print "Minimalizujê plik s³ownika...............................";
-
-`rmDup.pl < temp2 > temp1`;
-#`rmDup2.pl < temp1 > temp2`;
-
-`cp temp1 temp2`;
-
-`rm temp1`;
-
-print "OK\n";
-
-#dzielimy plik na wiele czê¶ci, uruchamiamy lexcomplex dla ka¿dej
-#czê¶ci osobno, nastêpnie ³±czymy to za pomoc± programu fsmunion
-
-print "Dzielê s³ownik na mniejsze czê¶ci........................";
-
-open(IN, "./temp2");
-
-$lineCount = 0;
-$fileCount = 0;
-
-`mkdir LemTEMP`;
-
-open(FILE, ">LemTEMP/slo_0");
-
-while (<IN>) {
-
-    if (++$lineCount >= $linesPerFile) {
-	$fileCount++;
-	$lineCount = 0;
-
-	close(FILE);
-#	print "Tworzê nowy plik tymczasowy: slo_".$fileCount."\n";
-	open(FILE, ">LemTEMP/slo_".$fileCount);
-    }
-
-    print(FILE $_);
-}
-
-print "OK\n";
-
-print "Tworzê automaty po¶rednie";
-
-#32 kropki, fileCount plikow
-$filesPerDot = $fileCount/32;
-$files=$filesPerDot;
-$dots=0;
-
-for ($i=0; $i<=$fileCount; $i++) {
-
-    if ($files >= $filesPerDot) {
-	$files = 0;
-	print ".";
-	$dots++;
-    }
-    $files++;
-
-    $command = "lexcomplex -l labels.lab -S labels.scl < LemTEMP/slo_".$i." > LemTEMP/slownik_".$i.".fsm";
-
-    `$command`;
-
-}
-if ($dots < 32) {
-    for ($i=0; $i<32 - $dots; $i++) {
-	print ".";
-    }
-}
-
-print "OK\n";
-
-`rm LemTEMP/slo_*`;
-
-print "Tworzê automat koñcowy";
-
-#35 kropek...
-$filesPerDot = $fileCount/35;
-$files=$filesPerDot;
-$dots=0;
-
-`cp LemTEMP/slownik_0.fsm slownik1.fsm`;
-
-for ($i=1; $i<=$filecount; $i++) {
-
-    if ($files >= $filesPerDot) {
-	$files = 0;
-	print ".";
-	$dots++;
-    }
-    $files++;
-
-    $command = "fsmunion LemTEMP/slownik_".$i." slownik1.fsm > slownik2.fsm";
-
-    `$command`;
-
-    `mv slownik2.fsm slownik1.fsm`;
-}
-
-if ($dots < 35) {
-    for ($i=0; $i<35 - $dots; $i++) {
-	print ".";
-    }
-}
-
-`fsmunion LemTEMP/* > slownik1.fsm`;
-
-print "OK\n";
-
-print "Usuwam epsilon-przejscia.................................";
-
-`fsmrmepsilon slownik1.fsm > slownik2.fsm`;
-
-`rm slownik1.fsm`;
-
-print "OK\n";
-
-print "Determinizujê automat....................................";
-
-`fsmdeterminize slownik2.fsm > slownik1.fsm`;
-
-`rm slownik2.fsm`;
-
-print "OK\n";
-
-print "Minimalizujê automat.....................................";
-
-`fsmminimize slownik1.fsm > slownik.fsm`;
-
-`rm slownik1.fsm`;
-
-print "OK\n";
-
-print "Konwertujê automat do formatu fsa........................";
-
-`fsmprint -i labels.lab slownik.fsm > slownik.txt`;
-
-`../fsm2aut slownik.txt > slownik.aut`;
-
-`../aut2fsa < slownik.aut > gue.bin`;
-
-print "OK\n";
-
-print "Czyszczê pliki pomocnicze................................";
-
-`rm LemTEMP/*`;
-`rmdir LemTEMP`;
-`rm temp2`;
-`rm slownik.fsm`;
-`rm slownik.txt`;
-`rm slownik.aut`;
-
-print "OK\n";
Index: wszelkiwypadek/tools/gue_dic/prep_user_dict.pl
===================================================================
--- nawszelkiwypadek/tools/gue_dic/prep_user_dict.pl	(revision f1563c0f0270f57e03d1fba3f2ce99a3828b3b8c)
+++ 	(revision )
@@ -1,31 +1,0 @@
-#! /usr/bin/env perl
-
-use locale;
-use strict;
-
-##################################################
-# Skrypt transformuje s³ownik u¿ytkownika        #
-# do s³ownika rozumianego przez gue.             #
-# Format wej¶ciowy:                              #
-# pref*kon~waga;opis                             #
-# Format wyj¶ciowy:                              #
-# nok_pref~waga;opis                             #
-#                                                #
-# Prefiks mo¿e byæ pusty, koñcówka te¿           #
-##################################################
-
-while (<>) {
-    /^(\w*)\*(\w*)(~.*)$/;
-    my $pref = $1;
-    my $kon = $2;
-    my $desc = $3;
-
-    print reverse(split("",$kon));
-
-    if ($pref != "") {
-	print "_$pref";
-    }
-    print "$desc\n";
-
-
-}
Index: wszelkiwypadek/tools/gue_dic/rmDup.pl
===================================================================
--- nawszelkiwypadek/tools/gue_dic/rmDup.pl	(revision f1563c0f0270f57e03d1fba3f2ce99a3828b3b8c)
+++ 	(revision )
@@ -1,55 +1,0 @@
-#!/usr/bin/perl
-
-# Usuwa zbêdne powtórzenia scie¿ek
-
-use locale;
-
-#if (@ARGV < 1) {
-#    print "USAGE: remDup.pl num\n\tGdzie \"num\" jest ilo¶ci± powtórzeñ, które zostawiamy\n";
-#    exit(0);
-#}
-
-
-
-#ilo¶æ powtórzeñ, które zostawiamy
-$max = 10;
-
-# przyjmujemy, ze na wej¶ciu znajduje siê plik posortowany,
-# po koñcówkach oraz po prawdopodobieñstwie
-
-$line = <>;
-
-while (($line !~ m/^$/) || ($line =~ m/^\n$/)) {
-
-    $count = 0;
-
-    while ($line =~ m/^\n$/) {
-	$line = <>;
-    }
-
-    $line =~ /^([^~]+)~.*/;
-    $theEnd = $1;
-    $end = $1;
-
-    while (($end =~ m/$theEnd/) && ($count++ < $max)) {
-	print $line;
-	$line = <>;
-	$line =~ /^([^~]+)~.*/;
-	$end = $1;
-    }
-
-    # tutaj mamy dwie mo¿liwo¶ci:
-    # 1. wypisali¶my ju¿ max lini - musimy wywaliæ kolejne linie, które
-    # zawieraj± koñcówkê theEnd,
-    # 2. pasuj±cych lini by³o mniej ni¿ max, wtedy nic nie musimy robiæ
-    # - w zmiennej line znajduje siê kolejna linia...
-
-    if ($count == $max + 1) {
-	while ($oldEnd =~ m/$theEnd/) {
-	    $line = <>;
-	    $line =~ /^([^~]+)~.*/;
-	    $oldEnd = $1;
-	}
-    }
-
-}
Index: wszelkiwypadek/tools/gue_dic/stat.pl
===================================================================
--- nawszelkiwypadek/tools/gue_dic/stat.pl	(revision f1563c0f0270f57e03d1fba3f2ce99a3828b3b8c)
+++ 	(revision )
@@ -1,165 +1,0 @@
-#! /usr/bin/perl
-
-use locale;
-
-######################################################
-# na wej¶ciu znajduje siê plik zawieraj±cy linie     #
-# postaci:                                           #
-# slowo;opis                                         #
-#                                                    #
-# na wyj¶ciu ma siê znaleŒæ plik zawieraj±cy linie:  #
-# koñcówka(rev);prawdopodobieñstwo;opis              #
-# gdzie:                                             #
-# - koñcówka(rev) jest koñcówk± wyrazu zapisan±      #
-#   w odwrotnej kolejno¶ci, dla ka¿dego wyrazu       #
-#   w s³owniku wypisujemy koñcówki o d³ugo¶ciach     #
-#   od 1 do d³ugo¶ci wyrazu,                         #
-# - prawdopodobieñstwo jest prawdopodobieñstwem      #
-#   wyst±pienia danego opisu dla danej koñcówki      #
-#   (obliczonym na podstwie statystycznej analizy    #
-#   s³ownika), np: 250 oznacza, ze opis popjawia sie #
-#   1 raz na 4 wyst±pienia koñcówki.                 #
-#   Zapisana zostaje odwrotno¶æ prawdopodobieñstwa   #
-#   aby scie¿ka najbardziej prawdopodobna mia³a      #
-#   najmniejszy koszt.                               #
-######################################################
-
-######
-#STALE
-#
-# Jak bardzo prawdopodobna musi byæ dana ¶cie¿ka, aby
-# braæ j± pod uwagê? (w promilach)
-$MIN_PROB = 0;
-#
-# Maksymalna ilo¶æ powtórzeñ danej koñcówki (brane od
-# najbardziej prawdopodbnej w dó³
-$MAX_PATH = 10;
-#
-# Znak odzielajacy koncowke od prefiksu
-$PREF_SIGN = '_';
-######
-# Zmienne globalne
-# 
-# Tablica okreslajaca, ktore prefiksy nalezy uwzlednic
-# w wyjsciowym pliku.
-# Klucz - ciag znakow prefiks$PREF_SIGNopis.
-#  Wartosc: 1 - jezeli nalezy uwzglednic, 0 w przeciwnym przypadku
-my %prefs;
-#
-# maksymalna dlugosc analizowanego prefiksu
-my $MAX_PREF = 0;
-######
-
-###########################################################
-# FUNKCJE
-
-# wczytuje prefiksy do tablicy hashowej
-# parametry:
-# - nazwa pliku, z ktorego nalezy pobrac prefiksy
-#   Plik w formacie:
-#   prefiks\topis...\n
-sub load_prefs {
-
-    my $file = shift;
-    open(IN, $file);
-
-    while (<IN>) {
-	$_ =~ /^(\w+)\t([^\t]+)\t/;
-	my $key = "$1$PREF_SIGN$2";
-	my $len = length($1);
-	if ($len > $MAX_PREF) {
-	    $MAX_PREF = $len;
-	}
-	$prefs{$key} = 1;
-    }
-}
-
-###########################################################
-
-# Jezeli podano parametr to jest to nazwa pliku z prefiksami
-
-if (@ARGV > 0) {
-#    print "Laduje prefiksy ($ARGV[0])\n";
-    load_prefs(shift);
-#     print "Zaladowane:\n";
-#     for $key (keys(%prefs)) {
-# 	print "$key\t$prefs{$key}\n";
-#     }
-#     print "++++++++++++++++++++++++++++++++++++++++++++++++++\n";
-}
-
-@input = <>;
-
-#$max = 0;
-
-#for $m (@input) {
-#    $m =~ /(\w+);.*$/;
-#    if (length($1) > $max) {
-#	$max = length($1);
-#    }
-#}
-
-$n = 2; #$max; 
-
-$go = 1;
-
-while ($go) {
-
-    my %koncowki;
-    my $sumy;
- 
-    $go = 0;
-    for $m (@input) {
-	if ($m =~ /(\w{$n});(.*)$/) {
-	    $go = 1;
-	    my $ending = $1;
-	    my $desc = $2;
-	    for (my $i=$MAX_PREF; $i>0; $i--) {
-		$m =~ /^(\w{$i}).*/;
-		my $key = "$1$PREF_SIGN$desc";
-		if ($prefs{$key} == 1) {
-		    $ending .= "$PREF_SIGN$1";
-		    last;
-		}
-	    }
-	    $koncowki{$ending.";".$desc}++;
-	    $sumy{$ending}++;
-	}
-    }
-
-    print "\n";
- 
-    for $koncowka (keys %koncowki) {
-	$koncowka =~ /^(.*);(.*)$/;
-	my $ending = $1;
-	my $opis = $2;
-	$p = $koncowki{$koncowka} / $sumy{$ending};
-        $p *= 1000;                     #wartosc w promilach
-
-	if ($p <= $MIN_PROB) {
-	    next;
-	}
-
-	#if ($p == 1000) {
-	#    $p--;
-	#}
-
-        #$p = 1000 - $p;                 #odwrotnosc
-	my $old = $2;
-	$ending =~ /^(\w+)$PREF_SIGN(\w+)/;
-
-	my $rev = reverse($1);
-
-	if ($2 !~ /^$old$/) {
-	    $rev .= "$PREF_SIGN$2";
-	}
-
-	# opakowujemy znak '-' znakami [] ;) dla lextools
-	$opis =~ s/-/\[-\]/;
-
-	printf "%s~%.0f;%s\n", $rev, $p, $opis;
-    }
-
-  $n++;
-
-}
Index: wszelkiwypadek/tools/gue_dic/stat_pre.pl
===================================================================
--- nawszelkiwypadek/tools/gue_dic/stat_pre.pl	(revision f1563c0f0270f57e03d1fba3f2ce99a3828b3b8c)
+++ 	(revision )
@@ -1,95 +1,0 @@
-#! /usr/bin/perl
-
-use locale;
-
-######################################################
-# na wej¶ciu znajduje siê plik zawieraj±cy linie     #
-# postaci:                                           #
-# slowo;opis                                         #
-#                                                    #
-# na wyj¶ciu ma siê znaleŒæ plik zawieraj±cy linie:  #
-# koñcówka(rev);prawdopodobieñstwo;opis              #
-# gdzie:                                             #
-# - koñcówka(rev) jest koñcówk± wyrazu zapisan±      #
-#   w odwrotnej kolejno¶ci, dla ka¿dego wyrazu       #
-#   w s³owniku wypisujemy koñcówki o d³ugo¶ciach     #
-#   od 1 do d³ugo¶ci wyrazu,                         #
-# - prawdopodobieñstwo jest prawdopodobieñstwem      #
-#   wyst±pienia danego opisu dla danej koñcówki      #
-#   (obliczonym na podstwie statystycznej analizy    #
-#   s³ownika), np: 250 oznacza, ze opis popjawia sie #
-#   1 raz na 4 wyst±pienia koñcówki.                 #
-#   Zapisana zostaje odwrotno¶æ prawdopodobieñstwa   #
-#   aby scie¿ka najbardziej prawdopodobna mia³a      #
-#   najmniejszy koszt.                               #
-######################################################
-
-######
-#STALE
-#
-# Jak bardzo prawdopodobna musi byæ dana ¶cie¿ka, aby
-# braæ j± pod uwagê? (w promilach)
-$MIN_PROB = 0;
-#
-# Maksymalna ilo¶æ powtórzeñ danej koñcówki (brane od
-# najbardziej prawdopodbnej w dó³
-$MAX_PATH = 10;
-#
-######
-
-@input = <>;
-
-#$max = 0;
-
-#for $m (@input) {
-#    $m =~ /(\w+);.*$/;
-#    if (length($1) > $max) {
-#	$max = length($1);
-#    }
-#}
-
-$n = 1; #$max; 
-
-$go = 1;
-
-while ($n<7) {
-
-    my %prefiksy;
-    my $sumy;
- 
-    $go = 0;
-    for $m (@input) {
-	if ($m =~ /^(\w{$n})\w*;(.*)$/) {
-	    $go = 1;
-	    $prefiksy{$1.";".$2}++;
-	    $sumy{$1}++;
-	}
-    }
-
-    print "\n";
- 
-    for $prefiks (keys %prefiksy) {
-	$prefiks =~ /^(.*);(.*)$/;
-	$p = $prefiksy{$prefiks} / $sumy{$1};
-        $p *= 1000;                     #wartosc w promilach
-
-	if ($p <= $MIN_PROB) {
-	    next;
-	}
-
-	#if ($p == 1000) {
-	#    $p--;
-	#}
-
-        $p = 1000 - $p;                 #odwrotnosc
-#	$rev = reverse($1);
-	# opakowujemy znak '-' znakami [] ;)
-	$opis = $2;
-	$opis =~ s/-/\[-\]/;
-
-	printf "%s~%.0f;%s\n", $1, $p, $opis;
-    }
-
-  $n++;
-
-}
Index: wszelkiwypadek/tools/lem_dic/makeLabels.pl
===================================================================
--- nawszelkiwypadek/tools/lem_dic/makeLabels.pl	(revision f1563c0f0270f57e03d1fba3f2ce99a3828b3b8c)
+++ 	(revision )
@@ -1,11 +1,0 @@
-#!/usr/bin/perl
-
-use locale;
-
-print "lcase	a ± b c æ d e ê f g h i j k l ³ m n ñ o ó p q r s ¶ t u v w x y z Œ ¿ é ö ü ä\n";
-print "ucase	A ¡ B C Æ D E Ê F G H I J K L £ M N Ñ O Ó P Q R S Š T U V W X Y Z ¬ ¯\n";
-print "letter	lcase ucase\n";
-print "digit	0 1 2 3 4 5 6 7 8 9\n";
-print "signs    , . @ \/ \'\n";
-print "sem	~ ; _ - + ? \\ \n";
-print "all	letter digit signs sem\n";
Index: wszelkiwypadek/tools/lem_dic/prep.pl
===================================================================
--- nawszelkiwypadek/tools/lem_dic/prep.pl	(revision f1563c0f0270f57e03d1fba3f2ce99a3828b3b8c)
+++ 	(revision )
@@ -1,75 +1,0 @@
-#! /usr/bin/perl
-
-use locale;
-use strict;
-
-my $file = shift;
-my $filename;
-
-if ($file eq "") {
-    print "Podaj nazwê pliku.\n";
-    exit(1);
-}
-
-if ($file =~ /(.*)\.dic/)
-{
-    $filename = $1;
-}
-else
-{
-    print "The input file must have .dic extension.";
-    exit(1);
-}
-
-`makeLabels.pl > labels.sym`;
-
-`lexmakelab labels`;
-
-print "Kanonizujê opisy.........................................";
-
-#`canon.pl <$file >temp2`;
-
-print "Kompilujê automat........................................";
-
-`lexcomplex -l labels.lab -S labels.scl <$file > temp1`;
-
-print "OK\n";
-
-print "Usuwam epsilon-przejscia.................................";
-
-`fsmrmepsilon temp1> temp2`;
-
-print "OK\n";
-
-print "Determinizujê automat....................................";
-
-`fsmdeterminize temp2 > temp1`;
-
-print "OK\n";
-
-print "Minimalizujê automat.....................................";
-
-`fsmminimize temp1> temp2`;
-
-print "OK\n";
-
-print "Konwertujê automat do formatu fsa........................";
-
-`fsmprint -i labels.lab temp2> temp1`;
-
-`cp temp1 pofsmprint`;
-
-`../fsm2aut temp1> temp2`;
-
-`./aut2fsa.nowy < temp2> $filename.bin`;
-
-print "OK\n";
-
-print "Czyszczê pliki pomocnicze................................";
-
-`rm temp2`;
-`rm temp1`;
-#`rm labels.*`;
-
-print "OK\n";
-
Index: w/authors.php
===================================================================
--- www/authors.php	(revision 843c58d4aac937f49b9312f045b6540f2c3734f9)
+++ 	(revision )
@@ -1,10 +1,0 @@
-<?php
-require_once 'locale.php';
-require_once 'cmn_frame.php';
-
-$title = '<title>UAM Text Tools - '.AUTHORS_TITLE."</title>\n";
-$context = AUTHORS_CONTENT;
-
-getMainPage($title, $context);
-
-?>
Index: w/cmn_frame.php
===================================================================
--- www/cmn_frame.php	(revision 843c58d4aac937f49b9312f045b6540f2c3734f9)
+++ 	(revision )
@@ -1,57 +1,0 @@
-<?php
-
-require_once 'locale.php';
-
-function getMainPage($header, $content) {
-  echo "<html><head>\n";
-  echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-2\">\n";
-  echo "<link type='text/css' href='css/utt.css' rel='stylesheet'>\n";
-  echo "<script type=\"text/javascript\" src=\"js/menu.js\"></script>\n";
-  if(isset($header)) {
-	# jesli pominieto znacznik tytulu - dodajemy sami
-	if (stristr($header, '<title>') === false) {
-	  	echo '<title>'.DEFAULT_PAGE_TITLE."</title>\n";
-	}
-    echo $header;
-  }
-  else {
-  	echo '<title>'.DEFAULT_PAGE_TITLE."</title>\n";
-  }
-  echo "</head>\n";
-  echo "<body>\n";
-  echo "<table class=\"page_table\">\n";
-  echo "<tr>\n";
-  echo "  <td class=\"page_title\" colspan=\"3\">".PAGE_HEADER."</td>\n";
-  echo "</tr>\n";
-  echo "<tr>\n";
-  echo "  <td class=\"page_menu\">\n";
-  echo "    <table class=\"main_menu\" align=\"center\" cellspacing=\"1\">\n";
-  $menu = array("index.php" => MENU_MAIN_PAGE,
-  		        "help.php" => MENU_HELP,
-				"licence.php" => MENU_LICENSE,
-				"authors.php" => MENU_AUTHORS,
-				"down.php" => MENU_DOWNLOADS);
-
-  foreach($menu as $page=>$descr) {
-	  echo "      <tr>\n";
-	  echo "        <td class=\"main_menu_cell\"\n";
-	  echo "			   onMouseOver=\"return menu_select_element(this, true);\"\n";
-	  echo "			   onMouseOut=\"return menu_select_element(this, false);\"\n";
-	  echo "			   onClick=\"window.location='".$page."'; return true;\"\n";
-	  echo "        >\n";
-	  echo          $descr."\n";
-	  echo "        </td>\n";
-	  echo "      </tr>\n";
-  }
-  echo "      </table>\n";
-  echo "	</td>\n";
-  echo "    <td class=\"page_content\">\n";
-  echo $content;
-  echo "	</td>\n";
-  echo "    <td class=\"page_left_margin\">&nbsp;</td>\n";
-  echo "  </tr>\n";
-  echo "</table>\n";
-  echo "</body></html>\n";
-}
-
-?>
Index: w/css/utt.css
===================================================================
--- www/css/utt.css	(revision 843c58d4aac937f49b9312f045b6540f2c3734f9)
+++ 	(revision )
@@ -1,105 +1,0 @@
-BODY {
-  FONT-FAMILY: Verdana, Arial, Helvetica;
-  FONT-SIZE: 13px;
-  background-color: #CCFF99;
-/*
-#FFF8DC pomaranczowy
-#F5F5DC be¿owy
-#F0F8FF jasnoniebieski
-
-  font-style: italic;
-  font-weight: bold;
-  text-decoration: underline;
-*/
-}
-
-.page_table {
-  width: 100%;
-  border: 0px solid black;
-  margin-top: 30px;
-}
-
-.page_title {
-  text-align: center;
-  font-size: 30px;
-  font-weight: bold;
-  padding-bottom: 20px;
-}
-
-.page_menu {
-  width: 20%;
-  vertical-align: top;
-}
-
-.main_menu {
- border: 0 solid black;
- width: 80%;
-}
-
-.main_menu_cell {
-  border-width:2px;
-  border-style: outset;
-/*  text-align: center; */
-/*  margin-left: 200px; */
-  padding-left: 10px;
-  font-weight: bold;
-  color: #006600; /*#336600;*/
-  text-decoration: none;
-  font-family: monospace;
-}
-
-.page_content {
-  vertical-align: top;
-  padding: 10px;
-  background-color: #FFFFFF;
-  height: 400px;
-}
-
-.page_left_margin {
-  width: 10%;
-}
-
-.distribution {
-/*  padding: 30px; */
-/*  margin: 30px; */
-  border-spacing: 10px;
-}
-
-.distribution .app, .distribution .dict {
-  border-spacing: 10px;
-}
-
-.distribution .product {
-/*  background-color: #CCCC66;*/
-  font-size: larger;
-  text-transform: capitalize;
-  font-weight: bold;
-}
-
-.distribution .product td {
-  border-bottom: solid 2px #669933;
-}
-
-.distribution .dist_type {
-/*  background-color: orange; */
-  font-family: Courier New; /* monospace;*/
-  text-transform: uppercase;
-  font-size: smaller;
-  border-bottom: solid 1px #669933;
-  width: 30%;
-}
-
-.distribution .dist_item {
-  font-size: smaller;
-  vertical-align: top;
-}
-
-.distribution .dist_item img {
-  width: 16px;
-  vertical-align: bottom;
-}
-
-.distribution .dist_item a {
-  text-decoration: none;
-  color: blue;
-}
Index: w/dbconst.php
===================================================================
--- www/dbconst.php	(revision 843c58d4aac937f49b9312f045b6540f2c3734f9)
+++ 	(revision )
@@ -1,9 +1,0 @@
-<?php
-
-define('DB_HOST', 'mysql.amu.edu.pl');
-define('DB_NAME', 'utt');
-define('DB_USER', 'utt');
-define('DB_PASSWD', 'bazadanych');
-define('DB_CHARSET', 'utf8');
-
-?>
Index: w/down.php
===================================================================
--- www/down.php	(revision 843c58d4aac937f49b9312f045b6540f2c3734f9)
+++ 	(revision )
@@ -1,92 +1,0 @@
-<?php
-require_once 'locale.php';
-require_once 'cmn_frame.php';
-
-$archiwa = array('utt' => array(),
-                 'utt-dict' => array()
-                );
-
-$dn = "files/";
-if ($dh = opendir($dn)) {
-	while (($file = readdir($dh)) !== false) {
-		if(true == is_file($dn.$file)) {
-			if(preg_match('/^utt\-dict\-.+?\.(.+)$/', $file, $dopasowania)) {
-				$arch_type = $dopasowania[1];
-				if(! array_key_exists($arch_type, $archiwa['utt-dict'])) {
-                   $archiwa['utt-dict'][$arch_type] = array();
-				}
-				$archiwa['utt-dict'][$arch_type][] = $file;
-			}
-			else if(preg_match('/^utt\-\d.+?\.(.+)$/', $file, $dopasowania)) {
-				$arch_type = $dopasowania[1];
-				if(! array_key_exists($arch_type, $archiwa['utt'])) {
-                   $archiwa['utt'][$arch_type] = array();
-				}
-				$archiwa['utt'][$arch_type][] = $file;
-			}
-		} // if is file
-	} // while
-	closedir($dh);
-} // if opendir
-//print_r($archiwa);
-
-$title = '<title>UAM Text Tools - '.DOWNLOAD_SELECTFILE_PAGE_TITLE."</title>\n";
-
-$content = "<p>".DOWNLOAD_SELECTFILE_CAPTION.":</p>\n";
-$content .= '<table class="distribution" width="100%">';
-# aplikacja
-$content .= '<tr class="product"><td>'.DOWNLOAD_SELECTFILE_APP_CAPTION."</td></tr>\n";
-$content .= '<tr><td>';
-if(count(array_keys($archiwa['utt'])) > 0) {
-	$content .= '<table class="app" width="100%">';
-	$content .= "\n";
-	foreach (array_keys($archiwa['utt']) as $dist_type) {
-		$content .= '<tr><td class="dist_type">'.DOWNLOAD_SELECTFILE_DISTRIBUTION_TYPE." $dist_type</td><td>&nbsp;</td></tr>\n";
-		$content .= "<tr><td colspan='2'>\n<table width='100%'>";
-		$arr = $archiwa['utt'][$dist_type];
-		rsort($arr);
-		foreach($arr as $app) {
-			$content .= "<tr>\n<td class=\"dist_item\">\n";
-			$content .= "<a href=\"down_form.php?filename=".$app."\">";
-			$content .= "<img src=\"im/down.jpg\" border=\"0\" />";
-			$content .= $app."</a> (".(filesize($dn.$app)/1024)." KB)\n";
-			$content .= "</td></tr>\n";
-		}
-		$content .= "</table>\n</td></tr>\n";
-	}
-	$content .= "</table>\n";
-}
-else {
-	$content .= DOWNLOAD_SELECTFILE_NO_FILE."\n";
-}
-
-# slowniki
-$content .= '<tr class="product"><td>'.DOWNLOAD_SELECTFILE_DICT_CAPTION."</td></tr>\n";
-$content .= '<tr><td>';
-if(count(array_keys($archiwa['utt-dict'])) > 0) {
-	$content .= '<table class="dict" width="100%">';
-	$content .= "\n";
-	foreach (array_keys($archiwa['utt-dict']) as $dist_type) {
-		$content .= '<tr><td class="dist_type">'.DOWNLOAD_SELECTFILE_DISTRIBUTION_TYPE." $dist_type</td><td>&nbsp;</td></tr>\n";
-		$content .= "<tr><td colspan='2'>\n<table width='100%'>";
-		$arr = $archiwa['utt-dict'][$dist_type];
-		rsort($arr);
-		foreach($arr as $dict) {
-			$content .= "<tr>\n<td class=\"dist_item\">\n";
-			$content .= "<a href=\"down_form.php?filename=".$dict."\">";
-			$content .= "<img src=\"im/down.jpg\" border=\"0\" />";
-			$content .= $dict."</a> (".(filesize($dn.$dict)/1024)." KB)\n";
-			$content .= "</td></tr>\n";
-		}
-		$content .= "</table>\n</td></tr>\n";
-	}
-	$content .= "</table>\n";
-}
-else {
-	$content .= DOWNLOAD_SELECTFILE_NO_FILE."\n";
-}
-$content .= '</td></tr></table>';
-$content .= "\n";
-
-getMainPage($title, $content);
-?>
Index: w/down_form.php
===================================================================
--- www/down_form.php	(revision 843c58d4aac937f49b9312f045b6540f2c3734f9)
+++ 	(revision )
@@ -1,24 +1,0 @@
-<?php
-require_once 'locale.php';
-require_once 'cmn_frame.php';
-
-  if(isset($_GET['filename'])) {
-	$title = '<title>UAM Text Tools - '.DOWNLOAD_FORM_PAGE_TITLE."</title>\n";
-
-	$content = "<h3>".DOWNLOAD_FORM_CAPTION."</h3>\n".
-	    "<table border='1' align='center'><form action='down_thanks.php' method='post'>\n".
-	  	"<tr><td>".DOWNLOAD_FORM_FIELD_FIRSTNAME.":</td><td><input type='text' name='_firstname' value=''></td></tr>\n".
-	  	"<tr><td>".DOWNLOAD_FORM_FIELD_NAME.":</td><td><input type='text' name='_name' value=''></td></tr>\n".
-	  	"<tr><td>".DOWNLOAD_FORM_FIELD_ORGANIZATION.":</td><td><input type='text' name='_organization' value=''></td></tr>\n".
-	  	"<tr><td>".DOWNLOAD_FORM_FIELD_COUNTRY.":</td><td><input type='text' name='_country' value=''></td></tr>\n".
-	  	"<tr><td>".DOWNLOAD_FORM_FIELD_EMAIL.":</td><td><input type='text' name='_email' value=''></td></tr>\n".
-	  	"<tr><td colspan='2' align=\"center\">\n".
-	  	        "<input type='submit' value='".DOWNLOAD_FORM_FIELD_NEXT." &gt;'></td></tr>\n".
-	    "<input type=\"hidden\" name='_filename' value=\"".$_GET['filename']."\">\n".
-	  	"</form></table>\n";
-	getMainPage($title, $content);
-  }
-  else {
-    header('Location: http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/down.php');
-  }
-?>
Index: w/down_thanks.php
===================================================================
--- www/down_thanks.php	(revision 843c58d4aac937f49b9312f045b6540f2c3734f9)
+++ 	(revision )
@@ -1,63 +1,0 @@
-<?php
-
-  require_once 'locale.php';
-  require_once 'dbconst.php';
-  require_once 'cmn_frame.php';
-
-function _wu($text) {
-  return iconv("cp1250", "utf-8", $text);
-}
-
-function save_user() {
-  $firstname = isset($_POST['_firstname']) ? _wu($_POST['_firstname']) : 'NULL';
-  $name = isset($_POST['_name']) ? _wu($_POST['_name']) : 'NULL';
-  $organization = isset($_POST['_organization']) ? _wu($_POST['_organization']) : 'NULL';
-  $country = isset($_POST['_country']) ? _wu($_POST['_country']) : 'NULL';
-  $email = isset($_POST['_email']) ? _wu($_POST['_email']) : 'NULL';
-  $ip = $_SERVER['REMOTE_ADDR'];
-  $filename = _wu($_POST['_filename']);
-  $now = date("Y-m-d H:i:s");
-
-  $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWD)
-          or die (DB_ERROR.': '.mysql_error().' ('.mysql_errno().')');
-
-  mysql_select_db (DB_NAME)
-  or die (DB_ERROR.': '.mysql_error().' ('.mysql_errno().')');
-
-  /* Ustawiamy kodowanie */
-  mysql_query("SET NAMES '".DB_CHARSET."'")
-  or die (DB_ERROR.': '.mysql_error().' ('.mysql_errno().')');
-
-  $sql = "INSERT INTO `utt_downloaders`(`firstname`, `name`, ".
-  	   	 		 "`organization`, `country`, `email`, ".
-  				 "`ip`, `filename`, `date`) ".
-  	     "VALUES('$firstname', '$name', ".
-				 "'$organization', '$country', '$email', ".
-				 "'$ip', '$filename', '$now')";
-//echo "Execute query: $sql<br />\n";
-  mysql_query($sql)
-  or die(DB_ERROR.': '.mysql_error().' ('.mysql_errno().')');
-
-  mysql_close($link);
-}
-
-
-// main part
-//  print_r($_SERVER);
-//  print_r($_POST);
-  if(isset($_POST['_filename'])) {
-    save_user();
-    $head = '<title>UAM Text Tools - '.DOWNLOAD_THANKS_PAGE_TITLE."</title>\n";
-    $head .= "<meta HTTP-EQUIV=\"REFRESH\" content=\"5; url=files/".$_POST['_filename']."\">\n";
-	$content = DOWNLOAD_THANKS_CAPTION."<br />\n".
-    		   "<br />".DOWNLOAD_THANKS_EXTRA_LINK.
-			   " <a href=\"files/".$_POST['_filename']."\">".$_POST['_filename']."</a>.<br />\n".
-			   "<a href=index.php>".DOWNLOAD_THANKS_MAINPAGE_LINK."</a>\n";
-
-     getMainPage($head, $content);
-  }
-  else {
-    header('Location: http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/down.php');
-  }
-
-?>
Index: w/help.php
===================================================================
--- www/help.php	(revision 843c58d4aac937f49b9312f045b6540f2c3734f9)
+++ 	(revision )
@@ -1,10 +1,0 @@
-<?php
-require_once 'locale.php';
-require_once 'cmn_frame.php';
-
-$title = '<title>UAM Text Tools - '.HELP_PAGE_TITLE."</title>\n";
-$context = HELP_PAGE_CONTENT;
-
-getMainPage($title, $context);
-
-?>
Index: w/index.php
===================================================================
--- www/index.php	(revision 843c58d4aac937f49b9312f045b6540f2c3734f9)
+++ 	(revision )
@@ -1,10 +1,0 @@
-<?php
-require_once 'locale.php';
-require_once 'cmn_frame.php';
-
-$title = '<title>UAM Text Tools - '.MAIN_PAGE_TITLE."</title>\n";
-$context = "<p><img src=\"im/uam.jpg\" title=\"God³o UAM\" alt=\"uam logo\" align=\"right\" /></p>\n".MAIN_PAGE_CONTENT;
-
-getMainPage($title, $context);
-
-?>
Index: w/js/menu.js
===================================================================
--- www/js/menu.js	(revision 843c58d4aac937f49b9312f045b6540f2c3734f9)
+++ 	(revision )
@@ -1,13 +1,0 @@
-function menu_select_element(el_menu, is_selected) {
-
-  if(is_selected) {
-    el_menu.style.background = '#00FF66';
-    el_menu.style.cursor = 'hand';  // for IE
-    el_menu.style.cursor = 'pointer';
-  }
-  else {
-    el_menu.style.background = '#CCFF99';
-    el_menu.style.cursor = 'default';
-  }
-  return true;
-}
Index: w/lang/locale.en
===================================================================
--- www/lang/locale.en	(revision 843c58d4aac937f49b9312f045b6540f2c3734f9)
+++ 	(revision )
@@ -1,6 +1,0 @@
-<?php
-/**
- * Plik z etykietami po angielsku.
- */
-
-?>
Index: w/lang/locale.pl
===================================================================
--- www/lang/locale.pl	(revision 843c58d4aac937f49b9312f045b6540f2c3734f9)
+++ 	(revision )
@@ -1,83 +1,0 @@
-<?php
-/**
- * Plik z etykietami po polsku.
- */
-
-# komunikaty o bledach
-define('DB_ERROR', 'B³±d bazy danych');
-
-# elementy wspolne dla stron
-define('DEFAULT_PAGE_TITLE', 'UAM Text Tools Homepage');
-define('PAGE_HEADER', 'UAM Text Tools');
-define('MENU_MAIN_PAGE', 'Strona g³ówna');
-define('MENU_HELP', 'Pomoc');
-define('MENU_LICENSE', 'Licencja');
-define('MENU_AUTHORS', 'O autorach');
-define('MENU_DOWNLOADS', 'Do pobrania');
-define('MENU_DOWNLOAD_LINK', 'Pobierz plik');
-
-# strona glowna
-define('MAIN_PAGE_TITLE', 'Strona g³ówna');
-define('MAIN_PAGE_CONTENT', "<p>\n".
-	  	 "Witamy na naszej stronie.\n".
-	  	 "</p>\n".
-	  	 "<p>O stronie<br />\n".
-	     "Budowanie stron, ze wzglêdu na to, ¿e ka¿da przegl±darka na swój specyficzny sposób reaguje na niektóre polecenia, nie jest wcale proste. Nie wystarczy tylko tworzyæ zgodnie ze standardami, ale trzeba tak¿e zatroszczyæ siê o to, ¿eby w starszych przegl±darkach, ci±gle u¿ywanych (przede wszystkim Internet Explorer), strona prezentowa³a siê dobrze.</p>\n".
-	  	 "<p>Celem powstania tej strony by³o zebranie wszystkich aktualnych informacji dotycz±cych jêzyków HTML, XHTML, CSS oraz DOM w jednym miejscu. Znajdziesz tutaj zarówno informacje typowe, z oficjalnych specyfikacji, ale tak¿e, w formie ciekawostki, liczne rozszerzenia przegl±darek.</p>\n".
-	  	 "<p>W chwili obecnej znajduj± siê tutaj informacje o 119 znacznikach HTML oraz 187 atrybutach stylów. W przysz³o¶ci systematycznie bêd± dodawane polecenia ze specyfikacji XHTML 2.0, Web Applications 1.0 oraz CSS 3.0</p>\n".
-	  	 "<p>Polecane: Profesjonalne tworzenie stron www</p>\n");
-
-# O autorach
-define('AUTHORS_TITLE', 'O autorach');
-define('AUTHORS_CONTENT', "<p>Tu bêdziemy my!</p>\n");
-
-# Do pobrania 1/3
-define('DOWNLOAD_SELECTFILE_PAGE_TITLE', 'Do pobrania 1/3');
-define('DOWNLOAD_SELECTFILE_CAPTION', 'Dostêpne w archiwum pliki');
-define('DOWNLOAD_SELECTFILE_NO_FILE', '<strong>B³±d!</strong> Nie znaleziono ¿adnego pliku!');
-define('DOWNLOAD_SELECTFILE_APP_CAPTION', 'Dostêpne wersje narzêdzi UTT');
-define('DOWNLOAD_SELECTFILE_DICT_CAPTION', 'Dostêpne wersje s³owników');
-define('DOWNLOAD_SELECTFILE_DISTRIBUTION_TYPE', 'Dystrybucja');
-
-# Do pobrania 2/3
-define('DOWNLOAD_FORM_PAGE_TITLE', 'Do pobrania 2/3');
-define('DOWNLOAD_FORM_CAPTION', 'Przed pobraniem pliku wype³nij poni¿szy formularz');
-define('DOWNLOAD_FORM_FIELD_FIRSTNAME', 'Imiê');
-define('DOWNLOAD_FORM_FIELD_NAME', 'Nazwisko');
-define('DOWNLOAD_FORM_FIELD_ORGANIZATION', 'Organizacja');
-define('DOWNLOAD_FORM_FIELD_COUNTRY', 'Kraj');
-define('DOWNLOAD_FORM_FIELD_EMAIL', 'Adres emailowy');
-define('DOWNLOAD_FORM_FIELD_NEXT', 'Dalej');
-
-# Do pobrania 3/3
-define('DOWNLOAD_THANKS_PAGE_TITLE', 'Do pobrania 3/3');
-define('DOWNLOAD_THANKS_CAPTION', 'Dziêkujemy za zainteresowanie narzêdziami UTT!');
-define('DOWNLOAD_THANKS_EXTRA_LINK', 'Je¶li pobieranie pliku nie rozpoczê³o siê automatycznie, kliknij link');
-define('DOWNLOAD_THANKS_MAINPAGE_LINK', 'Wróæ do Strony g³ównej');
-
-# Pomoc
-define('HELP_PAGE_TITLE', 'Pomoc');
-define('HELP_PAGE_CONTENT', "<p>\n".
-	  "Pomocy!!!
-	  </p>
-	  <p>O stronie<br />
-	     Budowanie stron, ze wzglêdu na to, ¿e ka¿da przegl±darka na swój specyficzny sposób reaguje na niektóre polecenia, nie jest wcale proste. Nie wystarczy tylko tworzyæ zgodnie ze standardami, ale trzeba tak¿e zatroszczyæ siê o to, ¿eby w starszych przegl±darkach, ci±gle u¿ywanych (przede wszystkim Internet Explorer), strona prezentowa³a siê dobrze.</p>
-	  <p>Celem powstania tej strony by³o zebranie wszystkich aktualnych informacji dotycz±cych jêzyków HTML, XHTML, CSS oraz DOM w jednym miejscu. Znajdziesz tutaj zarówno informacje typowe, z oficjalnych specyfikacji, ale tak¿e, w formie ciekawostki, liczne rozszerzenia przegl±darek.</p>
-	  <p>W chwili obecnej znajduj± siê tutaj informacje o 119 znacznikach HTML oraz 187 atrybutach stylów. W przysz³o¶ci systematycznie bêd± dodawane polecenia ze specyfikacji XHTML 2.0, Web Applications 1.0 oraz CSS 3.0</p>
-	  <p>Polecane: Profesjonalne tworzenie stron www</p>
-	  <p>O stronie<br />
-	     Budowanie stron, ze wzglêdu na to, ¿e ka¿da przegl±darka na swój specyficzny sposób reaguje na niektóre polecenia, nie jest wcale proste. Nie wystarczy tylko tworzyæ zgodnie ze standardami, ale trzeba tak¿e zatroszczyæ siê o to, ¿eby w starszych przegl±darkach, ci±gle u¿ywanych (przede wszystkim Internet Explorer), strona prezentowa³a siê dobrze.</p>
-	  <p>Celem powstania tej strony by³o zebranie wszystkich aktualnych informacji dotycz±cych jêzyków HTML, XHTML, CSS oraz DOM w jednym miejscu. Znajdziesz tutaj zarówno informacje typowe, z oficjalnych specyfikacji, ale tak¿e, w formie ciekawostki, liczne rozszerzenia przegl±darek.</p>
-	  <p>W chwili obecnej znajduj± siê tutaj informacje o 119 znacznikach HTML oraz 187 atrybutach stylów. W przysz³o¶ci systematycznie bêd± dodawane polecenia ze specyfikacji XHTML 2.0, Web Applications 1.0 oraz CSS 3.0</p>
-	  <p>Polecane: Profesjonalne tworzenie stron www</p>
-	  <p>O stronie<br />
-	     Budowanie stron, ze wzglêdu na to, ¿e ka¿da przegl±darka na swój specyficzny sposób reaguje na niektóre polecenia, nie jest wcale proste. Nie wystarczy tylko tworzyæ zgodnie ze standardami, ale trzeba tak¿e zatroszczyæ siê o to, ¿eby w starszych przegl±darkach, ci±gle u¿ywanych (przede wszystkim Internet Explorer), strona prezentowa³a siê dobrze.</p>
-	  <p>Celem powstania tej strony by³o zebranie wszystkich aktualnych informacji dotycz±cych jêzyków HTML, XHTML, CSS oraz DOM w jednym miejscu. Znajdziesz tutaj zarówno informacje typowe, z oficjalnych specyfikacji, ale tak¿e, w formie ciekawostki, liczne rozszerzenia przegl±darek.</p>
-	  <p>W chwili obecnej znajduj± siê tutaj informacje o 119 znacznikach HTML oraz 187 atrybutach stylów. W przysz³o¶ci systematycznie bêd± dodawane polecenia ze specyfikacji XHTML 2.0, Web Applications 1.0 oraz CSS 3.0</p>
-	  <p>Polecane: Profesjonalne tworzenie stron www</p>\n");
-
-# Licencja
-define('LICENSE_PAGE_TITLE', 'Licencja');
-define('LICENSE_PAGE_CONTENT', "<p>UTeTe jest debe¶ciarskie!</p>\n");
-
-?>
Index: w/licence.php
===================================================================
--- www/licence.php	(revision 843c58d4aac937f49b9312f045b6540f2c3734f9)
+++ 	(revision )
@@ -1,10 +1,0 @@
-<?php
-require_once 'locale.php';
-require_once 'cmn_frame.php';
-
-$title = '<title>UAM Text Tools - '.LICENSE_PAGE_TITLE."</title>\n";
-$context = LICENSE_PAGE_CONTENT;
-
-getMainPage($title, $context);
-
-?>
Index: w/locale.php
===================================================================
--- www/locale.php	(revision 843c58d4aac937f49b9312f045b6540f2c3734f9)
+++ 	(revision )
@@ -1,5 +1,0 @@
-<?php
-  include "lang/locale.pl";
-//  include "lang/locale.en";
-
-?>
