summaryrefslogtreecommitdiff
path: root/examples/messages/MessagesFre.gf
blob: a94588b0f7f9ca38e691191c75af8d3a404864a8 (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
--# -path=.:../phrasebook:present

concrete MessagesFre of Messages = 
  WordsFre - 
    [IMale, IFemale, YouFamMale, YouFamFemale, YouPolMale, YouPolFemale],
  GreetingsFre ** 
 open
  SyntaxFre,
  ParadigmsFre,
  Prelude,
  (Phr = PhrasebookFre)
 in {

lincat
  Message = Text ;
  Heading = {s : Text ; g : Gender ; isPol : Bool} ;
  Body = {s : Gender => Gender => Bool => Text} ;
  Ending = {s : Text ; g : Gender} ;
  Statement = {s : Gender => Gender => Bool => Text} ;
  Recipient = NP ;
  Sender = NP ;
  Title = CN ;
  Role = Phr.NPPerson ;

lin
  Msg h b e = mkText h.s (mkText (b.s ! h.g ! e.g ! h.isPol) e.s) ;
  
  HHello n = {
    s = mkText (strText "bonjour") (mkText (mkPhrase (mkUtt n)) (strText ",")) ;
    g = n.a.g ; ----Res
    isPol = n.isPol ----Res
    } ;
  HDear r = { 
    s = mkText 
      (mkPhrase (mkUtt (mkCN (prefixA (mkA "cher")) (nameCN r)))) 
      (strText ",") ;
    g = r.a.g ; ----Res
    isPol = r.isPol ----Res
    } ;

  BOne  p = p ;
  BMore s b = {s = \\i,y,p => mkText (s.s ! i ! y ! p) (b.s ! i ! y ! p)} ;

  ERegards n = {
    s = mkText (strText "avec salutations") (mkPhrase (mkUtt n)) ;
    g = n.a.g ----Res
    } ;

  SSentence s = {s = \\i,y,p => mkText s} ;
  SQuestion s = {s = \\i,y,p => mkText s} ;
  SGreeting s = {s = \\i,y,p => mkText s exclMarkPunct} ;

  RName n = n ; 
  RTitle t n = cnNP (mkCN t n) ;
  SName n = n ;

  TMr = mkCN (mkN "monsieur" "messieurs" masculine) ;
  TMs = mkCN (mkN "madame" "mesdames" feminine) ;

  RI = Phr.IMale ;
  RYou = Phr.YouFamMale ;

  PRole r = r ;

oper
  strText : Str -> Text = \s -> lin Text {s = s} ;


---- TODO in RG and its API

  nameCN : NP -> CN = \n -> mkCN (mkN "") n ;
  cnNP : CN -> NP = \cn -> mkNP (mkPN (cn.s ! singular) cn.g) ;

}