1
0
forked from GitHub/gf-core

improved the performance of Romance while retaining correct agreement ; removed Diff modules from Phrasebook

This commit is contained in:
aarne
2010-04-06 20:35:12 +00:00
parent 40ec2f5229
commit f3ae4092d5
49 changed files with 161 additions and 240 deletions

View File

@@ -1,9 +0,0 @@
interface DiffPhrasebook = open Syntax in {
oper
want_V2 : V2 ;
like_V2 : V2 ;
cost_V2 : V2 ; -- it costs five euros
cost_V : V ; -- how much does it cost
}

View File

@@ -1,12 +0,0 @@
instance DiffPhrasebookEng of DiffPhrasebook = open
SyntaxEng,
ParadigmsEng,
IrregEng
in {
oper
want_V2 = mkV2 (mkV "want") ;
like_V2 = mkV2 (mkV "like") ;
cost_V2 = mkV2 IrregEng.cost_V ;
cost_V = IrregEng.cost_V ;
}

View File

@@ -1,14 +0,0 @@
instance DiffPhrasebookFin of DiffPhrasebook = open
SyntaxFin,
ParadigmsFin
in {
flags coding = utf8 ;
oper
want_V2 = mkV2 (mkV "haluta") ;
like_V2 = mkV2 (mkV "pitää") elative ;
cost_V2 = mkV2 (mkV "maksaa") ;
cost_V = mkV "maksaa" ;
}

View File

@@ -1,16 +0,0 @@
instance DiffPhrasebookFre of DiffPhrasebook = open
SyntaxFre,
IrregFre,
ParadigmsFre
in {
flags coding = utf8 ;
oper
want_V2 = vouloir_V2 ;
like_V2 = mkV2 (mkV "aimer") ;
cost_V2 = mkV2 (mkV "coûter") ;
cost_V = mkV "coûter" ;
}

View File

@@ -1,14 +0,0 @@
instance DiffPhrasebookIta of DiffPhrasebook = open
SyntaxIta,
BeschIta,
ParadigmsIta
in {
oper
want_V2 = mkV2 (mkV (volere_96 "volere")) ;
like_V2 = mkV2 (mkV "amare") ; ----
cost_V2 = mkV2 (mkV "costare") ;
cost_V = mkV "costare" ;
}

View File

@@ -1,17 +0,0 @@
instance DiffPhrasebookRon of DiffPhrasebook = open
SyntaxRon,
BeschRon,
ParadigmsRon
in {
flags coding = utf8 ;
oper
want_V2 = dirV2 (lin V want_VV) ; -- mkVV (v_besch74 "vrea")
like_V2 = dirV2 (v_besch71 "plăcea") ;
cost_V2 = dirV2(v_besch18 "costa") ;
cost_V = v_besch18 "costa" ;
}

View File

@@ -1,12 +0,0 @@
instance DiffPhrasebookSwe of DiffPhrasebook = open
SyntaxSwe,
ParadigmsSwe
in {
oper
want_V2 = mkV2 (mkV "önska") ; ---- vill ha
like_V2 = mkV2 (mkV "tycker") (mkPrep "om") ;
cost_V2 = mkV2 (mkV "kosta") ;
cost_V = mkV "kosta" ;
}

View File

@@ -85,8 +85,6 @@ abstract Sentences = Numeral ** {
The, Thes : Kind -> Item ; -- the pizza, the pizzas The, Thes : Kind -> Item ; -- the pizza, the pizzas
AmountCurrency : Numeral -> Currency -> Price ; -- five euros AmountCurrency : Numeral -> Currency -> Price ; -- five euros
HowMuchCost : Item -> Question ; -- how much does the pizza cost
ItCost : Item -> Price -> Proposition ; -- the pizza costs five euros
ThePlace : PlaceKind -> Place ; -- the bar ThePlace : PlaceKind -> Place ; -- the bar

View File

@@ -1,5 +1,4 @@
concrete SentencesEng of Sentences = NumeralEng ** SentencesI with concrete SentencesEng of Sentences = NumeralEng ** SentencesI with
(DiffPhrasebook = DiffPhrasebookEng),
(Syntax = SyntaxEng), (Syntax = SyntaxEng),
(Symbolic = SymbolicEng), (Symbolic = SymbolicEng),
(Lexicon = LexiconEng) ; (Lexicon = LexiconEng) ;

View File

@@ -1,5 +1,4 @@
concrete SentencesFin of Sentences = NumeralFin ** SentencesI with concrete SentencesFin of Sentences = NumeralFin ** SentencesI with
(DiffPhrasebook = DiffPhrasebookFin),
(Syntax = SyntaxFin), (Syntax = SyntaxFin),
(Symbolic = SymbolicFin), (Symbolic = SymbolicFin),
(Lexicon = LexiconFin) ; (Lexicon = LexiconFin) ;

View File

@@ -3,7 +3,6 @@ concrete SentencesFre of Sentences = NumeralFre ** SentencesI - [
IFemale, YouFamFemale, YouPolFemale IFemale, YouFamFemale, YouPolFemale
] ]
with with
(DiffPhrasebook = DiffPhrasebookFre),
(Syntax = SyntaxFre), (Syntax = SyntaxFre),
(Symbolic = SymbolicFre), (Symbolic = SymbolicFre),
(Lexicon = LexiconFre) ** (Lexicon = LexiconFre) **

View File

@@ -1,6 +1,5 @@
incomplete concrete SentencesI of Sentences = Numeral ** incomplete concrete SentencesI of Sentences = Numeral **
open open
DiffPhrasebook,
Syntax, Syntax,
Lexicon, Lexicon,
Symbolic, -- for names as strings Symbolic, -- for names as strings
@@ -57,9 +56,6 @@ incomplete concrete SentencesI of Sentences = Numeral **
PropAction a = a ; PropAction a = a ;
HowMuchCost item = mkQS (mkQCl how8much_IAdv (mkCl item cost_V)) ;
ItCost item price = mkCl item cost_V2 price ;
AmountCurrency num curr = mkNP <lin Numeral num : Numeral> curr ; AmountCurrency num curr = mkNP <lin Numeral num : Numeral> curr ;
ObjItem i = i ; ObjItem i = i ;

View File

@@ -2,7 +2,6 @@ concrete SentencesIta of Sentences = NumeralIta ** SentencesI - [
IFemale, YouFamFemale, YouPolFemale IFemale, YouFamFemale, YouPolFemale
] ]
with with
(DiffPhrasebook = DiffPhrasebookIta),
(Syntax = SyntaxIta), (Syntax = SyntaxIta),
(Symbolic = SymbolicIta), (Symbolic = SymbolicIta),
(Lexicon = LexiconIta) ** (Lexicon = LexiconIta) **

View File

@@ -1,5 +1,4 @@
concrete SentencesRon of Sentences = NumeralRon ** SentencesI with concrete SentencesRon of Sentences = NumeralRon ** SentencesI with
(DiffPhrasebook = DiffPhrasebookRon),
(Syntax = SyntaxRon), (Syntax = SyntaxRon),
(Symbolic = SymbolicRon), (Symbolic = SymbolicRon),
(Lexicon = LexiconRon) ; (Lexicon = LexiconRon) ;

View File

@@ -1,5 +1,4 @@
concrete SentencesSwe of Sentences = NumeralSwe ** SentencesI with concrete SentencesSwe of Sentences = NumeralSwe ** SentencesI with
(DiffPhrasebook = DiffPhrasebookSwe),
(Syntax = SyntaxSwe), (Syntax = SyntaxSwe),
(Symbolic = SymbolicSwe), (Symbolic = SymbolicSwe),
(Lexicon = LexiconSwe) ; (Lexicon = LexiconSwe) ;

View File

