summaryrefslogtreecommitdiff
path: root/next-lib/src/romance/SentenceRomance.gf
blob: 311c64c34d50a79c258e0d06581fc6ce781ea0a8 (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
incomplete concrete SentenceRomance of Sentence = 
  CatRomance ** open Prelude, CommonRomance, ResRomance in {

  flags optimize=all_subs ;

  lin
    PredVP np vp = mkClause (np.s ! Aton Nom) np.hasClit np.a vp ;

    PredSCVP sc vp = mkClause sc.s False (agrP3 Masc Sg) vp ;

    ImpVP vpr = let vp = useVP vpr in {
      s = \\p,i,g => case i of {
        ImpF n b => (mkImperative b P2 vp).s ! p ! (aagr g n)
        }
      } ;

    SlashVP np v2 = 
      -- agreement decided afterwards: la fille qu'il a trouvée
      {s = \\ag => 
          let vp = case <v2.c2.c, v2.c2.isDir> of {
            <Acc,True> => insertAgr ag v2 ;
            _ => v2
            }
          in (mkClause (np.s ! Aton Nom) np.hasClit np.a vp).s ;
       c2 = v2.c2
      } ;

{---b
    SlashV2 np v2 = 
      {s = \\d,ag =>case <v2.c2.c,v2.c2.isDir> of {
          <Acc,True> => 
               (mkClause (np.s ! Aton Nom) np.hasClit np.a 
                                 (insertAgr ag (predV v2))).s ! d ;
          _ => (mkClause (np.s ! Aton Nom) np.hasClit np.a (predV v2)).s ! d
          } ;
       c2 = v2.c2
      } ;

    SlashVVV2 np vv v2 = 
      {s = \\d,_ =>
        (mkClause
         (np.s ! Aton Nom) np.hasClit np.a
         (insertComplement 
           (\\a => prepCase vv.c2.c ++ v2.s ! VInfin False) (predV vv))).s ! d;
       c2 = v2.c2
      } ;
-}
    AdvSlash slash adv = {
      s  = \\ag,d,t,a,b,m => slash.s ! ag ! d ! t ! a ! b ! m ++ adv.s ;
      c2 = slash.c2
      } ;

    SlashPrep cl prep = {
      s  = \\_ => cl.s ; 
      c2 = {s = prep.s ; c = prep.c ; isDir = False}
      } ;

    SlashVS np vs slash = 
      {s = \\ag =>
        (mkClause
          (np.s ! Aton Nom) np.hasClit np.a
          (insertExtrapos (\\b => conjThat ++ slash.s ! ag ! (vs.m ! b))
            (predV vs))
        ).s ;
       c2 = slash.c2
      } ;

    EmbedS  s  = {s = conjThat ++ s.s ! Indic} ; --- mood
    EmbedQS qs = {s = qs.s ! QIndir} ;
    EmbedVP vp = {s = infVP vp (agrP3 Masc Sg)} ; --- agr ---- compl

    UseCl  t p cl = {
      s = \\o => t.s ++ p.s ++ cl.s ! DDir ! t.t ! t.a ! p.p ! o
    } ;
    UseQCl t p cl = {
      s = \\q => t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p ! q
    } ;
    UseRCl t p cl = {
      s = \\r,ag => t.s ++ p.s ++ cl.s ! ag ! t.t ! t.a ! p.p ! r ; 
      c = cl.c
      } ;
    UseSlash t p cl = {
      s = \\ag,mo => 
          t.s ++ p.s ++ cl.s ! ag ! DDir ! t.t ! t.a ! p.p ! mo ;
      c2 = cl.c2
    } ;

    AdvS a s = {s = \\o => a.s ++ "," ++ s.s ! o} ;

    RelS s r = {
      s = \\o => s.s ! o ++ "," ++ partQIndir ++ r.s ! Indic ! agrP3 Masc Sg
      } ;

}