summaryrefslogtreecommitdiff
path: root/gf-book/examples/chapter9/hebrew/GrammarHeb.gf
blob: a872e4ba77b396830b60ae37c5fe7203fb107eb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
--# -path=alltenses

concrete GrammarHeb of Grammar = open ResHeb, Prelude in {

  lincat  

    Cl = {s : ResHeb.Tense => Str} ; 
    VP = ResHeb.VP ;              -- {v : Verb ; obj : Str} ;
    NP = ResHeb.NP ;              -- {s : Case =>  {obj : Str} ; a : Agr ; isDef : Bool ; sp : Species} ;
    AP = {s : Number => Species => Gender =>  Str } ; 
    CN = ResHeb.Noun ;      	  -- {s : Number => Species => Str ; g: Gender} ;
    Det = {s :  Gender => Str ; n : Number ; sp : Species; isDef : Bool} ; 
    N = ResHeb.Noun ;         	  -- {s : Number => Species => Str ; g: Gender } ;
    A = ResHeb.Adj ;              -- {s :  Number => Species => Gender => Str} ; 
    V = ResHeb.Verb ;          	  -- {s : Tense => VPerNumGen  => Str } ;
    V2 = ResHeb.Verb2 ; 	  -- Verb ** {c : Case} ; 

  lin

-- predication

  PredVP np vp = 
       let 
	   subj = (np.s ! Nom ).obj ;
           obj = vp.obj
        in {
            s = \\t => subj ++ (agrV vp.v t np.a) ++ obj } ;


  ComplV2 v2 np = 
     let
        nps = np.s ! v2.c  
      in {
        v =  {s =  v2.s } ;
        obj  =  case <np.isDef> of  
 	     { <True> =>  "At" ++ nps.obj; -- direct objects require the object marker 'et' and must be in definite form
	         _    =>  nps.obj } 
       } ;        


-- determination
-- ha-Aysh ha-zwt : this woman 
-- ha-bait : the house
-- ha-bait ha-ze : this house
-- ha-bait ha-yarok ha-ze : this green house 

   DetCN det cn = {
    	s = \\c => {obj = cn.s ! det.n  ! det.sp ++ det.s ! cn.g } ;
 	isDef = det.isDef ;
	sp =  det.sp ;
        a = Ag cn.g det.n Per3 
      } ;
   
   ModCN cn ap = {
      s = \\sp => table {n => cn.s ! sp ! n ++  ap.s ! sp ! n  ! cn.g} ; 
      g = cn.g 
      } ;

    UseV v =  { v = v  ; obj =  [] };

    UseN n = n ; 

    UseA adj = adj ;
    	      
    a_Det =  { 
       s = table { _ => ""  } ;
       n = Sg ;
       sp = Indef ;
       isDef = False 
      } ; 
 
    the_Det = {
      s = table { _ => "" } ;
      n = Sg ;
      sp = Def ;
      isDef = True 
      } ;

    this_Det = {
      s = table { Masc =>  "hzh" ;  Fem => "hzAt" } ;
      n = Sg ;
      sp = Def ;
      isDef = True 
      } ;

     these_Det = {
       s = table {_ => "hAlh" }  ;
       n = Pl ;
       sp = Def ;
       isDef = True 
      } ;

     i_NP = pronNP "Any" "Awty" "ly" Masc Sg Per1 ; --both fem and masc
     we_NP = pronNP "AnHnw" "Awtnw" "lnw" Masc Pl Per1; --both fem and masc
     she_NP = pronNP "hyA" "Awth" "lh" Fem Sg Per3  ; 
}