summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authoraarne <aarne@chalmers.se>2013-10-11 08:19:04 +0000
committeraarne <aarne@chalmers.se>2013-10-11 08:19:04 +0000
commit824cf3222634baff7a75ce97a4f3d78d6951c0dc (patch)
treef049f1c88489c875ff3cf2a8cf19a6251e660e41 /examples
parentf358d37c4ea995583a422a93d1ccfe7380cb2fe1 (diff)
integration of Parse with Phrasebook, to get idiomatic translations whenever possible
Diffstat (limited to 'examples')
-rw-r--r--examples/translator/Translate.gf12
-rw-r--r--examples/translator/TranslateEng.gf13
-rw-r--r--examples/translator/TranslateFre.gf16
3 files changed, 41 insertions, 0 deletions
diff --git a/examples/translator/Translate.gf b/examples/translator/Translate.gf
new file mode 100644
index 000000000..3c64f3184
--- /dev/null
+++ b/examples/translator/Translate.gf
@@ -0,0 +1,12 @@
+abstract Translate = ParseEngAbs, Phrasebook ** {
+
+flags startcat = Phrase ;
+
+fun
+ PPhr : Phr -> Phrase ;
+ NP_Person : NP -> Person ;
+ NP_Object : NP -> Object ;
+ NP_Item : NP -> Item ;
+ NP_Place : NP -> Place ;
+
+} \ No newline at end of file
diff --git a/examples/translator/TranslateEng.gf b/examples/translator/TranslateEng.gf
new file mode 100644
index 000000000..bfe16b263
--- /dev/null
+++ b/examples/translator/TranslateEng.gf
@@ -0,0 +1,13 @@
+--# -path=.:alltenses:../phrasebook:../../lib/src/english
+
+concrete TranslateEng of Translate = ParseEng, PhrasebookEng ** open SyntaxEng, (E = ExtraEng), Prelude in {
+
+lin
+ PPhr p = lin Text p ;
+ NP_Person np = {name = lin NP np ; isPron = False ; poss = E.GenNP np} ;
+ NP_Object np = lin NP np ;
+ NP_Item np = lin NP np ;
+ NP_Place np0 = let np = lin NP np0 in
+ {name = np ; at = SyntaxEng.mkAdv in_Prep np ; to = SyntaxEng.mkAdv to_Prep np} ;
+
+} \ No newline at end of file
diff --git a/examples/translator/TranslateFre.gf b/examples/translator/TranslateFre.gf
new file mode 100644
index 000000000..ee5acf946
--- /dev/null
+++ b/examples/translator/TranslateFre.gf
@@ -0,0 +1,16 @@
+--# -path=.:alltenses:../phrasebook:../../lib/src/english:../../lib/src/french:../../lib/src/romance
+
+concrete TranslateFre of Translate =
+ ParseFre - [open_A],
+ PhrasebookFre **
+ open SyntaxFre, ParadigmsFre, (E = ExtraFre), Prelude in {
+
+lin
+ PPhr p = lin Text p ;
+ NP_Person np = {name = lin NP np ; isPron = False ; poss = mkQuant he_Pron} ;
+ NP_Object np = lin NP np ;
+ NP_Item np = lin NP np ;
+ NP_Place np0 = let np = lin NP np0 in
+ {name = np ; at = SyntaxFre.mkAdv dative np ; to = SyntaxFre.mkAdv dative np} ;
+
+} \ No newline at end of file