Aspekte der morphologischen Analyse des Deutschen - Universität ...
Aspekte der morphologischen Analyse des Deutschen - Universität ...
Aspekte der morphologischen Analyse des Deutschen - Universität ...
Sie wollen auch ein ePaper? Erhöhen Sie die Reichweite Ihrer Titel.
YUMPU macht aus Druck-PDFs automatisch weboptimierte ePaper, die Google liebt.
Anhang C: Programmcode<br />
/*********************************************************************************************************************************<br />
File: automat.pl<br />
Description: Definition of the alphabet and the start state of the segmentizer<br />
Date: March 98<br />
/*********************************************************************************************************************************<br />
startstate(s0).<br />
/*********************************************************************************************************************************<br />
automation_alphabet(Alphabet:):<br />
Defines the alphabet of the segmentizer<br />
*********************************************************************************************************************************/<br />
automation_alphabet([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,'-','ä','ö','ü','ß']).<br />
/*********************************************************************************************************************************<br />
File: gen_segment.pl<br />
Language: Sicstus Prolog 3.5<br />
Author: Thomas Hanneforth, University of Potsdam, Germany<br />
Date: Feb. 98<br />
Desc.: Creates the segmenting automation<br />
The main predicate is create_automation/0 which compiles a<br />
pattern matching machine (see Aho/Corasick (1975) for details)<br />
out of the lexicon entries<br />
*********************************************************************************************************************************/<br />
:- dynamic<br />
tr/3, % transition function entry<br />
f/2, % failure function entry<br />
o/2. % output function entry<br />
:- unknown(_,fail).<br />
:- ensure_loaded([library(lists)]).<br />
:- [queues,sicsutls]. % Sicstus<br />
:- [automat]. % Alphabet of the automation<br />
:- [os_spec]. % Operating system specific stuff<br />
/*********************************************************************************************************************************<br />
create_automation/0:<br />
top level predicate for the compiler<br />
*********************************************************************************************************************************/<br />
create_automation :-<br />
nl, write('% Compiling segmentizer ...'), nl,<br />
clear_db,<br />
process_lex_entries,<br />
startstate_completition,<br />
construct_failure_function,<br />
% for reasons of efficiency this is done after all words are processed.<br />
write_automation,<br />
segmentizer_information(States,Transitions,Finalstates),<br />
write('% Morph segmentizer created and saved.'), nl,<br />
format("% ~d states, ~d transitions, ~d final states.", [States,Transitions,Finalstates]),<br />
nl, nl.<br />
/*********************************************************************************************************************************<br />
clear_db /0:<br />
Removes all dynamic predicate clauses<br />
*********************************************************************************************************************************/<br />
clear_db :-<br />
abolish(tr/3),<br />
abolish(f/2),<br />
abolish(o/2).<br />
197