commit 121e29cffed3ab3e640e8c2c0dd96dc6c07253cd Author: kamush901 Date: Sun Aug 8 17:43:23 2021 +0200 Putting back the rtx as it was before after crash diff --git a/apertium-kaz-uzb.kaz-uzb.rtx b/apertium-kaz-uzb.kaz-uzb.rtx index a603516..5a832e8 100644 --- a/apertium-kaz-uzb.kaz-uzb.rtx +++ b/apertium-kaz-uzb.kaz-uzb.rtx @@ -2,120 +2,27 @@ !! ATTRIBUTE CATEGORIES !!!!!!!!!!!!!!! -n_number = (ND "") sg pl sp ND; -v_number = (ND sg) sg pl sp ND; +number = (ND sg) sg pl sp ND; gender = (GD m) m f mf GD; - -det_type = def ind dem itg qnt ref ; -prn_type = dem ind pers itg neg ; - -v_type = iv tv vaux cop ; - -tense = pres past fut ifi fut aor imp unac prog nec ; -vadj = gpr_past gpr_impf gpr_fut gpr_hab gpr_pot gpr_ppot gpr_unac gpr_aor ; -vadv = gna_perf gna_impf gna_cond gna_ken ; -ger = ger_past ger_fut ger ger_unac ger_aor ger_inf ; -inf = prc_perf prc_impf prc_vol prc_cond prc_fplan prc_plan prc; -nonfin = [vadj] [vadv] [ger] [inf] ; -fin_nonfin = [tense] [vadj] [vadv] [ger] [inf] ; -comp = comp ; - -polarity = neg ; - -possession = px1sg px1pl px2sg px2pl px3sp ; - -case = nom acc gen dat loc abl ins CD ; ! (CD nom) -attr = attr ; - -n_person = (PD p3) p1 p2 p3 PD ; -v_person = (PD "") p1 p2 p3 PD ; -formality = frm ; - -transitivity = (TD iv) tv iv ; -voice = caus pass coop ; -voice_a = coop ; -voice_b = caus ; -voice_c = pass ; -! caus.pass is loads more common than pass.caus -! technically caus.caus is also possible - -verbs_acc = qara ; -post_acc = qaray ; -post_dat = qarata ; - -advl = advl ; +det_type = def ind dem itg; +tense = pres past fut ifi pri fti; !!!!!!!!!!!!!!! !! OUTPUT PATTERNS !!!!!!!!!!!!!!! - -adj: _.advl.comp ; -AP: _ ; -aP: _ ; - -adv: _ ; -postadv: _ ; - -post: _ ; - -vaux_fin: .polarity.fin_nonfin.v_person.formality.v_number ; -vaux_vadj: .polarity.fin_nonfin ; ! FIXME: allow for subst -vaux_inf: .polarity.fin_nonfin ; -vaux_inf_vol: .polarity.fin_nonfin.v_person.formality.v_number ; -vaux_vadv: .polarity.fin_nonfin ; -vaux_vadv_cond: .polarity.fin_nonfin.v_person.formality.v_number ; -vaux_ger: .polarity.fin_nonfin.n_number.possession.formality.case ; - - -v_fin: .transitivity.voice_a.voice_b.voice_c.polarity.fin_nonfin.v_person.formality.v_number ; -v_vadj: .transitivity.voice_a.voice_b.voice_c.polarity.fin_nonfin ; ! FIXME: allow for subst -v_vadv: .transitivity.voice_a.voice_b.voice_c.polarity.fin_nonfin ; -v_vadv_cond: .transitivity.voice_a.voice_b.voice_c.polarity.fin_nonfin.v_person.formality.v_number ; -v_inf: .transitivity.voice_a.voice_b.voice_c.polarity.fin_nonfin ; -v_inf_vol: .transitivity.voice_a.voice_b.voice_c.polarity.fin_nonfin.v_person.formality.v_number ; -v_ger: .transitivity.voice_a.voice_b.voice_c.polarity.fin_nonfin.n_number.possession.formality.case ; - -!vP: _.v_type.voice_a.voice_b.voice_c.fin_nonfin.polarity.v_person.formality.v_number ; -vP_fin: .v_type.transitivity.voice_a.voice_b.voice_c.polarity.fin_nonfin.v_person.formality.v_number ; -vP_vadj: .transitivity.voice_a.voice_b.voice_c.polarity.fin_nonfin ; ! FIXME: allow for subst -vP_vadv: .transitivity.voice_a.voice_b.voice_c.polarity.fin_nonfin ; -vP_vadv_cond: .transitivity.voice_a.voice_b.voice_c.polarity.fin_nonfin.v_person.formality.v_number ; -vP_inf: .transitivity.voice_a.voice_b.voice_c.polarity.fin_nonfin ; -vP_inf_vol: .transitivity.voice_a.voice_b.voice_c.polarity.fin_nonfin.v_person.formality.v_number ; -vP_ger: .transitivity.voice_a.voice_b.voice_c.polarity.fin_nonfin.n_number.possession.formality.case ; - -cop_fin: .tense.polarity.v_person.formality.v_number ; -cop_ger: .ger.n_number.possession.formality.case ; - -qst: _ ; -emph: _ ; - -VP: _.transitivity.voice_a.voice_b.voice_c.fin_nonfin.polarity.v_person.formality.v_number ; - -n: _.n_number.possession.case.attr ; -nP: _.n_number.possession.case ; -NP: _.n_number.possession.case ; - -prn_pers: _.prn_type.v_person.formality.n_number.case ; -prn_dem: _.prn_type.n_number.case ; ! also for itg - +n: _.gender.number; +adj: _.gender.number; det_default: _.det_type; -det_def: _.det_type.n_number; +det_def: _.det_type.number; -PP: _ ; -AdvP: _ ; -PPorAdvP: _ ; - -S: _ ; +NP: _.number; !!!!!!!!!!!!!!! !! TAG-REWRITE RULES !!!!!!!!!!!!!!! -tense > tense : pres aor ; ! ifi past, pri pres, fti fut; -fin_nonfin > fin_nonfin : pres aor, ger ger_abst, - gna_impf gna_perf, ger_impf ger_past; ! these two might not be necessary? copied from t1x +tense > tense : ifi past, pri pres, fti fut; !!!!!!!!!!!!!!! !! MACROS @@ -126,154 +33,13 @@ det: (if (1.det_type = def or 1.det_type = ind) else 1(det_default)); -prn: (if (1.prn_type = pers) - 1(prn_pers) - else - 1(prn_dem) ! also for itg - ); - -vaux: (if (1.fin_nonfin in tense) - 1(vaux_fin) - elseif (1.fin_nonfin in vadj) - 1(vaux_vadj) - elseif ((1.fin_nonfin in vadv) and (1.fin_nonfin = gna_cond)) - 1(vaux_vadv_cond) - elseif (1.fin_nonfin in vadv) - 1(vaux_vadv) - elseif ((1.fin_nonfin in inf) and (1.fin_nonfin = prc_vol)) - 1(vaux_inf_vol) - elseif (1.fin_nonfin in inf) - 1(vaux_inf) - elseif ((1.fin_nonfin in ger) and (1.fin_nonfin=ger) and ((1.possession="") and (1.case=nom))) - 1(vaux_ger)[fin_nonfin=ger_pres] - elseif ((1.fin_nonfin in ger) and (1.fin_nonfin=ger)) - 1(vaux_ger)[fin_nonfin=ger_past] - elseif (1.fin_nonfin in ger) - 1(vaux_ger) - ); - -v: (if (1.fin_nonfin in tense) - 1(v_fin) - elseif (1.fin_nonfin in vadj) - 1(v_vadj) - elseif ((1.fin_nonfin in vadv) and (1.fin_nonfin = gna_cond)) - 1(v_vadv_cond) - elseif (1.fin_nonfin in vadv) - 1(v_vadv) - elseif ((1.fin_nonfin in inf) and (1.fin_nonfin = prc_vol)) - 1(v_inf_vol) - elseif (1.fin_nonfin in inf) - 1(v_inf) - elseif ((1.fin_nonfin in ger) and (1.fin_nonfin=ger) and ((1.possession="") and (1.case=nom))) - 1(v_ger)[fin_nonfin=ger_pres] - elseif ((1.fin_nonfin in ger) and (1.fin_nonfin=ger)) - 1(v_ger)[fin_nonfin=ger_past] - elseif (1.fin_nonfin in ger) - 1(v_ger) - ); - -vP: (if (1.fin_nonfin in tense) - 1(vP_fin) - elseif (1.fin_nonfin in vadj) - 1(vP_vadj) - elseif ((1.fin_nonfin in vadv) and (1.fin_nonfin = gna_cond)) - 1(vP_vadv_cond) - elseif (1.fin_nonfin in vadv) - 1(vP_vadv) - elseif ((1.fin_nonfin in inf) and (1.fin_nonfin = prc_vol)) - 1(vP_inf_vol) - elseif (1.fin_nonfin in inf) - 1(vP_inf) - elseif (1.fin_nonfin in ger) - 1(vP_ger) - ); - -cop: (if (1.fin_nonfin in tense) - 1(cop_fin) - elseif (1.fin_nonfin in ger) - 1(cop_ger) - ); - - !!!!!!!!!!!!!!! !! REDUCTION RULES !!!!!!!!!!!!!!! -PP -> - 20: NP ?(1.case=ins) [$lemh=bilan] { 1[case=nom] _ bilan@post } | - NP %post { - 1[case=( - if (2.lemh in post_acc) - acc - elseif (2.lemh in post_dat) - dat - else - 1.case - )] - _1 2 } ; - -AdvP -> - %adj ?(1.advl=advl) { 1 } | - %adv { 1 } | - %AdvP postadv { 1 _1 2 } - ; - -PPorAdvP -> - %PP { 1 } | - %AdvP { 1 } ; - -NP -> ! n.$number adj { 2[gender=1.gender, number=1.number] _1 1 } ; - %nP { %1 } | - AP %nP { 1 _1 %2 } | - det %nP { 1 _1 %2 } | - det AP %nP { 1 _1 2 _2 %3 } | - %prn { %1 } | - NP.gen %NP.px3sp { 1 %2 } ; - -nP -> - %n { %1 } | - n %n ?((1.possession = "") and (2.possession = px3sp)) { 1 _1 2 } ; - -aP -> - %adj { 1 } | - adv %adj { 1 _1 2 } | - %aP qst { 1 + 2 } | - %aP emph { 1 + 2 } | - %aP postadv { 1 _1 2 } ; - -AP -> - %aP { 1 } ; - -vP -> - ! all [$fin_nonfin=1.fin_nonfin] can be removed when apertium-recursive supports % checking for macros - %vaux [$fin_nonfin=1.fin_nonfin] { 1 } | - 1: %v [$fin_nonfin=1.fin_nonfin] { %1[fin_nonfin=$fin_nonfin,polarity=$polarity] } | - 2: %v ?(1.vadj/sl=gpr_impf) [$fin_nonfin=1.fin_nonfin] { 1[fin_nonfin=prc_impf] _ тур@vaux.gpr_past } | - %cop [$fin_nonfin=1.fin_nonfin] { 1 } | - vP %vP ?((1.fin_nonfin in inf) and (2.v_type=vaux)) [$lemh=1.lemh,$fin_nonfin=2.fin_nonfin] { 1 _1 2 } | - %vP qst [$fin_nonfin=1.fin_nonfin] { 1 + 2 } | - %vP emph [$fin_nonfin=1.fin_nonfin] { 1 + 2 } ; - -VP -> - NP %э@vP (if (2.tense = ifi) { 1 _1 2 } else { 1 + 2 } ) | - AP %э@vP (if (2.tense = ifi) { 1 _1 2 } else { 1 + 2 } ) | - NP %vP ?(1.case = acc) { 1 _1 2 } | - NP %vP ?(1.case = dat) { 1[case=(if (2.lemh in verbs_acc) acc else 1.case)] _1 2 } | - PPorAdvP %vP { ( - if ((1.lemh="али") and (2.polarity=neg)) - [ %2[fin_nonfin=unac,polarity=_] ] - else - [ 1 _1 %2 ] - ) } | - PPorAdvP NP %vP { 1 _1 2 _2 3 } !| - !1: AP %vP ?(2.v_type=cop) { 1 _1 2 } | - !2: AP %vP ?(2.v_type=cop & 2.tense=aor) { 1 + 2 } ; - ; - -S -> - NP VP { 1 _1 2 } ; +NP -> n.$number adj { 2[gender=1.gender, number=1.number] _ 1 } ; ! Resources: -! https://wiki.apertium.org/wiki/Apertium-recursive -! https://wiki.apertium.org/wiki/Apertium-recursive/Formalism -! https://wiki.apertium.org/wiki/Apertium-recursive/Cookbook +! http://wiki.apertium.org/wiki/Apertium-recursive +! http://wiki.apertium.org/wiki/Apertium-recursive/Formalism +! http://wiki.apertium.org/wiki/Apertium-recursive/Cookbook