summaryrefslogtreecommitdiff
path: root/examples/phrasebook/SentencesBul.gf
blob: cf886f27d64f2b53cb1d757d307c0766a09161f4 (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
concrete SentencesBul of Sentences = 
  NumeralBul ** SentencesI - [IMale, IFemale, YouFamMale, YouFamFemale, YouPolMale, 
                              YouPolFemale, ACitizen, Citizenship, PCitizenship, 
                              LangNat, CitiNat, CountryNat, PropCit,
                              Nationality, Country, LAnguage, PLanguage, PCountry
                              ] with 
  (Syntax = SyntaxBul),
  (Symbolic = SymbolicBul),
  (Lexicon = LexiconBul) ** open ExtraBul, (R = ResBul) in {

lincat
    Citizenship = {s1 : R.Gender => R.NForm => Str;                 -- there are two nouns for every citizenship - one for males and one for females
                   s2 : A                                           -- furthermore, adjective for Property
                  } ;           
    Nationality = {s1 : R.Gender => R.NForm => Str;                 -- there are two nouns for every citizenship - one for males and one for females
                   s2 : A;                                          -- furthermore, adjective for Property
                   s3 : PN                                          -- country name
                  } ;
    LAnguage = A ;
    Country = PN ;

lin IMale = mkPerson i_Pron ;
    IFemale = mkPerson i8fem_Pron ;

lin YouFamMale = mkPerson youSg_Pron ;
    YouFamFemale = mkPerson youSg8fem_Pron ;
    YouPolMale, YouPolFemale = mkPerson youPol_Pron ;

lin ACitizen p cit = 
      let noun : N
               = case p.name.a.gn of {
                   R.GSg g => lin N {s   = \\nf => cit.s1 ! g      ! nf;
                                     rel = cit.s2.s;
                                     g   = case g of {R.Masc=>R.AMasc R.Human; R.Fem=>R.AFem; R.Neut=>R.ANeut}
                                    } ;
                   R.GPl   => lin N {s   = \\nf => cit.s1 ! R.Masc ! nf;
                                     rel = cit.s2.s;
                                     g   = R.AMasc R.Human
                                    }
                 } ;
      in mkCl p.name noun ;

    PCitizenship cit =
      mkPhrase (mkUtt (mkAP cit.s2)) ;

    LangNat n = n.s2 ;
    CitiNat n = n ;
    CountryNat n = n.s3 ;
    PropCit cit = cit.s2 ;

    PLanguage x = mkPhrase (mkUtt (mkAP x)) ;
    PCountry x = mkPhrase (mkUtt (mkNP x)) ;

}