mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 17:08:54 -06:00
(Ara) refactor sound verb constructors; reuse v1sound for v7sound
This commit is contained in:
@@ -98,7 +98,7 @@ resource ResAra = PatternsAra ** open Prelude, Predef, OrthoAra, ParamX in {
|
||||
let pat = mkPat pS in
|
||||
case pS of {
|
||||
w + "ف" + x + "ع" + y + "ل" + z =>
|
||||
case rS of {
|
||||
case rS of { -- TODO: reconsider shadda, maybe handling it should be moved 100% to ParadigmsAra /IL 2019-01-01
|
||||
x@? + y@? + "ّ" => mkStrong pat (mkRoot3 (x+y+y)) ; -- In principle, shadda shouldn't be in the root when dealing with strong inflection, but if someone puts one, this should fix it. /IL
|
||||
_ => mkStrong pat (mkRoot3 rS) } ;
|
||||
w + "ف" + x + "ع" + y =>
|
||||
@@ -219,7 +219,7 @@ oper
|
||||
|
||||
--macro for sound verb
|
||||
--PerfAct, PerfPas, ImpfAct, ImpfPas, Imp, PPart
|
||||
verb : (_,_,_,_,_,_ : Str) -> Verb =
|
||||
verb : (x1,_,_,_,_,x6 : Str) -> Verb =
|
||||
\katab,kutib,aktub,uktab,euktub,maktUb -> {
|
||||
s = \\vf => rectifyHmz (case vf of {
|
||||
VPerf Act pgn => katab + suffixPerf ! pgn ;
|
||||
@@ -232,7 +232,14 @@ oper
|
||||
VPPart => maktUb
|
||||
})
|
||||
} ;
|
||||
|
||||
verb' : SoundForms -> Verb = \vforms ->
|
||||
let katab = vforms ! 0 ;
|
||||
kutib = vforms ! 1 ;
|
||||
aktub = vforms ! 2 ;
|
||||
uktab = vforms ! 3 ;
|
||||
euktub = vforms ! 4 ;
|
||||
maktUb = vforms ! 5 ;
|
||||
in verb katab kutib aktub uktab euktub maktUb ;
|
||||
--affixes of sound verbs
|
||||
|
||||
suffixPerf : PerGenNum => Str =
|
||||
@@ -462,7 +469,7 @@ oper
|
||||
|
||||
--now is used for the sound, assimilated (weak C1), and when C1 = hamza:
|
||||
|
||||
v1sound : Root3 -> Vowel -> Vowel -> Verb =
|
||||
v1soundForms : Root3 -> Vowel -> Vowel -> SoundForms =
|
||||
\fcl,vowPerf,vowImpf ->
|
||||
let {
|
||||
qf = {f = fcl.c ; c = fcl.l} ;
|
||||
@@ -482,7 +489,10 @@ v1sound : Root3 -> Vowel -> Vowel -> Verb =
|
||||
};
|
||||
maktUb = mkStrong mafcUl fcl
|
||||
} in
|
||||
verb katab kutib aktub uktab euktub maktUb ;
|
||||
toSoundForms katab kutib aktub uktab euktub maktUb ;
|
||||
|
||||
v1sound : Root3 -> Vowel -> Vowel -> Verb = \fcl,vp,vi ->
|
||||
verb' (v1soundForms fcl vp vi) ;
|
||||
|
||||
v1hollow : Root3 -> Vowel -> Verb =
|
||||
\xwf,vowImpf ->
|
||||
@@ -522,8 +532,11 @@ fvc : Vowel => Pattern =
|
||||
a => fac
|
||||
} ;
|
||||
|
||||
|
||||
v1geminate : Str -> Vowel -> Vowel -> Verb =
|
||||
\r,vp,vi ->
|
||||
verbGeminate (v1geminateForms r vp vi) ;
|
||||
|
||||
v1geminateForms : Str -> Vowel -> Vowel -> DefForms =
|
||||
\rootStr,vowPerf,vowImpf ->
|
||||
let {
|
||||
mdd = mkRoot3 rootStr ; --fcc
|
||||
@@ -540,9 +553,8 @@ v1geminate : Str -> Vowel -> Vowel -> Verb =
|
||||
umdad = "ُ" + mkStrong fcal mdd ;
|
||||
Umdud = (prefixImp ! vowImpf) + mdud;
|
||||
mamdUd = mkStrong mafcUl mdd
|
||||
} in verbGeminate (toDefForms
|
||||
madd madad mudd mudid amudd amdud
|
||||
umadd umdad Umdud mudd' mamdUd) ;
|
||||
} in toDefForms madd madad mudd mudid amudd amdud
|
||||
umadd umdad Umdud mudd' mamdUd ;
|
||||
|
||||
patGem1 : Vowel => Pattern =
|
||||
table {
|
||||
@@ -568,16 +580,23 @@ patGem3 : Vowel => Pattern =
|
||||
-- IL -- Defective, hollow and geminate verbs all need 11 forms.
|
||||
{- NB. the numbers don't always refer to the same forms!
|
||||
The verb(Def|Hollow|Geminate) constructors pick the right forms. -}
|
||||
DefForms : Type = Predef.Ints 10 => Str ;
|
||||
SoundForms : Type = Predef.Ints 5 => Str ;
|
||||
DefForms : Type = Predef.Ints 10 => Str ;
|
||||
|
||||
toSoundForms : (x1,_,_,_,_,x6 : Str) -> SoundForms =
|
||||
\a,b,c,d,e,f ->
|
||||
table {
|
||||
0 => a ; 1 => b ; 2 => c ; 3 => d ; 4 => e ; 5 => f
|
||||
} ;
|
||||
|
||||
toDefForms : (x1,_,_,_,_,_,_,_,_,_,x11 : Str) -> DefForms =
|
||||
\a,b,c,d,e,f,g,h,i,j,k ->
|
||||
table {
|
||||
0 => a ; 1 => b ; 2 => c ; 3 => d ; 4 => e ; 5 => f ; 6 => g ;
|
||||
7 => h ; 8 => i ; 9 => j ; 10 => k
|
||||
0 => a ; 1 => b ; 2 => c ; 3 => d ; 4 => e ; 5 => f ;
|
||||
6 => g ; 7 => h ; 8 => i ; 9 => j ; 10 => k
|
||||
} ;
|
||||
|
||||
v1DefForms_perfA : Root3 -> Vowel -> DefForms = \rmy,vowImpf ->
|
||||
v1defForms_perfA : Root3 -> Vowel -> DefForms = \rmy,vowImpf ->
|
||||
let {
|
||||
_rmi = mkDefective (patDef1 ! vowImpf) rmy ;
|
||||
_rmu = mkDefective (patDef2 ! vowImpf) rmy ;
|
||||
@@ -595,11 +614,11 @@ v1DefForms_perfA : Root3 -> Vowel -> DefForms = \rmy,vowImpf ->
|
||||
} in toDefForms rama ramay rumi rumu rumiy armi armu urma eirmi eirmu marmiy ;
|
||||
|
||||
v1defective_a : Root3 -> Vowel -> Verb = \rmy,vowImpf ->
|
||||
let vforms = v1DefForms_perfA rmy vowImpf
|
||||
let vforms = v1defForms_perfA rmy vowImpf
|
||||
in verbDef vforms vowImpf ;
|
||||
|
||||
v1defective_i : Root3 -> Vowel -> Verb = \bqy,vowImpf -> -- IL (conjugation 1d4)
|
||||
let vforms_a = v1DefForms_perfA bqy vowImpf ;
|
||||
let vforms_a = v1defForms_perfA bqy vowImpf ;
|
||||
baqI = mkDefective facIl bqy ;
|
||||
baqiy = mkDefective facil bqy ;
|
||||
vforms_i = table { 0 => baqI ;
|
||||
@@ -609,8 +628,8 @@ v1defective_i : Root3 -> Vowel -> Verb = \bqy,vowImpf -> -- IL (conjugation 1d4)
|
||||
|
||||
v1doubleweak : Root3 -> Verb = \r'y ->
|
||||
let ry = r'y ** {c = ""} ;
|
||||
vforms_doubleweak : DefForms = \\x => rmSukun (v1DefForms_perfA ry a ! x) ; -- only remove the first sukun
|
||||
vforms_weak : DefForms = v1DefForms_perfA r'y a ;
|
||||
vforms_doubleweak : DefForms = \\x => rmSukun (v1defForms_perfA ry a ! x) ; -- only remove the first sukun
|
||||
vforms_weak : DefForms = v1defForms_perfA r'y a ;
|
||||
vforms = table { 0 => vforms_weak ! 0 ; -- all perfect forms
|
||||
1 => vforms_weak ! 1 ;
|
||||
2 => vforms_weak ! 2 ;
|
||||
@@ -642,7 +661,7 @@ v2sound : Root3 -> Verb = \qsm ->
|
||||
uqassam = "ُ" + qassam ;
|
||||
muqassam = "مُ" + qassam
|
||||
} in
|
||||
verb qassam qussim uqassim uqassam qassim muqassam;
|
||||
verb qassam qussim uqassim uqassam qassim muqassam ;
|
||||
|
||||
v2defective : Root3 -> Verb = \gny ->
|
||||
let {
|
||||
@@ -751,32 +770,41 @@ v6sound : Root3 -> Verb =
|
||||
mutafAqam = "م" + utafAqam
|
||||
} in verb tafAqam tufUqim atafAqam utafAqam tafAqam mutafAqam;
|
||||
|
||||
-- v7sound : Root3 -> Verb = -- TODO 7s
|
||||
-- \fcl ->
|
||||
-- let {
|
||||
-- _facal = mkStrong facal fcl ;
|
||||
-- _facil = mkStrong facil fcl;
|
||||
-- infacal = "اِنْ" + _facal ; -- VPerf Act
|
||||
-- ; -- VPerf Pas
|
||||
-- anfacil = "َنْ" + _facil ; -- VImpf _ Act
|
||||
-- ; -- VImpf _ Pas
|
||||
-- ; -- VImp
|
||||
-- -- VPPart
|
||||
-- } in
|
||||
-- verb ;
|
||||
v7sound : Root3 -> Verb = \fcl ->
|
||||
let vforms = v1soundForms fcl a i ;
|
||||
_nfacil = "نْ" + mkStrong facil fcl ;
|
||||
infacal = "اِنْ" + vforms ! 0 ;
|
||||
anfacil = "َ" + _nfacil ;
|
||||
infacil = "اِ" + _nfacil ;
|
||||
munfacil = "مُ" + _nfacil ;
|
||||
in verb' (table {
|
||||
0 => infacal ;
|
||||
2 => anfacil ;
|
||||
4 => infacil ;
|
||||
5 => munfacil ;
|
||||
n => "ُنْ" + vforms ! n -- doesn't exist for form 7
|
||||
}) ;
|
||||
|
||||
v7geminate : Root3 -> Verb = -- IL 7g -- very likely wrong
|
||||
\fcl ->
|
||||
let {
|
||||
_nfacc = "نْ" + mkHollow facc fcl ;
|
||||
infacal = "اِنْ" + mkStrong facal fcl ; -- VPerf Act -- TODO use another constructor, this is wrong for 3rd person
|
||||
unfucc = "اُنْ" + mkHollow fucc fcl ; -- VPerf Pas
|
||||
anfacc = "َ" + _nfacc ; -- VImpf _ Act
|
||||
unfacc = "ُ" + _nfacc ; -- VImpf _ Pas
|
||||
infacc = "اِ" + _nfacc ; -- VImp
|
||||
munfacc = "مُ" +_nfacc -- VPPart
|
||||
} in
|
||||
verb infacal unfucc anfacc unfacc infacc munfacc ;
|
||||
v7geminate : Str -> Verb = \fcl ->
|
||||
let vforms = v1geminateForms fcl a i ;
|
||||
_nfacc = "نْ" + vforms ! 0 ;
|
||||
_nfacic = "نْ" + mkStrong facil (mkRoot3 fcl) ;
|
||||
infacc = "اِ" + _nfacc ; -- VPerf Act
|
||||
infacac = "اِنْ" + vforms ! 1 ; -- VPerf Act Pl3F
|
||||
anfacc = "َ" + _nfacc ; -- VImpf Act
|
||||
anfacic = "َ" + _nfacic ; -- VImpf Act Pl3F
|
||||
infacic = "اِ" + _nfacic ; -- VImp PlF
|
||||
munfacc = "مُ" + _nfacc ; -- VPPart
|
||||
in verbGeminate (table {
|
||||
0 => infacc ;
|
||||
1 => infacac ;
|
||||
4 => anfacc ;
|
||||
5 => anfacic ;
|
||||
8 => infacc ;
|
||||
9 => infacic ;
|
||||
10 => munfacc ;
|
||||
n => "ُنْ" + vforms ! n -- doesn't exist for form 7
|
||||
}) ;
|
||||
|
||||
v8sound : Root3 -> Verb =
|
||||
\rbT ->
|
||||
|
||||
Reference in New Issue
Block a user