@@ -45,4 +45,7 @@ abstract Words = Sentences ** {
PropOpenDay : Place -> Day -> Proposition ; PropOpenDay : Place -> Day -> Proposition ;
PropClosedDay : Place -> Day -> Proposition ; PropClosedDay : Place -> Day -> Proposition ;
HowMuchCost : Item -> Question ; -- how much does the pizza cost
ItCost : Item -> Price -> Proposition ; -- the pizza costs five euros
} }

View File

@@ -78,6 +78,9 @@ concrete WordsEng of Words = SentencesEng **
PropOpenDay p d = mkCl p.name (mkVP (mkVP open_Adv) d.habitual) ; PropOpenDay p d = mkCl p.name (mkVP (mkVP open_Adv) d.habitual) ;
PropClosedDay p d = mkCl p.name (mkVP (mkVP closed_Adv) d.habitual) ; PropClosedDay p d = mkCl p.name (mkVP (mkVP closed_Adv) d.habitual) ;
HowMuchCost item = mkQS (mkQCl how8much_IAdv (mkCl item IrregEng.cost_V)) ;
ItCost item price = mkCl item (mkV2 IrregEng.cost_V) price ;
oper oper
mkNat : Str -> Str -> {lang : NP ; prop : A ; country : NP} = \nat,co -> mkNat : Str -> Str -> {lang : NP ; prop : A ; country : NP} = \nat,co ->
{lang = mkNP (mkPN nat) ; prop = mkA nat ; country = mkNP (mkPN co)} ; {lang = mkNP (mkPN nat) ; prop = mkA nat ; country = mkNP (mkPN co)} ;

View File

