SFST magyar melléknevek I

A Programozás Wiki wikiből
%%%%%%%%%%%%%%% mn1.fst %%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%   Hungarian adjectives %%%%%%%%%%%%%%5
#cons# = bcdfghjklmnprstvwxyz
#vowel# = aeiouáéíóúöüőű
#magas# = eéiíöőüű
#mely# = aáouóú
%%%%%%%%%%%%%%% phonetic rules %%%%%%%%%%%%%%%%%%%%
ALPHABET = [#cons#] [#vowel#] \
          <AE>:[ae] \
          <leg> <legesleg> <Adj> \
          <ground> <comp> <superl> <exagg><bw>

% vocal harmony okos-abb ügyes-ebb
$AE$ =  ([#mely#] [#cons#]* <Adj> .*) <AE> <=>  a 
$Del_pV$ = .*
$ma$ = ($AE$ )  || $Del_pV$

% prefixes leg and legesleg
ALPHABET = [#cons#] [#vowel#] <Adj><comp><superl> \
            <exagg> <ground> <leg><legesleg><bw>
$leg$ = {<bw>}:{leg} ^-> ( __.* <Adj>.*<leg>.*)
$legesleg$ = {<bw>}:{legesleg} ^-> ( __.* <Adj>.*<legesleg>.*)
% delete pos tags
ALPHABET = [#cons#] [#vowel#] <Adj> <>:[<leg> <legesleg> <ground> <comp> <superl> <exagg><bw>]
$afilter$ = .*

ALPHABET = [#cons#] [#vowel#] [<leg> <legesleg> <Adj><ground> <comp> <superl> <exagg><bw>]:<>
$delete-POS$ =  .*

%%%% inflection of adjectives %%%%%%%%%%%%
$ground$ =  <ground>:{} 
$comp$   =  <comp>:{<AE>bb} 
$superl$ =  <superl>:{<leg><AE>bb} 
$exagg$  =  <exagg>:{<legesleg><AE>bb} 

$level$ = $ground$ | $comp$ | $superl$ | $exagg$
$boost$ = $level$

$morph$ = $afilter$ || <bw> "mn-reg.lex" <Adj>  % clean & read in
$morph$ >> "morph1.a"
$morph$ = $morph$ $boost$
$morph$ >> "morph2.a"
$morph$ = $morph$ || $ma$                       % inflect
$morph$ >> "morph3.a"
$morph$ = $morph$ || $leg$
$morph$ >> "morph4.a"
$morph$ = $morph$ || $legesleg$ ||  $delete-POS$ % add prefixes, clean up
$morph$

%%%%%%%%%%% mn-reg.lex %%%%%%%%%%%
% okos
% ügyes
%%%%%%%%%%%% sample result %%%%%%%%
% analyze> ügyes
% ügyes<Adj><ground>
% analyze> okos
% okos<Adj><ground>
% analyze> ügyesebb
% ügyes<Adj><comp>
% analyze> okosabb
% okos<Adj><comp>
% analyze> legokosabb
% okos<Adj><superl>
% analyze> legügyesebb
% ügyes<Adj><superl>
% analyze> legeslegokosabb
% okos<Adj><exagg>
% analyze> legeslegügyesebb
% ügyes<Adj><exagg>

Lásd még[szerkesztés]