mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 03:32:51 -06:00
integration of Parse with Phrasebook, to get idiomatic translations whenever possible
This commit is contained in:
12
examples/translator/Translate.gf
Normal file
12
examples/translator/Translate.gf
Normal file
@@ -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 ;
|
||||||
|
|
||||||
|
}
|
||||||
13
examples/translator/TranslateEng.gf
Normal file
13
examples/translator/TranslateEng.gf
Normal file
@@ -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} ;
|
||||||
|
|
||||||
|
}
|
||||||
16
examples/translator/TranslateFre.gf
Normal file
16
examples/translator/TranslateFre.gf
Normal file
@@ -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} ;
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user