@@ -3,7 +3,7 @@
concrete WordsFin of Words = SentencesFin ** concrete WordsFin of Words = SentencesFin **
open open
SyntaxFin, ParadigmsFin, (L = LangFin), SyntaxFin, ParadigmsFin, (L = LangFin),
DiffPhrasebookFin, Prelude, (E = ExtraFin) in { Prelude, (E = ExtraFin) in {
lin lin
Wine = mkCN (mkN "viini") ; Wine = mkCN (mkN "viini") ;
Beer = mkCN (mkN "olut" "oluita") ; Beer = mkCN (mkN "olut" "oluita") ;
@@ -61,7 +61,7 @@ concrete WordsFin of Words = SentencesFin **
Saturday = let d = "lauantai" in mkDay (mkPN d) (d + "sin") ; Saturday = let d = "lauantai" in mkDay (mkPN d) (d + "sin") ;
Sunday = let d = "sunnuntai" in mkDay (mkPN d) (d + "sin") ; Sunday = let d = "sunnuntai" in mkDay (mkPN d) (d + "sin") ;
AWant p obj = mkCl p.name want_V2 obj ; AWant p obj = mkCl p.name (mkV2 "haluta") obj ;
ALike p item = mkCl p.name L.like_V2 item ; ALike p item = mkCl p.name L.like_V2 item ;
ASpeak p lang = mkCl p.name (mkV2 (mkV "puhua") partitive) lang ; ASpeak p lang = mkCl p.name (mkV2 (mkV "puhua") partitive) lang ;
ALove p q = mkCl p.name (mkV2 (mkV "rakastaa") partitive) q.name ; ALove p q = mkCl p.name (mkV2 (mkV "rakastaa") partitive) q.name ;
@@ -86,6 +86,9 @@ concrete WordsFin of Words = SentencesFin **
PropOpenDay p d = mkCl p.name (mkVP (mkVP open_Adv) d.habitual) ; PropOpenDay p d = mkCl p.name (mkVP (mkVP open_Adv) d.habitual) ;
PropClosedDay p d = mkCl p.name (mkVP (mkVP closed_Adv) d.habitual) ; PropClosedDay p d = mkCl p.name (mkVP (mkVP closed_Adv) d.habitual) ;
HowMuchCost item = mkQS (mkQCl how8much_IAdv (mkCl item (mkV "maksaa"))) ;
ItCost item price = mkCl item (mkV2 (mkV "maksaa")) price ;
oper oper
mkNat : PN -> PN -> A -> mkNat : PN -> PN -> A ->
{lang : NP ; prop : A ; country : NP} = \nat,co,pro -> {lang : NP ; prop : A ; country : NP} = \nat,co,pro ->

View File

@@ -2,7 +2,6 @@
concrete WordsFre of Words = SentencesFre ** open concrete WordsFre of Words = SentencesFre ** open
SyntaxFre, SyntaxFre,
DiffPhrasebookFre,
IrregFre, IrregFre,
(E = ExtraFre), (E = ExtraFre),
ParadigmsFre, ParadigmsFre,
@@ -59,7 +58,7 @@ Good = prefixA (mkA "bon" "bonne" "bons" "bien") ;
Saturday = mkDay "samedi" ; Saturday = mkDay "samedi" ;
Sunday = mkDay "dimanche" ; Sunday = mkDay "dimanche" ;
AWant p obj = mkCl p.name want_V2 obj ; AWant p obj = mkCl p.name vouloir_V2 obj ;
ALike p item = mkCl item plaire_V2 p.name ; ALike p item = mkCl item plaire_V2 p.name ;
ASpeak p lang = mkCl p.name (mkV2 (mkV "parler")) lang ; ASpeak p lang = mkCl p.name (mkV2 (mkV "parler")) lang ;
ALove p q = mkCl p.name (mkV2 (mkV "aimer")) q.name ; ALove p q = mkCl p.name (mkV2 (mkV "aimer")) q.name ;
@@ -86,6 +85,9 @@ Good = prefixA (mkA "bon" "bonne" "bons" "bien") ;
PropOpenDay p d = mkCl p.name (mkVP (mkVP open_A) d.habitual) ; PropOpenDay p d = mkCl p.name (mkVP (mkVP open_A) d.habitual) ;
PropClosedDay p d = mkCl p.name (mkVP (mkVP closed_A) d.habitual) ; PropClosedDay p d = mkCl p.name (mkVP (mkVP closed_A) d.habitual) ;
HowMuchCost item = mkQS (mkQCl how8much_IAdv (mkCl item (mkV "coûter"))) ;
ItCost item price = mkCl item (mkV2 (mkV "coûter")) price ;
oper oper
mkNat : Str -> Str -> {lang : NP ; prop : A ; country : NP} = \nat,co -> mkNat : Str -> Str -> {lang : NP ; prop : A ; country : NP} = \nat,co ->
{lang = mkNP (mkPN nat) ; prop = mkA nat ; country = mkNP (mkPN co)} ; {lang = mkNP (mkPN nat) ; prop = mkA nat ; country = mkNP (mkPN co)} ;

View File

@@ -2,7 +2,6 @@
concrete WordsIta of Words = SentencesIta ** open concrete WordsIta of Words = SentencesIta ** open
SyntaxIta, SyntaxIta,
DiffPhrasebookIta,
BeschIta, BeschIta,
(E = ExtraIta), (E = ExtraIta),
(L = LexiconIta), (L = LexiconIta),
@@ -60,7 +59,7 @@ Good = prefixA (mkA "buono" "buona" "buoni" "buone" "bene") ;
Saturday = mkDay "sabato" ; Saturday = mkDay "sabato" ;
Sunday = mkDay "domenica" ; Sunday = mkDay "domenica" ;
AWant p obj = mkCl p.name want_V2 obj ; AWant p obj = mkCl p.name (mkV2 (mkV (volere_96 "volere"))) obj ;
ALike p item = mkCl item (mkV2 (mkV (piacere_64 "piacere")) dative) p.name ; ALike p item = mkCl item (mkV2 (mkV (piacere_64 "piacere")) dative) p.name ;
ASpeak p lang = mkCl p.name (mkV2 (mkV "parlare")) lang ; ASpeak p lang = mkCl p.name (mkV2 (mkV "parlare")) lang ;
ALove p q = mkCl p.name (mkV2 (mkV "amare")) q.name ; ALove p q = mkCl p.name (mkV2 (mkV "amare")) q.name ;
@@ -87,6 +86,9 @@ Good = prefixA (mkA "buono" "buona" "buoni" "buone" "bene") ;
PropOpenDay p d = mkCl p.name (mkVP (mkVP open_A) d.habitual) ; PropOpenDay p d = mkCl p.name (mkVP (mkVP open_A) d.habitual) ;
PropClosedDay p d = mkCl p.name (mkVP (mkVP closed_A) d.habitual) ; PropClosedDay p d = mkCl p.name (mkVP (mkVP closed_A) d.habitual) ;
HowMuchCost item = mkQS (mkQCl how8much_IAdv (mkCl item (mkV "costare"))) ;
ItCost item price = mkCl item (mkV2 (mkV "costare")) price ;
oper oper
mkNat : Str -> Str -> {lang : NP ; prop : A ; country : NP} = \nat,co -> mkNat : Str -> Str -> {lang : NP ; prop : A ; country : NP} = \nat,co ->
{lang = mkNP (mkPN nat) ; prop = mkA nat ; country = mkNP (mkPN co)} ; {lang = mkNP (mkPN nat) ; prop = mkA nat ; country = mkNP (mkPN co)} ;

View File

@@ -3,8 +3,7 @@
concrete WordsRon of Words = SentencesRon ** open concrete WordsRon of Words = SentencesRon ** open
SyntaxRon, SyntaxRon,
ParadigmsRon, ParadigmsRon,
BeschRon, BeschRon in
DiffPhrasebookRon in
{ {
flags coding=utf8 ; flags coding=utf8 ;
@@ -42,8 +41,8 @@ Good = mkA "bun" "bună" "buni" "bune" "bine" ;
-- Romanian = SyntaxRon.mkNP (mkPN "română") ; ---- ? -- Romanian = SyntaxRon.mkNP (mkPN "română") ; ---- ?
-- Swedish = mkNP (mkPN "suédois") ; -- Swedish = mkNP (mkPN "suédois") ;
AWant p obj = mkCl p.name want_V2 obj ; AWant p obj = mkCl p.name (dirV2 (lin V want_VV)) obj ;
ALike p item = mkCl p.name like_V2 item ; ALike p item = mkCl p.name (dirV2 (v_besch71 "plăcea")) item ;
ASpeak p lang = mkCl p.name (dirV2 (mkV "vorbi")) lang ; ASpeak p lang = mkCl p.name (dirV2 (mkV "vorbi")) lang ;
ALove p q = mkCl p.name (dirV2 (mkV "iubi")) q.name ; ALove p q = mkCl p.name (dirV2 (mkV "iubi")) q.name ;
AUnderstand p = mkCl p.name (v_besch83 "înţelege") ; AUnderstand p = mkCl p.name (v_besch83 "înţelege") ;
@@ -53,7 +52,6 @@ Good = mkA "bun" "bună" "buni" "bune" "bine" ;
-- ATired p = mkCl p (mkA "stanco") ; -- ATired p = mkCl p (mkA "stanco") ;
-- AScared p = mkCl p (E.ComplCN have_V2 (mkCN (mkN "paura" feminine))) ; -- AScared p = mkCl p (E.ComplCN have_V2 (mkCN (mkN "paura" feminine))) ;
{- {-
GImHungry = ss "mi-e foame" ; GImHungry = ss "mi-e foame" ;
GImThirsty = ss "mi-e sete" ; GImThirsty = ss "mi-e sete" ;
@@ -61,6 +59,9 @@ Good = mkA "bun" "bună" "buni" "bune" "bine" ;
GImScared = ss "mi-e frică" ; GImScared = ss "mi-e frică" ;
-} -}
HowMuchCost item = mkQS (mkQCl how8much_IAdv (mkCl item (v_besch18 "costa"))) ;
ItCost item price = mkCl item (dirV2 (v_besch18 "costa")) price ;
oper oper
mkPlace : N -> Prep -> {name : CN ; at : Prep ; to : Prep} = \p,i -> { mkPlace : N -> Prep -> {name : CN ; at : Prep ; to : Prep} = \p,i -> {
name = mkCN p ; name = mkCN p ;

View File

@@ -77,6 +77,9 @@ concrete WordsSwe of Words = SentencesSwe **
PropOpenDay p d = mkCl p.name (mkVP (mkVP open_A) d.habitual) ; PropOpenDay p d = mkCl p.name (mkVP (mkVP open_A) d.habitual) ;
PropClosedDay p d = mkCl p.name (mkVP (mkVP closed_A) d.habitual) ; PropClosedDay p d = mkCl p.name (mkVP (mkVP closed_A) d.habitual) ;
HowMuchCost item = mkQS (mkQCl how8much_IAdv (mkCl item (mkV "kosta"))) ;
ItCost item price = mkCl item (mkV2 (mkV "kosta")) price ;
oper oper
mkNat : Str -> Str -> {lang : NP ; prop : A ; country : NP} = \nat,co -> mkNat : Str -> Str -> {lang : NP ; prop : A ; country : NP} = \nat,co ->
{lang = mkNP (mkPN (nat + "a")) ; {lang = mkNP (mkPN (nat + "a")) ;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View File

@@ -17,10 +17,10 @@
History History
</P> </P>
<UL> <UL>
<LI>26 March 2010. Version 0.1: Eng, Fin, Fre, Ron; dedicated minibar UI.
<LI>28 March. Version 0.2: Swe, Ita; cat Action; small phrases.
<LI>30 March. Version 0.3: disambiguation grammar for English
<LI>6 April. Version 0.4: weekdays, nationalities <LI>6 April. Version 0.4: weekdays, nationalities
<LI>30 March. Version 0.3: disambiguation grammar for English
<LI>28 March. Version 0.2: Swe, Ita; cat Action; small phrases.
<LI>26 March 2010. Version 0.1: Eng, Fin, Fre, Ron; dedicated minibar UI.
</UL> </UL>
<P> <P>
@@ -117,9 +117,6 @@ Separate concrete syntaxes.
Separate concrete syntaxes. Separate concrete syntaxes.
</P> </P>
<P> <P>
<CODE>DiffPhrasebook</CODE>: the (so far small) interface for <CODE>Sentences</CODE>.
</P>
<P>
<CODE>DisambPhrasebook</CODE>: disambiguation grammars generating feedback phrases if <CODE>DisambPhrasebook</CODE>: disambiguation grammars generating feedback phrases if
the input language is ambiguous. the input language is ambiguous.
</P> </P>
@@ -128,7 +125,7 @@ Here is the module structure as produced by
</P> </P>
<PRE> <PRE>
&gt; i -retain DisambPhrasebookEng.gf &gt; i -retain DisambPhrasebookEng.gf
&gt; dg -only=Phrasebook*,Sentences*,Words*,Greetings*,DiffP*,DisambPhrasebookEng &gt; dg -only=Phrasebook*,Sentences*,Words*,Greetings*,DisambPhrasebookEng
&gt; ! dot -Tpng _gfdepgraph.dot &gt;pgraph.png &gt; ! dot -Tpng _gfdepgraph.dot &gt;pgraph.png
</PRE> </PRE>
<P></P> <P></P>

View File

@@ -13,10 +13,10 @@ Aarne Ranta
#BSMALL #BSMALL
History History
- 26 March 2010. Version 0.1: Eng, Fin, Fre, Ron; dedicated minibar UI.
- 28 March. Version 0.2: Swe, Ita; cat Action; small phrases.
- 30 March. Version 0.3: disambiguation grammar for English
- 6 April. Version 0.4: weekdays, nationalities - 6 April. Version 0.4: weekdays, nationalities
- 30 March. Version 0.3: disambiguation grammar for English
- 28 March. Version 0.2: Swe, Ita; cat Action; small phrases.
- 26 March 2010. Version 0.1: Eng, Fin, Fre, Ron; dedicated minibar UI.
[Missing constructs missing.txt] [Missing constructs missing.txt]
@@ -99,15 +99,13 @@ Separate concrete syntaxes.
``Phrasebook``: the top module putting everything together. ``Phrasebook``: the top module putting everything together.
Separate concrete syntaxes. Separate concrete syntaxes.
``DiffPhrasebook``: the (so far small) interface for ``Sentences``.
``DisambPhrasebook``: disambiguation grammars generating feedback phrases if ``DisambPhrasebook``: disambiguation grammars generating feedback phrases if
the input language is ambiguous. the input language is ambiguous.
Here is the module structure as produced by Here is the module structure as produced by
``` ```
> i -retain DisambPhrasebookEng.gf > i -retain DisambPhrasebookEng.gf
> dg -only=Phrasebook*,Sentences*,Words*,Greetings*,DiffP*,DisambPhrasebookEng > dg -only=Phrasebook*,Sentences*,Words*,Greetings*,DisambPhrasebookEng
> ! dot -Tpng _gfdepgraph.dot >pgraph.png > ! dot -Tpng _gfdepgraph.dot >pgraph.png
``` ```

View File

@@ -87,23 +87,21 @@ oper
infForm _ _ _ _ = True ; infForm _ _ _ _ = True ;
mkImperative b p vp = { mkImperative b p vp =
s = \\pol,agr => \\pol,g,n =>
let let
pe = case b of {True => P3 ; _ => p} ; pe = case b of {True => P3 ; _ => p} ;
---- agr = aag ** {p = pe} ; agr = {g = g ; n = n ; p = pe} ;
aag = verbAgr agr ; ----
clpr = <[],[],False> ; ----e pronArg agr.n agr.p vp.clAcc vp.clDat ; clpr = <[],[],False> ; ----e pronArg agr.n agr.p vp.clAcc vp.clDat ;
----e verb = case <aag.n, pol,pe> of { ----e verb = case <aag.n, pol,pe> of {
----e <Sg,Neg,P2> => (vp.s ! VPInfinit Simul clpr.p3).inf ! aag ; ----e <Sg,Neg,P2> => (vp.s ! VPInfinit Simul clpr.p3).inf ! aag ;
----e _ => (vp.s ! VPImperat).fin ! agr ----e _ => (vp.s ! VPImperat).fin ! agr
----e } ; ----e } ;
verb = vp.s.s ! vImperForm agr ; ----e verb = vp.s.s ! vImper n pe ; ----e
neg = vp.neg ! pol ; neg = vp.neg ! pol ;
compl = neg.p2 ++ clpr.p2 ++ vp.comp ! agr ++ vp.ext ! pol compl = neg.p2 ++ clpr.p2 ++ vp.comp ! agr ++ vp.ext ! pol
in in
neg.p1 ++ verb ++ bindIf clpr.p3 ++ clpr.p1 ++ compl ; neg.p1 ++ verb ++ bindIf clpr.p3 ++ clpr.p1 ++ compl ;
} ;
negation : Polarity => (Str * Str) = table { negation : Polarity => (Str * Str) = table {
Pos => <[],[]> ; Pos => <[],[]> ;

View File

@@ -4,10 +4,10 @@ concrete IdiomCat of Idiom = CatCat **
flags optimize=all_subs ; flags optimize=all_subs ;
lin lin
ExistNP np = mkClause [] True (agrP3 Masc Sg) ExistNP np = mkClause [] True False (agrP3 Masc Sg)
(insertClit3 "hi" (insertComplement (\\_ => (np.s ! Acc).ton) (predV haver_V))) ; (insertClit3 "hi" (insertComplement (\\_ => (np.s ! Acc).ton) (predV haver_V))) ;
GenericCl vp = mkClause "hom" True (agrP3 Masc Sg) vp ; GenericCl vp = mkClause "hom" True False (agrP3 Masc Sg) vp ;
ImpersCl vp = mkClause [] True (agrP3 Masc Sg) vp ; ImpersCl vp = mkClause [] True False (agrP3 Masc Sg) vp ;
ProgrVP vp = ProgrVP vp =
@@ -23,7 +23,7 @@ concrete IdiomCat of Idiom = CatCat **
----AR, for completeness ----AR, for completeness
CleftNP np rs = mkClause [] True (agrP3 Masc Sg) CleftNP np rs = mkClause [] True False (agrP3 Masc Sg)
(insertComplement (\\_ => rs.s ! Indic ! np.a) (insertComplement (\\_ => rs.s ! Indic ! np.a)
(insertComplement (\\_ => (np.s ! rs.c).ton) (predV copula))) ; (insertComplement (\\_ => (np.s ! rs.c).ton) (predV copula))) ;
@@ -31,17 +31,17 @@ concrete IdiomCat of Idiom = CatCat **
ExistIP ip = { ExistIP ip = {
s = \\t,a,p,_ => s = \\t,a,p,_ =>
ip.s ! Nom ++ ip.s ! Nom ++
(mkClause [] True (mkClause [] True False
(agrP3 Masc Sg) (agrP3 Masc Sg)
(insertClit3 "hi" (insertComplement (\\_ => ip.s ! Acc) (predV haver_V)))) (insertClit3 "hi" (insertComplement (\\_ => ip.s ! Acc) (predV haver_V))))
.s ! DDir ! t ! a ! p ! Indic .s ! DDir ! t ! a ! p ! Indic
} ; } ;
ImpPl1 vp = {s = ImpPl1 vp = {s =
(mkImperative False P1 vp).s ! Pos ! Ag Masc Pl P1 ; --- fem mkImperative False P1 vp ! Pos ! Masc ! Pl --- fem
} ; } ;
CleftAdv ad s = mkClause [] True (agrP3 Masc Sg) CleftAdv ad s = mkClause [] True False (agrP3 Masc Sg)
(insertComplement (\\_ => conjThat ++ s.s ! Indic) (insertComplement (\\_ => conjThat ++ s.s ! Indic)
(insertComplement (\\_ => ad.s) (predV copula))) ; (insertComplement (\\_ => ad.s) (predV copula))) ;

View File

@@ -147,7 +147,7 @@ oper
_ => ses _ => ses
} ; } ;
a = Ag g n p ; a = Ag g n p ;
hasClit = True hasClit = True ; isPol = False
} ; } ;
elisPoss : Str -> Str = \s -> elisPoss : Str -> Str = \s ->

View File

@@ -316,7 +316,7 @@ oper
} }
} ; } ;
makeNP x g n = {s = (pn2np (mk2PN x g)).s; a = agrP3 g n ; hasClit = False} ** {lock_NP = <>} ; makeNP x g n = {s = (pn2np (mk2PN x g)).s; a = agrP3 g n ; hasClit = False ; isPol = False} ** {lock_NP = <>} ;
mk5A a b c d e = mk5A a b c d e =
compADeg {s = \\_ => (mkAdj a b c d e).s ; isPre = False ; lock_A = <>} ; compADeg {s = \\_ => (mkAdj a b c d e).s ; isPre = False ; lock_A = <>} ;

View File

@@ -118,21 +118,21 @@ instance DiffFre of DiffRomance = open CommonRomance, PhonoFre, Prelude in {
_ => <pdat ++ pacc, []> _ => <pdat ++ pacc, []>
} ; } ;
mkImperative b p vp = { mkImperative b p vp =
s = \\pol,ag => \\pol,g,n =>
let let
agr = verbAgr ag ; agr = Ag g n p ;
num = if_then_else Number b Pl agr.n ; num = if_then_else Number b Pl n ;
verb = vp.s.s ! vImperForm ag ; verb = vp.s.s ! vImper n p ;
neg = vp.neg ! pol ; neg = vp.neg ! pol ;
clpr = <vp.clit1 ++ vp.clit2, False> ; ---- TODO: True if clit clpr = <vp.clit1 ++ vp.clit2, False> ; ---- TODO: True if clit
compl = vp.comp ! ag ++ vp.ext ! pol compl = vp.comp ! agr ++ vp.ext ! pol
in in
case pol of { case pol of {
Pos => verb ++ if_then_Str clpr.p2 "-" [] ++ clpr.p1 ++ compl ; Pos => verb ++ if_then_Str clpr.p2 "-" [] ++ clpr.p1 ++ compl ;
Neg => neg.p1 ++ clpr.p1 ++ verb ++ neg.p2 ++ compl Neg => neg.p1 ++ clpr.p1 ++ verb ++ neg.p2 ++ compl
} } ;
} ; ---- TODO: vois-le vs. vois-moi vs. ne me vois pas ---- TODO: vois-le vs. vois-moi vs. ne me vois pas
negation : Polarity => (Str * Str) = table { negation : Polarity => (Str * Str) = table {

View File

@@ -1,5 +1,5 @@
concrete ExtraFre of ExtraFreAbs = ExtraRomanceFre ** concrete ExtraFre of ExtraFreAbs = ExtraRomanceFre **
open CommonRomance, PhonoFre, MorphoFre, ParadigmsFre, ParamX, ResFre in { open CommonRomance, PhonoFre, MorphoFre, ParadigmsFre, ParamX, ResFre, Prelude in {
lin lin
EstcequeS qs = {s = "est-ce" ++ elisQue ++ qs.s ! Indic} ; EstcequeS qs = {s = "est-ce" ++ elisQue ++ qs.s ! Indic} ;
@@ -42,8 +42,9 @@ concrete ExtraFre of ExtraFreAbs = ExtraRomanceFre **
Fem Sg P2 ; Fem Sg P2 ;
youPl8fem_Pron, youPl8fem_Pron,
youPol8fem_Pron = youPol8fem_Pron =
let vous = mkPronoun "vous" "vous" "vous" "vous" "votre" "votre" "vos" Masc Pl P2 let vous = mkPronoun "vous" "vous" "vous" "vous" "votre" "votre" "vos" Fem Pl P2
in {s = vous.s ; hasClit = vous.hasClit ; poss = vous.poss ; a = AgPol Fem} ; in
{s = vous.s ; hasClit = vous.hasClit ; poss = vous.poss ; a = vous.a ; isPol = True} ;
oper oper
prepQue : Case -> Str = \c -> case c of { prepQue : Case -> Str = \c -> case c of {

View File

@@ -4,26 +4,26 @@ concrete IdiomFre of Idiom = CatFre **
flags optimize=all_subs ; flags optimize=all_subs ;
lin lin
ImpersCl vp = mkClause "il" True (agrP3 Masc Sg) vp ; ImpersCl vp = mkClause "il" True False (agrP3 Masc Sg) vp ;
GenericCl vp = mkClause "on" True (agrP3 Masc Sg) vp ; GenericCl vp = mkClause "on" True False (agrP3 Masc Sg) vp ;
ExistNP np = ExistNP np =
mkClause "il" True (agrP3 Masc Sg) mkClause "il" True False (agrP3 Masc Sg)
(insertClit3 "y" (insertComplement (\\_ => (np.s ! Acc).ton) (predV avoir_V))) ; (insertClit3 "y" (insertComplement (\\_ => (np.s ! Acc).ton) (predV avoir_V))) ;
ExistIP ip = { ExistIP ip = {
s = \\t,a,p,_ => s = \\t,a,p,_ =>
ip.s ! Nom ++ ip.s ! Nom ++
(mkClause "il" True (agrP3 Masc Sg) (mkClause "il" True False (agrP3 Masc Sg)
(insertClit3 "y" (predV avoir_V))).s (insertClit3 "y" (predV avoir_V))).s
! DDir ! t ! a ! p ! Indic ---- DInv ! DDir ! t ! a ! p ! Indic ---- DInv
} ; } ;
CleftNP np rs = mkClause elisCe True (agrP3 Masc Sg) CleftNP np rs = mkClause elisCe True np.isPol (agrP3 Masc Sg)
(insertComplement (\\_ => rs.s ! Indic ! np.a) (insertComplement (\\_ => rs.s ! Indic ! np.a)
(insertComplement (\\_ => (np.s ! rs.c).ton) (predV copula))) ; (insertComplement (\\_ => (np.s ! rs.c).ton) (predV copula))) ;
CleftAdv ad s = mkClause elisCe True (agrP3 Masc Sg) CleftAdv ad s = mkClause elisCe True False (agrP3 Masc Sg)
(insertComplement (\\_ => conjThat ++ s.s ! Indic) (insertComplement (\\_ => conjThat ++ s.s ! Indic)
(insertComplement (\\_ => ad.s) (predV copula))) ; (insertComplement (\\_ => ad.s) (predV copula))) ;
@@ -33,12 +33,12 @@ concrete IdiomFre of Idiom = CatFre **
(\\a => "en" ++ "train" ++ elisDe ++ infVP vp a) (\\a => "en" ++ "train" ++ elisDe ++ infVP vp a)
(predV copula) ; (predV copula) ;
ImpPl1 vp = {s = ImpPl1 vp = {
(mkImperative False P1 vp).s ! Pos ! Ag Masc Pl P1 --- fem s = mkImperative False P1 vp ! Pos ! Masc ! Pl --- fem
} ; } ;
ImpP3 np vp = { ImpP3 np vp = {
s = (mkClause (np.s ! Nom).comp np.hasClit np.a vp).s s = (mkClause (np.s ! Nom).comp np.hasClit False np.a vp).s
! DInv ! RPres ! Simul ! Pos ! Conjunct ! DInv ! RPres ! Simul ! Pos ! Conjunct
} ; } ;

View File

@@ -178,7 +178,8 @@ oper
_ => ses _ => ses
} ; } ;
a = Ag g n p ; a = Ag g n p ;
hasClit = True hasClit = True ;
isPol = False
} ; } ;
elisPoss : Str -> Str = \s -> elisPoss : Str -> Str = \s ->

View File

@@ -403,7 +403,7 @@ oper
--------------------------- obsolete --------------------------- obsolete
makeNP : Str -> Gender -> Number -> NP ; makeNP : Str -> Gender -> Number -> NP ;
makeNP x g n = {s = (pn2np {s=x;g= g}).s; a = agrP3 g n ; hasClit = False} ** {lock_NP = <>} ; makeNP x g n = {s = (pn2np {s=x;g= g}).s; a = agrP3 g n ; hasClit = False ; isPol = False ; lock_NP = <>} ;
regPN : Str -> PN ; regPN : Str -> PN ;
mk2PN : Str -> Gender -> PN = \x,g -> {s = x ; g = g} ** {lock_PN = <>} ; mk2PN : Str -> Gender -> PN = \x,g -> {s = x ; g = g} ** {lock_PN = <>} ;

View File

@@ -172,7 +172,8 @@ lin
Masc Pl P2 ; Masc Pl P2 ;
youPol_Pron = youPol_Pron =
let vous = mkPronoun "vous" "vous" "vous" "vous" "votre" "votre" "vos" Masc Pl P2 let vous = mkPronoun "vous" "vous" "vous" "vous" "votre" "votre" "vos" Masc Pl P2
in {s = vous.s ; hasClit = vous.hasClit ; poss = vous.poss ; a = AgPol Masc} ; in
{s = vous.s ; hasClit = vous.hasClit ; poss = vous.poss ; a = vous.a ; isPol = True} ;
not_Predet = {s = \\a,c => prepCase c ++ "pas" ; c = Nom ; a = PNoAg} ; not_Predet = {s = \\a,c => prepCase c ++ "pas" ; c = Nom ; a = PNoAg} ;

View File

@@ -108,22 +108,21 @@ instance DiffIta of DiffRomance = open CommonRomance, PhonoIta, BeschIta, Prelud
infForm n p x y = (pronArg n p x y).p3 ; infForm n p x y = (pronArg n p x y).p3 ;
mkImperative b p vp = { mkImperative b p vp =
s = \\pol,agr => \\pol,g,n =>
let let
pe = case b of {True => P3 ; _ => p} ; pe = case b of {True => P3 ; _ => p} ;
---- agr = aag ** {p = pe} ; agr = {g = g ; n = n ; p = pe} ;
aag = verbAgr agr ; ----
clpr = <vp.clit1 ++ vp.clit2,[],False> ; ---- TODO: True is clit clpr = <vp.clit1 ++ vp.clit2,[],False> ; ---- TODO: True is clit
verb = case <aag.n, pol,pe> of { verb = case <n,pol,pe> of {
<Sg,Neg,P2> => vp.s.s ! VInfin clpr.p3 ; ---- ! aag ; <Sg,Neg,P2> => vp.s.s ! VInfin clpr.p3 ; ---- ! aag ;
_ => vp.s.s ! vImperForm agr _ => vp.s.s ! vImper n pe
} ; } ;
neg = vp.neg ! pol ; neg = vp.neg ! pol ;
compl = clpr.p2 ++ vp.comp ! agr ++ vp.ext ! pol compl = clpr.p2 ++ vp.comp ! agr ++ vp.ext ! pol
in in
neg.p1 ++ verb ++ bindIf clpr.p3 ++ clpr.p1 ++ compl ; neg.p1 ++ verb ++ bindIf clpr.p3 ++ clpr.p1 ++ compl ;
} ; ---- TODO non mi mangi ---- TODO non mi mangi
negation : Polarity => (Str * Str) = table { negation : Polarity => (Str * Str) = table {
Pos => <[],[]> ; Pos => <[],[]> ;

View File

@@ -4,22 +4,22 @@ concrete IdiomIta of Idiom = CatIta **
flags optimize=all_subs ; flags optimize=all_subs ;
lin lin
ImpersCl vp = mkClause [] True (agrP3 Masc Sg) vp ; ImpersCl vp = mkClause [] True False (agrP3 Masc Sg) vp ;
GenericCl vp = GenericCl vp =
mkClause [] True (agrP3 Masc Sg) (insertRefl vp) ; mkClause [] True False (agrP3 Masc Sg) (insertRefl vp) ;
CleftNP np rs = mkClause [] True (agrP3 Masc Sg) CleftNP np rs = mkClause [] True False (agrP3 Masc Sg)
(insertComplement (\\_ => rs.s ! Indic ! np.a) (insertComplement (\\_ => rs.s ! Indic ! np.a)
(insertComplement (\\_ => (np.s ! rs.c).ton) (predV copula))) ; (insertComplement (\\_ => (np.s ! rs.c).ton) (predV copula))) ;
CleftAdv ad s = mkClause [] True (agrP3 Masc Sg) CleftAdv ad s = mkClause [] True False (agrP3 Masc Sg)
(insertComplement (\\_ => conjThat ++ s.s ! Indic) (insertComplement (\\_ => conjThat ++ s.s ! Indic)
(insertComplement (\\_ => ad.s) (predV copula))) ; (insertComplement (\\_ => ad.s) (predV copula))) ;
ExistNP np = ExistNP np =
let npa = complAgr np.a in let npa = complAgr np.a in
mkClause [] True (agrP3 npa.g npa.n) mkClause [] True False (agrP3 npa.g npa.n)
(insertClit3 (elision "ci" "c'" "ci") (insertClit3 (elision "ci" "c'" "ci")
(insertComplement (\\_ => (np.s ! Nom).ton) (insertComplement (\\_ => (np.s ! Nom).ton)
(predV copula))) ; (predV copula))) ;
@@ -27,7 +27,7 @@ concrete IdiomIta of Idiom = CatIta **
ExistIP ip = { ExistIP ip = {
s = \\t,a,p,_ => s = \\t,a,p,_ =>
ip.s ! Nom ++ ip.s ! Nom ++
(mkClause [] True (agrP3 ip.a.g ip.a.n) (mkClause [] True False (agrP3 ip.a.g ip.a.n)
(insertClit3 (elision "ci" "c'" "ci") (insertClit3 (elision "ci" "c'" "ci")
(predV copula))).s ! DDir ! t ! a ! p ! Indic (predV copula))).s ! DDir ! t ! a ! p ! Indic
} ; } ;
@@ -44,7 +44,7 @@ concrete IdiomIta of Idiom = CatIta **
(predV (essereV (verboV (stare_16 "stare")))) ; (predV (essereV (verboV (stare_16 "stare")))) ;
ImpPl1 vp = {s = ImpPl1 vp = {s =
(mkImperative False P1 vp).s ! Pos ! Ag Masc Pl P1 --- fem mkImperative False P1 vp ! Pos ! Masc ! Pl --- fem
} ; } ;
} }

View File

@@ -155,7 +155,7 @@ oper
<Pl,Fem> => see <Pl,Fem> => see
} ; } ;
a = Ag g n p ; a = Ag g n p ;
hasClit = True hasClit = True ; isPol = False
} ; } ;
{- --e {- --e

View File

@@ -321,7 +321,7 @@ oper
} }
} ; } ;
makeNP x g n = {s = (pn2np (mk2PN x g)).s; a = agrP3 g n ; hasClit = False} ** {lock_NP = <>} ; makeNP x g n = {s = (pn2np (mk2PN x g)).s; a = agrP3 g n ; hasClit = False ; isPol = False} ** {lock_NP = <>} ;
mk5A a b c d e = mk5A a b c d e =
compADeg {s = \\_ => (mkAdj a b c d e).s ; isPre = False ; lock_A = <>} ; compADeg {s = \\_ => (mkAdj a b c d e).s ; isPre = False ; lock_A = <>} ;

