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 a66d2186fe
commit b9fcba00cf
25 changed files with 36 additions and 130 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
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

View File

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

View File

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

View File

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

View File

@@ -1,6 +1,5 @@
incomplete concrete SentencesI of Sentences = Numeral **
open
DiffPhrasebook,
Syntax,
Lexicon,
Symbolic, -- for names as strings
@@ -57,9 +56,6 @@ incomplete concrete SentencesI of Sentences = Numeral **
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 ;
ObjItem i = i ;

View File

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

View File

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

View File

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

View File

@@ -45,4 +45,7 @@ abstract Words = Sentences ** {
PropOpenDay : 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) ;
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
mkNat : Str -> Str -> {lang : NP ; prop : A ; country : NP} = \nat,co ->
{lang = mkNP (mkPN nat) ; prop = mkA nat ; country = mkNP (mkPN co)} ;

View File

@@ -3,7 +3,7 @@
concrete WordsFin of Words = SentencesFin **
open
SyntaxFin, ParadigmsFin, (L = LangFin),
DiffPhrasebookFin, Prelude, (E = ExtraFin) in {
Prelude, (E = ExtraFin) in {
lin
Wine = mkCN (mkN "viini") ;
Beer = mkCN (mkN "olut" "oluita") ;
@@ -61,7 +61,7 @@ concrete WordsFin of Words = SentencesFin **
Saturday = let d = "lauantai" 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 ;
ASpeak p lang = mkCl p.name (mkV2 (mkV "puhua") partitive) lang ;
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) ;
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
mkNat : PN -> PN -> A ->
{lang : NP ; prop : A ; country : NP} = \nat,co,pro ->

View File

@@ -2,7 +2,6 @@
concrete WordsFre of Words = SentencesFre ** open
SyntaxFre,
DiffPhrasebookFre,
IrregFre,
(E = ExtraFre),
ParadigmsFre,
@@ -59,7 +58,7 @@ Good = prefixA (mkA "bon" "bonne" "bons" "bien") ;
Saturday = mkDay "samedi" ;
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 ;
ASpeak p lang = mkCl p.name (mkV2 (mkV "parler")) lang ;
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) ;
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
mkNat : Str -> Str -> {lang : NP ; prop : A ; country : NP} = \nat,co ->
{lang = mkNP (mkPN nat) ; prop = mkA nat ; country = mkNP (mkPN co)} ;

View File

@@ -2,7 +2,6 @@
concrete WordsIta of Words = SentencesIta ** open
SyntaxIta,
DiffPhrasebookIta,
BeschIta,
(E = ExtraIta),
(L = LexiconIta),
@@ -60,7 +59,7 @@ Good = prefixA (mkA "buono" "buona" "buoni" "buone" "bene") ;
Saturday = mkDay "sabato" ;
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 ;
ASpeak p lang = mkCl p.name (mkV2 (mkV "parlare")) lang ;
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) ;
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
mkNat : Str -> Str -> {lang : NP ; prop : A ; country : NP} = \nat,co ->
{lang = mkNP (mkPN nat) ; prop = mkA nat ; country = mkNP (mkPN co)} ;

View File

@@ -3,8 +3,7 @@
concrete WordsRon of Words = SentencesRon ** open
SyntaxRon,
ParadigmsRon,
BeschRon,
DiffPhrasebookRon in
BeschRon in
{
flags coding=utf8 ;
@@ -42,8 +41,8 @@ Good = mkA "bun" "bună" "buni" "bune" "bine" ;
-- Romanian = SyntaxRon.mkNP (mkPN "română") ; ---- ?
-- Swedish = mkNP (mkPN "suédois") ;
AWant p obj = mkCl p.name want_V2 obj ;
ALike p item = mkCl p.name like_V2 item ;
AWant p obj = mkCl p.name (dirV2 (lin V want_VV)) obj ;
ALike p item = mkCl p.name (dirV2 (v_besch71 "plăcea")) item ;
ASpeak p lang = mkCl p.name (dirV2 (mkV "vorbi")) lang ;
ALove p q = mkCl p.name (dirV2 (mkV "iubi")) q.name ;
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") ;
-- AScared p = mkCl p (E.ComplCN have_V2 (mkCN (mkN "paura" feminine))) ;
{-
GImHungry = ss "mi-e foame" ;
GImThirsty = ss "mi-e sete" ;
@@ -61,6 +59,9 @@ Good = mkA "bun" "bună" "buni" "bune" "bine" ;
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
mkPlace : N -> Prep -> {name : CN ; at : Prep ; to : Prep} = \p,i -> {
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) ;
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
mkNat : Str -> Str -> {lang : NP ; prop : A ; country : NP} = \nat,co ->
{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
</P>
<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>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>
<P>
@@ -117,9 +117,6 @@ Separate concrete syntaxes.
Separate concrete syntaxes.
</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
the input language is ambiguous.
</P>
@@ -128,7 +125,7 @@ Here is the module structure as produced by
</P>
<PRE>
&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
</PRE>
<P></P>

View File

@@ -13,10 +13,10 @@ Aarne Ranta
#BSMALL
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
- 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]
@@ -99,15 +99,13 @@ Separate concrete syntaxes.
``Phrasebook``: the top module putting everything together.
Separate concrete syntaxes.
``DiffPhrasebook``: the (so far small) interface for ``Sentences``.
``DisambPhrasebook``: disambiguation grammars generating feedback phrases if
the input language is ambiguous.
Here is the module structure as produced by
```
> 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
```