(Pes) Cleanup + automatic whitespace removal

This commit is contained in:
Inari Listenmaa
2019-01-31 17:04:47 +01:00
parent 781f049fdd
commit 8a69cd40c7
5 changed files with 124 additions and 153 deletions

View File

@@ -87,10 +87,10 @@ concrete CatPes of Cat = CommonX - [Adv] ** open ResPes, Prelude in {
A = ResPes.Adjective ; --- {s : Gender => Number => Case => Str} ; A = ResPes.Adjective ; --- {s : Gender => Number => Case => Str} ;
A2 = ResPes.Adjective ** { c2 : Str} ; A2 = ResPes.Adjective ** { c2 : Str} ;
N = {s : Ezafa => Number => Str ; animacy : Animacy ; definitness : Bool} ; N = ResPes.Noun ;
N2 = {s : Ezafa => Number => Str ; animacy : Animacy ; definitness : Bool} ** {c : Str}; N2 = ResPes.Noun ** {c : Str};
N3 = {s : Ezafa => Number => Str ; animacy : Animacy ; definitness : Bool} ** {c2 : Str ; c3 : Str } ; N3 = ResPes.Noun ** {c2 : Str ; c3 : Str} ;
PN = {s : Str ; animacy : Animacy} ; PN = {s : Str ; animacy : Animacy} ;
} }

View File