View File

@@ -63,12 +63,6 @@ oper
_ => Masc _ => Masc
} ; } ;
conjAgr : Agr -> Agr -> Agr = \a,b -> case <a,b> of {
<Ag g n p, Ag h m q> => Ag (conjGender g h) (conjNumber n m) (conjPerson p q) ;
<Ag g n p, AgPol h> => Ag (conjGender g h) Pl (conjPerson p P2) ;
<AgPol h, Ag g n p> => Ag (conjGender g h) Pl (conjPerson p P2) ;
<AgPol g, AgPol h> => AgPol (conjGender g h)
} ;
--3 Verbs --3 Verbs
-- --
@@ -123,6 +117,27 @@ param
oper oper
AAgr : Type = {g : Gender ; n : Number} ; AAgr : Type = {g : Gender ; n : Number} ;
Agr : Type = {g : Gender ; n : Number ; p : Person} ;
complAgr : Agr -> {g : Gender ; n : Number} = \a -> {g = a.g ; n = a.n} ;
verbAgr : Agr -> {g : Gender ; n : Number ; p : Person} = \a -> a ;
conjAgr : Agr -> Agr -> Agr = \a,b ->
{g = conjGender a.g b.g ; n = conjNumber a.n b.n ; p = conjPerson a.p b.p} ;
Ag : Gender -> Number -> Person -> Agr = \g,n,p -> {g = g ; n = n ; p = p} ;
-- The imperative forms depend on number and person.
vImper : Number -> Person -> VF = \n,p -> case <n,p> of {
<Sg,P2> => VImper SgP2 ;
<Pl,P1> => VImper PlP1 ;
<Pl,P2> => VImper PlP2 ;
_ => VInfin False
} ;
{-
param param
Agr = Ag Gender Number Person | AgPol Gender ; Agr = Ag Gender Number Person | AgPol Gender ;
@@ -136,6 +151,21 @@ param
AgPol g => {g = g ; n = Pl ; p = P2} AgPol g => {g = g ; n = Pl ; p = P2}
} ; } ;
conjAgr : Agr -> Agr -> Agr = \a,b -> case <a,b> of {
<Ag g n p, Ag h m q> => Ag (conjGender g h) (conjNumber n m) (conjPerson p q) ;
<Ag g n p, AgPol h> => Ag (conjGender g h) Pl (conjPerson p P2) ;
<AgPol h, Ag g n p> => Ag (conjGender g h) Pl (conjPerson p P2) ;
<AgPol g, AgPol h> => AgPol (conjGender g h)
} ;
vImperForm : Agr -> VF = \a -> case a of {
Ag _ Pl P1 => VImper PlP1 ;
Ag _ n P3 => VFin (VPres Conjunct) n P3 ;
Ag _ Sg _ => VImper SgP2 ;
_ => VImper PlP2 -- covers French AgPol
} ;
-}
param param
RAgr = RAg {g : Gender ; n : Number} | RNoAg ; --- AAgr RAgr = RAg {g : Gender ; n : Number} | RNoAg ; --- AAgr
PAgr = PAg Number | PNoAg ; PAgr = PAg Number | PNoAg ;
@@ -159,23 +189,6 @@ oper
presInd = VPres Indic ; presInd = VPres Indic ;
-- The imperative forms depend on number and person.
vImper : Number -> Person -> VF = \n,p -> case <n,p> of {
<Sg,P2> => VImper SgP2 ;
<Pl,P1> => VImper PlP1 ;
<Pl,P2> => VImper PlP2 ;
_ => VInfin False
} ;
vImperForm : Agr -> VF = \a -> case a of {
Ag _ Pl P1 => VImper PlP1 ;
Ag _ n P3 => VFin (VPres Conjunct) n P3 ;
Ag _ Sg _ => VImper SgP2 ;
_ => VImper PlP2 -- covers French AgPol
} ;
--- ---

