Naprawy dotyczace oblugi plikow konfiguracyjnych.

This commit is contained in:
Tomasz Obrebski 2012-02-09 20:34:02 +01:00
parent 2ff1f65f9b
commit cfdf333a51
21 changed files with 74 additions and 47 deletions

View File

@ -18,7 +18,6 @@ all: $(TARGETS)
.PHONY: components
components:
cd $(SRC_DIR)/lib && make; cd $(CUR_DIR)
@for cmp in $(COMPONENTS); do\
cd $(SRC_DIR)/$$cmp && make; cd $(CUR_DIR); \
done
@ -29,6 +28,7 @@ documentation:
.PHONY: configuration
configuration:
cd $(CUR_DIR)/conf && make; cd $(CUR_DIR)
.PHONY: libraries
libraries:
@ -40,7 +40,7 @@ share:
# cleanup section
# ------------------------------------------------------------------
.PHONY: clean
clean: clean_components clean_documentation
clean: clean_components clean_documentation clean_config
@echo "All files cleaned successfully!"
.PHONY: clean_components
@ -54,6 +54,10 @@ clean_components:
clean_documentation:
cd $(CUR_DIR)/doc && make clean; cd $(CUR_DIR)
.PHONY: clean_config
clean_config:
cd $(CUR_DIR)/conf && make clean; cd $(CUR_DIR)
# ------------------------------------------------------------------
# install section
# ------------------------------------------------------------------

View File

@ -1,5 +1,16 @@
include ../config.mak
.PHONY: all
all: compiledic.conf cor.conf dgc.conf dgp.conf gph.conf grp.conf gue.conf kor.conf lem.conf mar.conf ser.conf utt.conf
%.conf: %.conf.m4
m4 --define=LANG_DIR=${LANG_DIR} --define=LIB_DIR=${LIB_DIR} $< > $@
.PHONY: clean
clean:
rm *.conf
.PHONY: install
install:
ifdef CONF_DIR

13
conf/compiledic.conf.m4 Normal file
View File

@ -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 = LANG_DIR/pl_PL.ISO-8859-2/pl_PL.ISO-8859-2.sym

View File

@ -10,5 +10,5 @@
# All lines must looks like:
# parameter_name [=] value
#
dictionary-home = PATH_PREFIX/share/utt
dictionary-home = LANG_DIR
process = W

View File

@ -1,15 +0,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

View File

@ -10,4 +10,6 @@
# All lines must looks like:
# parameter_name [=] value
#
symbols = PATH_PREFIX/share/utt/pl_PL.ISO-8859-2/pl_PL.ISO-8859-2.sym
categories = LANG_DIR/cats.dgc
grammar = LANG_DIR/gram.dgc
outputfile = LANG_DIR/gram.dgp

View File

@ -11,7 +11,7 @@
# parameter_name [=] value
#
grammar = PATH_PREFIX/share/utt/gram.dgp
grammar = LANG_DIR/gram.dgp
process = W
process = BOS
process = EOS

View File

@ -10,6 +10,6 @@
# All lines must looks like:
# parameter_name [=] value
#
macros = PATH_PREFIX/lib/utt/terms.m4
macros = LIB_DIR/terms.m4
tags=uam

View File

@ -10,5 +10,5 @@
# All lines must looks like:
# parameter_name [=] value
#
dictionary-home = PATH_PREFIX/share/utt
dictionary-home = LANG_DIR
process = W

View File

@ -10,7 +10,7 @@
# All lines must looks like:
# parameter_name [=] value
#
dictionary-home = PATH_PREFIX/share/utt
weights = PATH_PREFIX/share/utt/weights.kor
dictionary-home = LANG_DIR
weights = LANG_DIR/weights.kor
threshold = 1.0
process=W

View File

@ -10,5 +10,5 @@
# All lines must looks like:
# parameter_name [=] value
#
dictionary-home = PATH_PREFIX/share/utt
dictionary-home = LANG_DIR
process = W

View File

@ -10,6 +10,6 @@
# All lines must looks like:
# parameter_name [=] value
#
macros = PATH_PREFIX/lib/utt/terms.m4
macros = LIB_DIR/terms.m4
tags=uam

View File

@ -1,15 +0,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

15
conf/ser.conf.m4 Normal file
View File

@ -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 = LIB_DIR/terms.m4
flex-template = LIB_DIR/ser.l.template
tags=uam

View File

@ -108,6 +108,7 @@ extern void process_config_files(gengetopt_args_info* args, char* argv0)
// 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,

View File

@ -0,0 +1,2 @@
common.o: ../common/common.cc ../common/common.h ../common/../lib/const.h \
../common/../dgp/cmdline.h

View File

@ -1,3 +1,5 @@
include ../../config.mak
LDFLAGS += -static
CXXFLAGS += -O2 -fpermissive
@ -39,7 +41,14 @@ clean: clean.cmdline
clean.cmdline:
rm cmdline.* || true
copy:
ifdef UTT_BIN_DIR
cp lem $(UTT_BIN_DIR)
.PHONY: install
install:
ifdef BIN_DIR
install -m 0755 lem $(BIN_DIR)
endif
.PHONY: uninstall
uninstall:
ifdef BIN_DIR
rm $(BIN_DIR)/lem
endif

View File

@ -32,7 +32,7 @@ int main(int argc, char** argv) {
else if(strcmp(dictionary+strlen(dictionary)-4,".dic")==0)
lem = new AuxLem(dictionary);
else
fprintf(stderr,"lem: Invalid dictionary file extension.\n");
fprintf(stderr,"lem: Dictionary file not found.\n");
Words tab;
// Segment seg;

View File

@ -20,5 +20,5 @@
#define GUESS_DICT_FILE "slownik.fsa"
// katalogi z plikami konfiguracyjnymi
#define SYSTEM_CONFIG_DIR "/usr/local/etc/utt"
#define SYSTEM_CONFIG_DIR "/etc/utt"
#define USER_CONFIG_DIR "~/.utt"