SFST magyar többesszám IV

A Programozás Wiki wikiből
%%%%%%%%%%%%%% vocharm13.fst %%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%% Plural for Hungarian morpho 2 hangzócsere %%%%%%%
%%% consonant ending
% pehely pelyhek      ek
% kehely  kelyhek     ek
% teher   terhek      ek
% lélek lelkek        ek é->e
% nyugalom nyugalmak  ak
% de: alom  almok     ok - nem itt
%%% vocal ending
% ló       lovak      vak ó->o
%%%%%%%%%%%%%%% symbols %%%%%%%%%%%%%%%%%%%%
#cons# = bcdfghjklmnprstvwxyz
#vowel# = aeiouáéíóúöüőű
#magas# = eéiöőüű
#magas1# = eéi
#mely# = aáíouóú
#oe# = öüőű
#aa# = aá
#asym# = #cons##vowel#<Noun><Verb><Adj><sg><pl>
#pos# = <Noun><Verb><Adj><sg><pl>
%%%%%%%%%%%%%%% vocal harmony - HU plural %%%%%%%%%%%%%%%%%%%%
ALPHABET = [#cons#] [#vowel#] <AA>:e <AA>:ö <AA>:a <AA>:<> <Noun> <exc1>  <exc2> <del>
$As$ =  ( [#mely#] [#cons#]+ <Noun>) <AA> <=>  a
$As2$ = ([#magas1#] [#cons#]+ <Noun>) <AA> <=>  e
$As4$ = ([#oe#] [#cons#]+ <Noun>) <AA> <=>  ö
$Del_pV$ = .*
$ma$ = ($As$  & $As2$  & $As4$  )||  $Del_pV$
% delete pos tags
ALPHABET = [#cons#] [#vowel#] [<Verb><Noun><Adj><exc1><exc2><del>]:<>
$delete-POS$ =  .*
ALPHABET = [#cons#] [#vowel#] <exc1> <exc2> <del> <AA> <Noun> <pl>
%kötél, név
% exchange <exc1> and following syllable
ALPHABET = [#asym#] <exc1> <exc2> <del> <Noun> <pl> <AA>
$b1filter$ =  {<exc1>hely}:{lyh}  ^->  (__ <Noun>.*k) %pelyhek
$b2filter$ =  {<exc2>her}:{rh}  ^->  (__ <Noun>.*k) %terhek
% let <del> following vocal disappear from surface
$bfilter$ =  {<del>[#vowel#]}:{[<>]}  ^->  (__ [#cons#]+<Noun>.*k)
ALPHABET = [#cons#] [#vowel#] <exc1> <exc2> <del> <AA> <Noun> <pl>
$Del_pV$ = .*
$oo1_to_ov$ = {ó}:{ov} ^-> (__ [<Noun>] <AA>k) %lovak
$ee_to_ev$ = {élek}:{elk} ^-> (__ [<Noun>] <AA>k) %lelkek
$uuconv1$ = ($oo1_to_ov$ ||  $ee_to_ev$ ) ||  $Del_pV$
% let <del> <excx> <bee> disappear from surface
ALPHABET = [#asym#] <>:<exc1> <>:<exc2> <>:<del>
$afilter$ = .*

% <Noun> is needed to see the word''s  end
$noun-reg-infl$ = <Noun> (\
  {<sg>}:{} |\
  {<pl>}:{<AA>k})
$morph$ = $afilter$ || "noun-reg4.lex" $noun-reg-infl$
$morph$ >> "morph1.a"
$morph$ = $morph$ || $uuconv1$
$morph$ >> "morph2.a"
$morph$ = $morph$ || $ma$
$morph$ >> "morph3.a"
$morph$ = $morph$ ||  $b1filter$ || $b2filter$ || $bfilter$
$morph$ >> "morph4.a"
$morph$ = $morph$ ||  $delete-POS$
$morph$

%%%%%%%%%%%%%%%%%%%%%%%% noun-reg4.lex %%%%%%%%%%%%%%%%%%%
% pe<exc1>hely
% te<exc2>her
% hatal<del>om
% lélek
% ló
%%%%%%%%%%%%%%%%%%%%%% result with fst generate%%%%%%%%%%%%%
% fst-generate vocharm11.a
% fst-generate vocharm13.a
% ló<Noun>:<><sg>:<>
% lélek<Noun>:<><sg>:<>
% ló:o<>:v<Noun>:<><pl>:a<>:k
% lé:ele:kk:<><Noun>:<><pl>:e<>:k
% pe<>:lh:ye:hl:<>y:<><Noun>:<><pl>:e<>:k
% pehely<Noun>:<><sg>:<>
% hatalo:<>m<Noun>:<><pl>:a<>:k
% hatalom<Noun>:<><sg>:<>
% te<>:rhe:<>r:<><Noun>:<><pl>:e<>:k
% teher<Noun>:<><sg>:<>

Lásd még[szerkesztés]