View File

@@ -49,7 +49,7 @@ interface DiffRomance = open CommonRomance, Prelude in {
-- To render imperatives (with their clitics etc). -- To render imperatives (with their clitics etc).
oper mkImperative : Bool -> Person -> VP -> {s : Polarity => Agr => Str} ; oper mkImperative : Bool -> Person -> VP -> Polarity => Gender => Number => Str ;
--2 Constants that must derivatively depend on language --2 Constants that must derivatively depend on language

View File

@@ -17,7 +17,7 @@ incomplete concrete QuestionRomance of Question =
QuestVP qp vp = { QuestVP qp vp = {
s = \\t,a,b,_ => s = \\t,a,b,_ =>
let let
cl = mkClause (qp.s ! Nom) False (agrP3 qp.a.g qp.a.n) vp cl = mkClause (qp.s ! Nom) False False (agrP3 qp.a.g qp.a.n) vp
in in
cl.s ! DDir ! t ! a ! b ! Indic cl.s ! DDir ! t ! a ! b ! Indic
} ; } ;
@@ -50,7 +50,7 @@ incomplete concrete QuestionRomance of Question =
s = \\t,a,p,_ => s = \\t,a,p,_ =>
let let
vp = predV copula ; vp = predV copula ;
cls = (mkClause (np.s ! Nom).comp np.hasClit np.a vp).s ! cls = (mkClause (np.s ! Nom).comp np.hasClit np.isPol np.a vp).s !
DInv ! t ! a ! p ! Indic ; DInv ! t ! a ! p ! Indic ;
why = icomp.s ! complAgr np.a ; why = icomp.s ! complAgr np.a ;
in why ++ cls in why ++ cls

View File

@@ -15,12 +15,12 @@ incomplete concrete RelativeRomance of Relative =
RelVP rp vp = case rp.hasAgr of { RelVP rp vp = case rp.hasAgr of {
True => {s = \\ag => True => {s = \\ag =>
(mkClause (mkClause
(rp.s ! False ! complAgr ag ! Nom) False (rp.s ! False ! complAgr ag ! Nom) False False
(Ag rp.a.g rp.a.n P3) (Ag rp.a.g rp.a.n P3)
vp).s ! DDir ; c = Nom} ; vp).s ! DDir ; c = Nom} ;
False => {s = \\ag => False => {s = \\ag =>
(mkClause (mkClause
(rp.s ! False ! complAgr ag ! Nom) False (rp.s ! False ! complAgr ag ! Nom) False False
ag ag
vp).s ! DDir ; c = Nom vp).s ! DDir ; c = Nom
} }

View File

@@ -15,7 +15,8 @@ oper
NounPhrase : Type = { NounPhrase : Type = {
s : Case => {c1,c2,comp,ton : Str} ; s : Case => {c1,c2,comp,ton : Str} ;
a : Agr ; a : Agr ;
hasClit : Bool hasClit : Bool ;
isPol : Bool --- only needed for French complement agr
} ; } ;
Pronoun : Type = NounPhrase ** { Pronoun : Type = NounPhrase ** {
poss : Number => Gender => Str ---- also: substantival poss : Number => Gender => Str ---- also: substantival
@@ -24,7 +25,8 @@ oper
heavyNP : {s : Case => Str ; a : Agr} -> NounPhrase = \np -> { heavyNP : {s : Case => Str ; a : Agr} -> NounPhrase = \np -> {
s = \\c => {comp,ton = np.s ! c ; c1,c2 = []} ; s = \\c => {comp,ton = np.s ! c ; c1,c2 = []} ;
a = np.a ; a = np.a ;
hasClit = False hasClit = False ;
isPol = False
} ; } ;
Compl : Type = {s : Str ; c : Case ; isDir : Bool} ; Compl : Type = {s : Str ; c : Case ; isDir : Bool} ;
@@ -188,19 +190,22 @@ oper
ext : Polarity => Str ; -- que je dors / que je dorme ext : Polarity => Str ; -- que je dors / que je dorme
} ; } ;
mkClause : Str -> Bool -> Agr -> VP -> mkClause : Str -> Bool -> Bool -> Agr -> VP ->
{s : Direct => RTense => Anteriority => Polarity => Mood => Str} = {s : Direct => RTense => Anteriority => Polarity => Mood => Str} =
\subj, hasClit, ag, vp -> { \subj, hasClit, isPol, agr, vp -> {
s = \\d,te,a,b,m => s = \\d,te,a,b,m =>
let let
neg = vp.neg ! b ; neg = vp.neg ! b ;
compl = vp.comp ! ag ++ vp.ext ! b ;
agr = verbAgr ag ;
gen = agr.g ; gen = agr.g ;
num = agr.n ; num = agr.n ;
per = agr.p ; per = agr.p ;
compl = case isPol of {
True => vp.comp ! {g = gen ; n = Sg ; p = per} ;
_ => vp.comp ! agr
} ++ vp.ext ! b ;
vtyp = vp.s.vtyp ; vtyp = vp.s.vtyp ;
refl = case vtyp of { refl = case vtyp of {
VRefl => reflPron num per Acc ; ---- case ? VRefl => reflPron num per Acc ; ---- case ?

View File

@@ -4,13 +4,13 @@ incomplete concrete SentenceRomance of Sentence =
flags optimize=all_subs ; flags optimize=all_subs ;
lin lin
PredVP np vp = mkClause (np.s ! Nom).comp np.hasClit np.a vp ; PredVP np vp = mkClause (np.s ! Nom).comp np.hasClit np.isPol np.a vp ;
PredSCVP sc vp = mkClause sc.s False (agrP3 Masc Sg) vp ; PredSCVP sc vp = mkClause sc.s False False (agrP3 Masc Sg) vp ;
ImpVP vp = { ImpVP vp = {
s = \\p,i,g => case i of { s = \\p,i,g => case i of {
ImpF n b => (mkImperative b P2 vp).s ! p ! (Ag g n P2) ---- AgPol ? ImpF n b => mkImperative b P2 vp ! p ! g ! n ---- AgPol ?
} }
} ; } ;
@@ -23,7 +23,7 @@ incomplete concrete SentenceRomance of Sentence =
---- <Acc,True> => insertAgr ag v2 ; ---- <Acc,True> => insertAgr ag v2 ;
---- _ => v2 ---- _ => v2
----e } ----e }
in (mkClause (np.s ! Nom).comp np.hasClit np.a vp).s ; in (mkClause (np.s ! Nom).comp np.hasClit np.isPol np.a vp).s ;
c2 = v2.c2 c2 = v2.c2
} ; } ;
@@ -40,7 +40,7 @@ incomplete concrete SentenceRomance of Sentence =
SlashVS np vs slash = SlashVS np vs slash =
{s = \\ag => {s = \\ag =>
(mkClause (mkClause
(np.s ! Nom).comp np.hasClit np.a (np.s ! Nom).comp np.hasClit np.isPol np.a
(insertExtrapos (\\b => conjThat ++ slash.s ! ag ! (vs.m ! b)) (insertExtrapos (\\b => conjThat ++ slash.s ! ag ! (vs.m ! b))
(predV vs)) (predV vs))
).s ; ).s ;

View File

@@ -90,24 +90,21 @@ instance DiffSpa of DiffRomance = open CommonRomance, PhonoSpa, BeschSpa, Prelud
infForm _ _ _ _ = True ; infForm _ _ _ _ = True ;
mkImperative b p vp = { mkImperative b p vp =
s = \\pol,agr => \\pol,g,n =>
let let
pe = case b of {True => P3 ; _ => p} ; pe = case b of {True => P3 ; _ => p} ;
---- agr = aag ** {p = pe} ; agr = {g = g ; n = n ; p = pe} ;
aag = verbAgr agr ; ----
clpr = <[],[],False> ; ----e pronArg agr.n agr.p vp.clAcc vp.clDat ; clpr = <[],[],False> ; ----e pronArg agr.n agr.p vp.clAcc vp.clDat ;
----e verb = case <aag.n, pol,pe> of { ----e verb = case <aag.n, pol,pe> of {
----e <Sg,Neg,P2> => (vp.s ! VPInfinit Simul clpr.p3).inf ! aag ; ----e <Sg,Neg,P2> => (vp.s ! VPInfinit Simul clpr.p3).inf ! aag ;
----e _ => (vp.s ! VPImperat).fin ! agr ----e _ => (vp.s ! VPImperat).fin ! agr
----e } ; ----e } ;
verb = vp.s.s ! vImperForm agr ; verb = vp.s.s ! vImper n pe ;
neg = vp.neg ! pol ; neg = vp.neg ! pol ;
compl = neg.p2 ++ clpr.p2 ++ vp.comp ! agr ++ vp.ext ! pol compl = neg.p2 ++ clpr.p2 ++ vp.comp ! agr ++ vp.ext ! pol
in in
neg.p1 ++ verb ++ bindIf clpr.p3 ++ clpr.p1 ++ compl ; neg.p1 ++ verb ++ bindIf clpr.p3 ++ clpr.p1 ++ compl ;
} ;
negation : Polarity => (Str * Str) = table { negation : Polarity => (Str * Str) = table {
Pos => <[],[]> ; Pos => <[],[]> ;

View File

@@ -4,27 +4,27 @@ concrete IdiomSpa of Idiom = CatSpa **
flags optimize=all_subs ; flags optimize=all_subs ;
lin lin
ImpersCl vp = mkClause [] True (agrP3 Masc Sg) vp ; ImpersCl vp = mkClause [] True False (agrP3 Masc Sg) vp ;
GenericCl vp = GenericCl vp =
mkClause [] True (agrP3 Masc Sg) (insertRefl vp) ; ---- just Italian ? mkClause [] True False (agrP3 Masc Sg) (insertRefl vp) ; ---- just Italian ?
CleftNP np rs = mkClause [] True (agrP3 Masc Sg) CleftNP np rs = mkClause [] True False (agrP3 Masc Sg)
(insertComplement (\\_ => rs.s ! Indic ! np.a) (insertComplement (\\_ => rs.s ! Indic ! np.a)
(insertComplement (\\_ => (np.s ! rs.c).ton) (predV copula))) ; (insertComplement (\\_ => (np.s ! rs.c).ton) (predV copula))) ;
CleftAdv ad s = mkClause [] True (agrP3 Masc Sg) CleftAdv ad s = mkClause [] True False (agrP3 Masc Sg)
(insertComplement (\\_ => conjThat ++ s.s ! Indic) (insertComplement (\\_ => conjThat ++ s.s ! Indic)
(insertComplement (\\_ => ad.s) (predV copula))) ; (insertComplement (\\_ => ad.s) (predV copula))) ;
ExistNP np = ExistNP np =
mkClause [] True (agrP3 Masc Sg) mkClause [] True False (agrP3 Masc Sg)
(insertComplement (\\_ => (np.s ! Acc).ton) (predV (verboV (hay_3 "haber")))) ; (insertComplement (\\_ => (np.s ! Acc).ton) (predV (verboV (hay_3 "haber")))) ;
ExistIP ip = { ExistIP ip = {
s = \\t,a,p,_ => s = \\t,a,p,_ =>
ip.s ! Nom ++ ip.s ! Nom ++
(mkClause [] True (agrP3 Masc Sg) (predV (verboV (hay_3 "haber")))).s ! DDir ! t ! a ! p ! Indic (mkClause [] True False (agrP3 Masc Sg) (predV (verboV (hay_3 "haber")))).s ! DDir ! t ! a ! p ! Indic
} ; } ;
ProgrVP vp = ProgrVP vp =
@@ -39,7 +39,7 @@ concrete IdiomSpa of Idiom = CatSpa **
(predV (verboV (estar_2 "estar"))) ; (predV (verboV (estar_2 "estar"))) ;
ImpPl1 vp = {s = ImpPl1 vp = {s =
(mkImperative False P1 vp).s ! Pos ! Ag Masc Pl P1 ; --- fem mkImperative False P1 vp ! Pos ! Masc ! Pl ; --- fem
} ; } ;
} }

View File

@@ -111,7 +111,7 @@ oper
} ; } ;
a = Ag g n p ; a = Ag g n p ;
hasClit = True hasClit = True ; isPol = False
} ; } ;

View File

@@ -314,7 +314,7 @@ oper
} }
} ; } ;
makeNP x g n = {s = (pn2np (mk2PN x g)).s; a = agrP3 g n ; hasClit = False} ** {lock_NP = <>} ; makeNP x g n = {s = (pn2np (mk2PN x g)).s; a = agrP3 g n ; hasClit = False ; isPol = False} ** {lock_NP = <>} ;
mk5A a b c d e = mk5A a b c d e =
compADeg {s = \\_ => (mkAdj a b c d e).s ; isPre = False ; lock_A = <>} ; compADeg {s = \\_ => (mkAdj a b c d e).s ; isPre = False ; lock_A = <>} ;