SFST magyar többesszám III

A Programozás Wiki wikiből
%%%%%%%%%%%%%% vocharm12.fst %%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%% Plural for Hungarian morpho 2 hangzókiesés, ephenthesis %%%%%%%
%%% consonant ending
% bokor-bokrok    ok -o
% kapocs kapcsok  ok
% marok  markok   ok
% gyilok gyilkok  ok
% veder- vedrek   ek -e
% gödör  gödrök   ök -ö
% alom almok      ok - not here
%%% vocal ending
% ló lovak vak ó->o - not here
%%%%%%%%%%%%%%% 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>:o <AA>:<> <Noun> <del>
$As$ =  ( [#mely#] [#cons#]+ <Noun>) <AA> <=>  o
$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><del>]:<>
$delete-POS$ =  .*
ALPHABET = [#cons#] [#vowel#]  <del> <AA> <Noun> <pl>
%kötél, név
% let <del> and following vocal disappear from surface
ALPHABET = [#asym#] <del> <Noun> <pl>
$bfilter$ =  {<del>[#vowel#]}:{[<>]}  ^->  (__ [#cons#]+<Noun>.*k)
ALPHABET = [#cons#] [#vowel#]  <del> <AA> <Noun> <pl>
$Del_pV$ = .*
$oo_to_ov$ = {ó}:{ov} ^-> (__ [<Noun>] <AA>k)
$uuconv$ = ($oo_to_ov$ ) ||  $Del_pV$
% let <del> disappear from surface
ALPHABET = [#asym#] <>:<del>
$afilter$ = .*

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

%%%%%%%%%%%%%%%%%%%%%%%% noun-reg3.lex %%%%%%%%%%%%%%%%%%%
% kap<del>ocs
% mar<del>ok
% gyil<del>ok
% bok<del>or
% ved<del>er
% göd<del>ör
%%%%%%%%%%%%%%%%%%%%%% result with fst generate%%%%%%%%%%%%%
% fst-generate vocharm11.a
% vede:<>r<Noun>:<><pl>:e<>:k
% veder<Noun>:<><sg>:<>
% gödö:<>r<Noun>:<><pl>:ö<>:k
% gödör<Noun>:<><sg>:<>
% gyilo:<>k<Noun>:<><pl>:o<>:k
% gyilok<Noun>:<><sg>:<>
% boko:<>r<Noun>:<><pl>:o<>:k
% bokor<Noun>:<><sg>:<>
% maro:<>k<Noun>:<><pl>:o<>:k
% marok<Noun>:<><sg>:<>
% kapo:<>cs<Noun>:<><pl>:o<>:k
% kapocs<Noun>:<><sg>:<>

Lásd még[szerkesztés]