SFST magyar birtokos eset

A Programozás Wiki wikiből
%%%%%%%%%%%%%% gen.fst %%%%%%%%%%%%%%%%%%%
% http://wiki.prog.hu/wiki/SFST_magyar_birtokos_eset
%%%%%%%%%%%%%% birtokos eset (genitive) for Hungarian (simplified first version)  %%%%%%%%%%%
% Péteré, Ottóé, házé, kutyáé
% Péteréi, Ottóéi, házéi, kutyáéi
%%%%%%%%%%%%%%% symbols %%%%%%%%%%%%%%%%%%%%
#cons# = bcdfghjklmnprstvwxyz
#vowel# = aeiouáéíówúöüőű
#magas# = eéiíöőüű
#magas1# = eéií
#mely# = aáouóú
#mely1# = ouóú
#oe# = öüőű
#aa# = aá
%%%%%%%%%%%%%%% vocal harmony - HU plural %%%%%%%%%%%%%%%%%%%%
ALPHABET = [#cons#] [#vowel#]  <Noun>

% a to á and e to é if word ends with a or e
ALPHABET = [#cons#] [#vowel#] <Verb><Noun><Adj> <pl>
$a-to-aa$ = {a}:{á} ^-> (__ [<Noun>] .*)
$e-to-ee$ = {e}:{é} ^-> (__ [<Noun>] .*)
% delete pos tags
ALPHABET = [#cons#] [#vowel#] [<Verb><Noun><Adj>]:<>
$delete-POS$ =  .*

% <Noun> is needed to see the word''s end

$plu$ = <pl>:{<AA>k}

$nom$ =  <nom>:{}
$gen$ =  {<gen>}:{é}
$genpl$ =  {<genpl>}:{éi}

$case$ = $nom$ | $gen$ | $genpl$
           
$PLU$ = $plu$

$CASEP$ = $case$


$morph$ = "noun-reg01.lex" <Noun>
$morph$ >> "morph6.a"
$morph$ = $morph$ $CASEP$
$morph$ >> "morph7.a"
$morph$ = $morph$|| $a-to-aa$ ||  $e-to-ee$ || $delete-POS$
$morph$

%%%%%%%%%%% noun-reg01.lex %%%%%%%%%%%
% vér
% szar
% szőr
% fa
% csere
%%%%%%%%%%%%%%%%% fst-generate rag1.a

Lásd még[szerkesztés]