@@ -1,8 +1,8 @@
--# -path=.:../abstract:../common:../hindustani --# -path=.:../abstract:../common
concrete LangPes of Lang = concrete LangPes of Lang =
GrammarPes, GrammarPes
LexiconPes ,LexiconPes
** { ** {
flags startcat = Phr ; unlexer=unwords ; lexer=words ; flags startcat = Phr ; unlexer=unwords ; lexer=words ;

View File

@@ -17,28 +17,20 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in {
UsePN pn = {s = \\_ => pn.s ; a = agrPesP3 Sg ; animacy = pn.animacy } ; UsePN pn = {s = \\_ => pn.s ; a = agrPesP3 Sg ; animacy = pn.animacy } ;
UsePron p = {s = \\_ => p.s ; a = p.a ; animacy = Animate} ; UsePron p = {s = \\_ => p.s ; a = p.a ; animacy = Animate} ;
PredetNP pred np = { PredetNP pred np = np ** {
s = \\ez => pred.s ++ np.s ! ez ; s = \\ez => pred.s ++ np.s ! ez
a = np.a;
animacy = np.animacy
} ; } ;
PPartNP np v2 = { PPartNP np v2 = np ** {
s = \\ez => np.s ! ez ++ partNP (v2.s ! Root1) ; s = \\ez => np.s ! ez ++ partNP (v2.s ! Root1)
a = np.a ;
animacy = np.animacy
} ; } ;
RelNP np rs = { RelNP np rs = np ** {
s = \\ez => np.s ! ez ++ rs.s ! np.a ; s = \\ez => np.s ! ez ++ rs.s ! np.a
a = np.a ;
animacy = np.animacy
} ; } ;
AdvNP np adv = { AdvNP np adv = np ** {
s = \\ez => np.s ! NPC aEzafa ++ adv.s ; s = \\ez => np.s ! NPC aEzafa ++ adv.s
a = np.a ;
animacy = np.animacy
} ; } ;
DetQuantOrd quant num ord = { DetQuantOrd quant num ord = {
@@ -119,22 +111,18 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in {
definitness = True; definitness = True;
} ; } ;
AdjCN ap cn = { AdjCN ap cn = cn ** {
s = \\ez,n => cn.s ! aEzafa ! n ++ ap.s ! ez; -- check the form of adjective and also cn.s!ez!n changed from cn.s!aEzafa!n to have correct enclicitic form other wise it creats wrong enclictic form of old man s = \\ez,n => cn.s ! aEzafa ! n ++ ap.s ! ez -- check the form of adjective and also cn.s!ez!n changed from cn.s!aEzafa!n to have correct enclicitic form other wise it creats wrong enclictic form of old man
animacy = cn.animacy ;
definitness = cn.definitness
} ; } ;
RelCN cn rs = { RelCN cn rs = cn ** {
s = \\ez,n => cn.s ! enClic ! n ++ rs.s ! agrPesP3 n ; s = \\ez,n => cn.s ! enClic ! n ++ rs.s ! agrPesP3 n ;
animacy = cn.animacy ;
definitness = cn.definitness
} ; } ;
AdvCN cn ad = {s = \\ez,n => cn.s ! aEzafa ! n ++ ad.s ; animacy = cn.animacy ; definitness = cn.definitness} ; AdvCN cn ad = cn ** {s = \\ez,n => cn.s ! aEzafa ! n ++ ad.s} ;
SentCN cn sc = {s = \\ez,n => cn.s ! ez ! n ++ sc.s ; animacy = cn.animacy ; definitness = cn.definitness} ; SentCN cn sc = cn ** {s = \\ez,n => cn.s ! ez ! n ++ sc.s} ;
ApposCN cn np = {s = \\ez,n => cn.s ! ez ! n ++ np.s ! NPC aEzafa ; animacy = cn.animacy ; definitness = True} ; -- ezafa form of city to be used ApposCN cn np = cn ** {s = \\ez,n => cn.s ! ez ! n ++ np.s ! NPC aEzafa ; definitness = True} ; -- ezafa form of city to be used
} }

View File

@@ -45,20 +45,19 @@ oper
-- Compound Nouns -- Compound Nouns
mkCmpdNoun1 : Str -> N -> N mkCmpdNoun1 : Str -> N -> N
= \s,noun -> {s =\\ez,n => s ++ noun.s ! ez ! n ; animacy = noun.animacy ; definitness = noun.definitness ; lock_N = <>}; = \s,noun -> noun ** {s =\\ez,n => s ++ noun.s ! ez ! n};
mkCmpdNoun2 : N -> Str -> N mkCmpdNoun2 : N -> Str -> N
= \noun,s -> {s =\\ez,n => noun.s ! ez ! n ++ s ; animacy = noun.animacy ; definitness =noun.definitness ; lock_N = <>}; = \noun,s -> noun ** {s =\\ez,n => noun.s ! ez ! n ++ s};
-- Proper names -- Proper names
mkPN : Str -> Animacy -> PN = mkPN : Str -> Animacy -> PN
= \str,ani -> lin PN {s = str ; animacy = ani} ;
\str,ani -> {s = str ; animacy = ani ; lock_PN = <>} ;
-- Personal Pronouns -- Personal Pronouns
personalPN : Str -> Number -> PPerson -> Pron = personalPN : Str -> Number -> PPerson -> Pron
\str,nn,p -> {s = str ; a = AgPes nn p ; ps = str ; lock_Pron = <>}; = \str,nn,p -> lin Pron {s = str ; a = AgPes nn p ; ps = str};
{- {-
-- Demonstration Pronouns -- Demonstration Pronouns
demoPN : Str -> Str -> Str -> Quant = demoPN : Str -> Str -> Str -> Quant =
@@ -66,10 +65,10 @@ oper
-- Determiner -- Determiner
-} -}
mkDet = overload { mkDet = overload {
mkDet : Str -> Number -> Det = mkDet : Str -> Number -> Det
\s1,n -> makeDet s1 n False ** { lock_Det = <>}; = \s1,n -> lin Det (makeDet s1 n False);
mkDet : Str -> Number -> Bool -> Det = mkDet : Str -> Number -> Bool -> Det
\s1,n,b -> makeDet s1 n b ** { lock_Det = <>}; = \s1,n,b -> lin Det (makeDet s1 n b)
}; };
{- {-
-- Intergative pronouns -- Intergative pronouns
@@ -83,11 +82,11 @@ oper
mkA = overload { mkA = overload {
mkA : Str -> A mkA : Str -> A
= \str -> mkAdj str str ** { lock_A = <>} ; = \str -> lin A (mkAdj str str);
mkA : Str-> Str -> A mkA : Str-> Str -> A
= \str,adv -> mkAdj str adv ** { lock_A = <>} ; = \str,adv -> lin A (mkAdj str adv);
mkA : Str -> Str -> A2 mkA : Str -> Str -> A2
= \a,c -> mkAdj a a ** { c2 = c ; lock_A2 = <>} ; = \a,c -> lin A2 (mkAdj a a ** {c2 = c})
} ; } ;
--2 Verbs --2 Verbs
@@ -113,26 +112,28 @@ oper
} ; } ;
mkV3 : V -> Str -> Str -> V3; mkV3 : V -> Str -> Str -> V3;
mkV3 v p q = v ** { c2 = p ; c3 = q ; lock_V3 = <>} ; mkV3 v p q = lin V3 (v ** {c2 = p ; c3 = q}) ;
mkV2V : V -> Str -> Str -> Bool -> V2V ; mkV2V : V -> Str -> Str -> Bool -> V2V ;
mkV2V v s1 s2 b = v ** {isAux = b ; c1 = s1 ; c2 = s2 ; lock_V2V = <>} ; mkV2V v s1 s2 b = lin V2V (v ** {isAux = b ; c1 = s1 ; c2 = s2}) ;
-- compund verbs -- compund verbs
compoundV = overload { compoundV = overload {
compoundV : Str -> V -> V = \s,v -> {s = \\vf => s ++ v.s ! vf ; lock_V = <>} ; compoundV : Str -> V -> V
compoundV : Str -> V2 -> V = \s,v -> {s = \\vf => s ++ v.s ! vf ; lock_V = <>} ; = \s,v -> v ** {s = \\vf => s ++ v.s ! vf} ;
compoundV : Str -> V2 -> V
= \s,v -> lin V {s = \\vf => s ++ v.s ! vf} ;
}; };
invarV : Str -> V -- for verbs like " بایستن " ("must"), which don't inflect invarV : Str -> V -- for verbs like " بایستن " ("must"), which don't inflect
= \s -> lin V {s = \\_ => s} ; = \s -> lin V {s = \\_ => s} ;
----2 Adverbs ----2 Adverbs
mkAdv : Str -> Adv = \str -> {s = str ; lock_Adv = <>}; mkAdv : Str -> Adv = \str -> lin Adv {s = str} ;
----2 Prepositions ----2 Prepositions
mkPrep : Str -> Prep ; mkPrep : Str -> Prep ;
mkPrep str = {s = str ; lock_Prep = <>}; mkPrep str = lin Prep {s = str};
{- {-
--3 Determiners and quantifiers --3 Determiners and quantifiers
@@ -186,23 +187,5 @@ oper
-- --
-- V0 : Type ; -- V0 : Type ;
-- AS, A2S, AV, A2V : Type ; -- AS, A2S, AV, A2V : Type ;
-- --}
----.
----2 Definitions of paradigms
----
---- The definitions should not bother the user of the API. So they are
---- hidden from the document.
--
-- Gender = MorphoHin.Gender ;
-- Number = MorphoHin.Number ;
-- Case = MorphoHin.Case ;
-- human = Masc ;
-- nonhuman = Neutr ;
-- masculine = Masc ;
-- feminine = Fem ;
-- singular = Sg ;
-- plural = Pl ;
-- nominative = Nom ;
-- genitive = Gen ;
-}
} }