rewrote App so that it just inherits Translate and excludes some functions. This minimizes the duplication of code between Translate and App. Also added some functions, which make App 15% slower but increase the coverage and quality. This trade-off has to be studied further.

This commit is contained in:
aarne
2014-04-09 13:04:19 +00:00
parent 622ab0b44c
commit a3921bffd7
11 changed files with 300 additions and 522 deletions

View File

@@ -1,42 +1,37 @@
abstract App = abstract App =
Translate - [
-- Verb
ComplVS, ComplVQ, ComplVA,
Slash2V3, Slash3V3, SlashV2V, SlashV2S, SlashV2Q, SlashV2A,
SlashVV, SlashV2VNP,
ReflVP,
AdvVPSlash, AdVVPSlash, VPSlashPrep,
-- Sentence
PredSCVP,
AdvSlash, SlashPrep, SlashVS,
EmbedS, EmbedQS, EmbedVP, RelS,
-- Question
ComplSlashIP,AdvQVP,AddAdvQVP,QuestQVP,
-- Idiom
CleftNP, CleftAdv,
ExistIP,
ExistNPAdv, ExistIPAdv,
ImpP3,
SelfAdvVP, SelfAdVVP, SelfNP,
-- modules in Grammar, excluding Structural -- Construction
Tense, hungry_VP, thirsty_VP, has_age_VP, have_name_Cl, married_Cl, what_name_QCl, how_old_QCl, how_far_QCl,
Noun - [PPartNP], -- to be generalized weather_adjCl, is_right_VP, is_wrong_VP, n_units_AP, bottle_of_CN, cup_of_CN, glass_of_CN,
Adjective, where_go_QCl, where_come_from_QCl, go_here_VP, come_here_VP, come_from_here_VP, go_there_VP, come_there_VP, come_from_there_VP,
Numeral, -- Extensions
Conjunction, PassVPSlash, PassAgentVPSlash
Verb [ ]
UseV,ComplVV,SlashV2a,ComplSlash,UseComp,CompAP,CompNP,CompAdv,CompCN
,AdvVP,AdVVP
],
Adverb,
Phrase,
Sentence,
Question - [
ComplSlashIP,AdvQVP,AddAdvQVP,QuestQVP
],
Relative,
Idiom [NP, VP, Cl, Tense, ProgrVP, ExistNP],
Symbol [PN, Symb, String, CN, Card, NP, MkSymb, SymbPN, CNNumNP], ---- why only these?
Chunk,
---- Construction,
Extensions [
CompoundCN,AdAdV,UttAdV,ApposNP,
MkVPI, MkVPS, PredVPS, that_RP, who_RP
],
Dictionary,
Documentation
,Phrasebook ,Phrasebook
** { ** {
flags flags
startcat=Phr ; startcat=Phr ;
---- heuristic_search_factor=0.90; -- doesn't seem to affect speed or quality much heuristic_search_factor=0.80; -- doesn't seem to affect speed or quality much
fun fun
PhrasePhr : Phrase -> Phr ; PhrasePhr : Phrase -> Phr ;

View File

@@ -1,47 +1,37 @@
--# -path=.:src/chunk:src/translator:../examples/phrasebook/gfos --# -path=.:src/chunk:src/translator:../examples/phrasebook/gfos
concrete AppBul of App = concrete AppBul of App =
TenseX - [IAdv, CAdv],
NounBul - [PPartNP],
AdjectiveBul,
NumeralBul,
SymbolBul [
PN, Symb, String, CN, Card, NP, MkSymb, SymbPN, CNNumNP
],
ConjunctionBul,
VerbBul [
UseV,ComplVV,SlashV2a,ComplSlash,UseComp,CompAP,CompNP,CompAdv,CompCN
,AdvVP,AdVVP
],
AdverbBul,
PhraseBul,
SentenceBul [
PredVP,SlashVP,ImpVP,AdvS,
UseCl,UseQCl,UseSlash,SSubjS,UseRCl
],
QuestionBul - [
ComplSlashIP,AdvQVP,AddAdvQVP,QuestQVP
],
RelativeBul,
IdiomBul [
NP, VP, Tense, Cl, ProgrVP, ExistNP,
neutr, sjalv
],
---- ConstructionBul,
ChunkBul, TranslateBul - [
-- Verb
ExtensionsBul [ ComplVS, ComplVQ, ComplVA,
CompoundCN,AdAdV,UttAdV,ApposNP, Slash2V3, Slash3V3, SlashV2V, SlashV2S, SlashV2Q, SlashV2A,
MkVPI, MkVPS, PredVPS, that_RP, who_RP SlashVV, SlashV2VNP,
], ReflVP,
AdvVPSlash, AdVVPSlash, VPSlashPrep,
DocumentationBul, -- Sentence
DictionaryBul PredSCVP,
AdvSlash, SlashPrep, SlashVS,
EmbedS, EmbedQS, EmbedVP, RelS,
-- Question
ComplSlashIP,AdvQVP,AddAdvQVP,QuestQVP,
-- Idiom
CleftNP, CleftAdv,
ExistIP,
ExistNPAdv, ExistIPAdv,
ImpP3,
SelfAdvVP, SelfAdVVP, SelfNP,
-- Construction
hungry_VP, thirsty_VP, has_age_VP, have_name_Cl, married_Cl, what_name_QCl, how_old_QCl, how_far_QCl,
weather_adjCl, is_right_VP, is_wrong_VP, n_units_AP, bottle_of_CN, cup_of_CN, glass_of_CN,
where_go_QCl, where_come_from_QCl, go_here_VP, come_here_VP, come_from_here_VP, go_there_VP, come_there_VP, come_from_there_VP,
-- Extensions
PassVPSlash, PassAgentVPSlash
]
,PhrasebookBul - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv, closed_A, open_A] ,PhrasebookBul - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv, closed_A, open_A]
** open MorphoBul, ResBul, ParadigmsBul, SyntaxBul, CommonScand, (E = ExtraBul), Prelude in { ** open ParadigmsBul, SyntaxBul, Prelude in {
flags flags
literal=Symb ; literal=Symb ;
@@ -50,13 +40,9 @@ flags
lin lin
PSentence, PQuestion = \s -> lin Text (mkUtt s) ; PSentence, PQuestion = \s -> lin Text (mkUtt s) ;
PGreetingMale, PGreetingFemale = \s -> lin Text s ; PGreetingMale, PGreetingFemale = \s -> lin Text s ;
GObjectPlease o = lin Text (mkUtt o) ; GObjectPlease o = lin Text (mkUtt o) ;
lin
PhrasePhr p = {s = "+" ++ p.s} | p ; PhrasePhr p = {s = "+" ++ p.s} | p ;
Phrase_Chunk p = p ; Phrase_Chunk p = p ;
} }

View File

@@ -1,78 +1,49 @@
--# -path=.:src/chunk:src/translator:../examples/phrasebook/gfos --# -path=.:src/chunk:src/translator:../examples/phrasebook/gfos
concrete AppChi of App = concrete AppChi of App =
TenseChi,
NounChi - [PPartNP], TranslateChi - [
AdjectiveChi, -- Verb
NumeralChi, ComplVS, ComplVQ, ComplVA,
SymbolChi [ Slash2V3, Slash3V3, SlashV2V, SlashV2S, SlashV2Q, SlashV2A,
PN, Symb, String, CN, Card, NP, MkSymb, SymbPN, CNNumNP SlashVV, SlashV2VNP,
], ReflVP,
ConjunctionChi, AdvVPSlash, AdVVPSlash, VPSlashPrep,
VerbChi [ -- Sentence
UseV,ComplVV,SlashV2a,ComplSlash,UseComp,CompNP,CompAdv,CompCN PredSCVP,
-- ,AdvVP -- overridden AdvSlash, SlashPrep, SlashVS,
,AdVVP EmbedS, EmbedQS, EmbedVP, RelS,
], -- Question
AdverbChi,
PhraseChi,
SentenceChi [
PredVP,SlashVP,ImpVP,AdvS,
UseCl,UseQCl,UseSlash,SSubjS,UseRCl
],
QuestionChi - [
ComplSlashIP,AdvQVP,AddAdvQVP,QuestQVP, ComplSlashIP,AdvQVP,AddAdvQVP,QuestQVP,
QuestCl -- overridden -- Idiom
], CleftNP, CleftAdv,
RelativeChi, ExistIP,
IdiomChi [ ExistNPAdv, ExistIPAdv,
NP, VP, Tense, Cl, ProgrVP, ExistNP, ImpP3,
neutr, sjalv SelfAdvVP, SelfAdVVP, SelfNP,
], -- Construction
---- ConstructionChi, hungry_VP, thirsty_VP, has_age_VP, have_name_Cl, married_Cl, what_name_QCl, how_old_QCl, how_far_QCl,
weather_adjCl, is_right_VP, is_wrong_VP, n_units_AP, bottle_of_CN, cup_of_CN, glass_of_CN,
ChunkChi, where_go_QCl, where_come_from_QCl, go_here_VP, come_here_VP, come_from_here_VP, go_there_VP, come_there_VP, come_from_there_VP,
-- Extensions
ExtensionsChi [ PassVPSlash, PassAgentVPSlash
CompoundCN,AdAdV,UttAdV,ApposNP, ]
MkVPI, MkVPS, PredVPS, that_RP, who_RP
],
DocumentationChi,
DictionaryChi
,PhrasebookChi - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv, closed_A, open_A, at_Prep] ,PhrasebookChi - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv, closed_A, open_A, at_Prep]
** open ResChi, ParadigmsChi, SyntaxChi, CommonScand, (E = ExtraChi), (G = GrammarChi), Prelude in { ** open ParadigmsChi, SyntaxChi, Prelude in {
flags flags
literal=Symb ; literal=Symb ;
-- Chinese-specific overrides
lin
CompAP = G.CompAP | E.CompBareAP ; -- he is good | he good
AdvVP vp adv = G.AdvVP vp adv | E.TopicAdvVP vp adv ; -- he *today* here sleeps | *today* he here sleeps
QuestCl cl = G.QuestCl cl | E.QuestRepV cl ; -- he comes 'ma' | he come not come
-- to suppress punctuation -- to suppress punctuation
lin lin
PSentence, PQuestion = \s -> lin Text (mkUtt s) ; PSentence, PQuestion = \s -> lin Text (mkUtt s) ;
PGreetingMale, PGreetingFemale = \s -> lin Text s ; PGreetingMale, PGreetingFemale = \s -> lin Text s ;
GObjectPlease o = lin Text (mkUtt o) ; GObjectPlease o = lin Text (mkUtt o) ;
lin
PhrasePhr p = {s = "+" ++ p.s} | p ; PhrasePhr p = {s = "+" ++ p.s} | p ;
Phrase_Chunk p = p ; Phrase_Chunk p = p ;
} }

View File

@@ -1,43 +1,33 @@
--# -path=.:src/chunk:src/translator:../examples/phrasebook/gfos --# -path=.:src/chunk:src/translator:../examples/phrasebook/gfos
concrete AppEng of App = concrete AppEng of App =
TenseX - [Pol, PNeg, PPos],
CatEng,
NounEng - [PPartNP],
AdjectiveEng,
NumeralEng,
SymbolEng [
PN, Symb, String, CN, Card, NP, MkSymb, SymbPN, CNNumNP,
addGenitiveS
],
ConjunctionEng,
VerbEng [
UseV,ComplVV,SlashV2a,ComplSlash,UseComp,CompAP,CompNP,CompAdv,CompCN
,AdvVP,AdVVP
],
AdverbEng,
PhraseEng,
SentenceEng [
PredVP,SlashVP,ImpVP,AdvS,
UseQCl,UseSlash,SSubjS,UseRCl
],
QuestionEng - [
ComplSlashIP,AdvQVP,AddAdvQVP,QuestQVP
],
RelativeEng,
IdiomEng [NP, VP, Tense, Cl, ProgrVP, ExistNP],
---- ConstructionEng, TranslateEng - [
-- Verb
ComplVS, ComplVQ, ComplVA,
ChunkEng, Slash2V3, Slash3V3, SlashV2V, SlashV2S, SlashV2Q, SlashV2A,
SlashVV, SlashV2VNP,
ExtensionsEng [ ReflVP,
CompoundCN,AdAdV,UttAdV,ApposNP, AdvVPSlash, AdVVPSlash, VPSlashPrep,
MkVPI, MkVPS, PredVPS, that_RP, who_RP -- Sentence
], PredSCVP,
DocumentationEng, AdvSlash, SlashPrep, SlashVS,
DictionaryEng EmbedS, EmbedQS, EmbedVP, RelS,
-- Question
ComplSlashIP,AdvQVP,AddAdvQVP,QuestQVP,
-- Idiom
CleftNP, CleftAdv,
ExistIP,
ExistNPAdv, ExistIPAdv,
ImpP3,
SelfAdvVP, SelfAdVVP, SelfNP,
-- Construction
hungry_VP, thirsty_VP, has_age_VP, have_name_Cl, married_Cl, what_name_QCl, how_old_QCl, how_far_QCl,
weather_adjCl, is_right_VP, is_wrong_VP, n_units_AP, bottle_of_CN, cup_of_CN, glass_of_CN,
where_go_QCl, where_come_from_QCl, go_here_VP, come_here_VP, come_from_here_VP, go_there_VP, come_there_VP, come_from_there_VP,
-- Extensions
PassVPSlash, PassAgentVPSlash
]
,PhrasebookEng - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv] ,PhrasebookEng - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv]
@@ -46,28 +36,12 @@ concrete AppEng of App =
flags flags
literal=Symb ; literal=Symb ;
-- exceptional linearizations
lin
UseCl t p cl =
G.UseCl t p cl -- I am here
| E.ContractedUseCl t p cl -- I'm here
;
PPos = {s = [] ; p = CPos} ;
PNeg = {s = [] ; p = CNeg True} | {s = [] ; p = CNeg False} ;
-- to suppress punctuation -- to suppress punctuation
lin lin
PSentence, PQuestion = \s -> lin Text (mkUtt s) ; PSentence, PQuestion = \s -> lin Text (mkUtt s) ;
PGreetingMale, PGreetingFemale = \s -> lin Text s ; PGreetingMale, PGreetingFemale = \s -> lin Text s ;
GObjectPlease o = lin Text (mkUtt o) ; GObjectPlease o = lin Text (mkUtt o) ;
lin
PhrasePhr p = {s = "+" ++ p.s} | p ; PhrasePhr p = {s = "+" ++ p.s} | p ;
Phrase_Chunk p = p ; Phrase_Chunk p = p ;
} }

View File

@@ -1,70 +1,47 @@
--# -path=.:src/chunk:src/finnish/stemmed:src/finnish:src/api:src/translator:../examples/phrasebook/gfos --# -path=.:src/chunk:src/finnish/stemmed:src/finnish:src/api:src/translator:../examples/phrasebook/gfos
concrete AppFin of App = concrete AppFin of App =
TenseX,
NounFin - [
PPartNP,
UsePron, PossPron -- Fin specific: replaced by variants with prodrop
],
AdjectiveFin,
NumeralFin,
SymbolFin [
PN, Symb, String, CN, Card, NP, MkSymb, SymbPN, CNNumNP
],
ConjunctionFin,
VerbFin [
UseV,ComplVV,SlashV2a,ComplSlash,UseComp,CompAP,CompNP,CompAdv,CompCN
,AdvVP,AdVVP
],
AdverbFin,
PhraseFin,
SentenceFin [
PredVP,SlashVP,ImpVP,AdvS,
UseCl,UseQCl,UseSlash,SSubjS,UseRCl
],
QuestionFin - [
ComplSlashIP,AdvQVP,AddAdvQVP,QuestQVP
],
RelativeFin,
IdiomFin [
NP, VP, Tense, Cl, ProgrVP, ExistNP,
neutr, sjalv
],
---- ConstructionFin,
ChunkFin, TranslateFin - [
-- Verb
ExtensionsFin [ ComplVS, ComplVQ, ComplVA,
CompoundCN,AdAdV,UttAdV,ApposNP, Slash2V3, Slash3V3, SlashV2V, SlashV2S, SlashV2Q, SlashV2A,
MkVPI, MkVPS, PredVPS, that_RP, who_RP SlashVV, SlashV2VNP,
], ReflVP,
AdvVPSlash, AdVVPSlash, VPSlashPrep,
DocumentationFin, -- Sentence
DictionaryFin PredSCVP,
AdvSlash, SlashPrep, SlashVS,
EmbedS, EmbedQS, EmbedVP, RelS,
-- Question
ComplSlashIP,AdvQVP,AddAdvQVP,QuestQVP,
-- Idiom
CleftNP, CleftAdv,
ExistIP,
ExistNPAdv, ExistIPAdv,
ImpP3,
SelfAdvVP, SelfAdVVP, SelfNP,
-- Construction
hungry_VP, thirsty_VP, has_age_VP, have_name_Cl, married_Cl, what_name_QCl, how_old_QCl, how_far_QCl,
weather_adjCl, is_right_VP, is_wrong_VP, n_units_AP, bottle_of_CN, cup_of_CN, glass_of_CN,
where_go_QCl, where_come_from_QCl, go_here_VP, come_here_VP, come_from_here_VP, go_there_VP, come_there_VP, come_from_there_VP,
-- Extensions
PassVPSlash, PassAgentVPSlash
]
,PhrasebookFin - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_A] ,PhrasebookFin - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_A]
** open MorphoFin, ResFin, ParadigmsFin, SyntaxFin, (E = ExtraFin), (G = GrammarFin), Prelude in { ** open ParadigmsFin, SyntaxFin, Prelude in {
flags flags
literal=Symb ; literal=Symb ;
-- pro-drop exceptions: here as second rather than first alternative
lin
UsePron p = G.UsePron p | G.UsePron (E.ProDrop p) ;
PossPron p = G.PossPron p | E.ProDropPoss p ;
-- to suppress punctuation
lin lin
PSentence, PQuestion = \s -> lin Text (mkUtt s) ; PSentence, PQuestion = \s -> lin Text (mkUtt s) ;
PGreetingMale, PGreetingFemale = \s -> lin Text s ; PGreetingMale, PGreetingFemale = \s -> lin Text s ;
GObjectPlease o = lin Text (mkUtt o) ; GObjectPlease o = lin Text (mkUtt o) ;
lin
PhrasePhr p = {s = "+" ++ p.s} | p ; PhrasePhr p = {s = "+" ++ p.s} | p ;
Phrase_Chunk p = p ; Phrase_Chunk p = p ;
} }

View File

@@ -1,96 +1,48 @@
--# -path=.:src/chunk:src/translator:../examples/phrasebook/gfos --# -path=.:src/chunk:src/translator:../examples/phrasebook/gfos
concrete AppFre of App = concrete AppFre of App =
TenseFre,
NounFre - [PPartNP], TranslateFre - [
AdjectiveFre, -- Verb
NumeralFre, ComplVS, ComplVQ, ComplVA,
SymbolFre [ Slash2V3, Slash3V3, SlashV2V, SlashV2S, SlashV2Q, SlashV2A,
PN, Symb, String, CN, Card, NP, MkSymb, SymbPN, CNNumNP SlashVV, SlashV2VNP,
], ReflVP,
ConjunctionFre, AdvVPSlash, AdVVPSlash, VPSlashPrep,
VerbFre [ -- Sentence
UseV,ComplVV,SlashV2a,ComplSlash,UseComp,CompAP,CompNP,CompAdv,CompCN PredSCVP,
,AdvVP,AdVVP AdvSlash, SlashPrep, SlashVS,
], EmbedS, EmbedQS, EmbedVP, RelS,
AdverbFre, -- Question
PhraseFre,
SentenceFre [
PredVP,SlashVP,ImpVP,AdvS,
UseCl,UseQCl,UseSlash,SSubjS,UseRCl
],
QuestionFre - [
ComplSlashIP,AdvQVP,AddAdvQVP,QuestQVP, ComplSlashIP,AdvQVP,AddAdvQVP,QuestQVP,
QuestCl, QuestIAdv -- Idiom
], CleftNP, CleftAdv,
RelativeFre, ExistIP,
IdiomFre [ ExistNPAdv, ExistIPAdv,
NP, VP, Tense, Cl, ProgrVP, ExistNP, ImpP3,
neutr, sjalv SelfAdvVP, SelfAdVVP, SelfNP,
], -- Construction
---- ConstructionFre, hungry_VP, thirsty_VP, has_age_VP, have_name_Cl, married_Cl, what_name_QCl, how_old_QCl, how_far_QCl,
weather_adjCl, is_right_VP, is_wrong_VP, n_units_AP, bottle_of_CN, cup_of_CN, glass_of_CN,
where_go_QCl, where_come_from_QCl, go_here_VP, come_here_VP, come_from_here_VP, go_there_VP, come_there_VP, come_from_there_VP,
-- Extensions
PassVPSlash, PassAgentVPSlash
]
ChunkFre,
ExtensionsFre [ ,PhrasebookFre - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_A, closed_A]
CompoundCN,AdAdV,UttAdV,ApposNP,
MkVPI, MkVPS, PredVPS, that_RP, who_RP
],
DocumentationFre, ** open ParadigmsFre, SyntaxFre, Prelude in {
DictionaryFre
,PhrasebookFre - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_A]
** open MorphoFre, PhonoFre, ResFre, ParadigmsFre, SyntaxFre, CommonScand, (E = ExtraFre), (G = GrammarFre), Prelude in {
flags flags
literal=Symb ; literal=Symb ;
---------------------------
lin
QuestCl cl =
{s = \\t,a,p => -- est-ce qu'il dort ?
let cls = cl.s ! DDir ! t ! a ! p
in table {
QDir => "est-ce" ++ elisQue ++ cls ! Indic ;
QIndir => subjIf ++ cls ! Indic
}
}
| {s = \\t,a,p => -- dort-il ?
let cls = cl.s ! DInv ! t ! a ! p
in table {
QDir => cls ! Indic ;
QIndir => subjIf ++ cls ! Indic
}
}
| G.QuestCl cl -- il dort ?
;
QuestIAdv iadv cl =
G.QuestIAdv iadv cl -- où dort-il
| {s = \\t,a,p,q => -- où est-ce qu'il dort
let
ord = DDir ;
cls = cl.s ! ord ! t ! a ! p ! Indic ;
why = iadv.s
in why ++ "est-ce" ++ elisQue ++ cls
} ;
---------------------------
-- to suppress punctuation
lin lin
PSentence, PQuestion = \s -> lin Text (mkUtt s) ; PSentence, PQuestion = \s -> lin Text (mkUtt s) ;
PGreetingMale, PGreetingFemale = \s -> lin Text s ; PGreetingMale, PGreetingFemale = \s -> lin Text s ;
GObjectPlease o = lin Text (mkUtt o) ; GObjectPlease o = lin Text (mkUtt o) ;
lin
PhrasePhr p = {s = "+" ++ p.s} | p ; PhrasePhr p = {s = "+" ++ p.s} | p ;
Phrase_Chunk p = p ; Phrase_Chunk p = p ;
} }

View File

@@ -1,47 +1,37 @@
--# -path=.:src/chunk:src/translator:../examples/phrasebook/gfos --# -path=.:src/chunk:src/translator:../examples/phrasebook/gfos
concrete AppGer of App = concrete AppGer of App =
TenseGer,
NounGer - [PPartNP],
AdjectiveGer,
NumeralGer,
SymbolGer [
PN, Symb, String, CN, Card, NP, MkSymb, SymbPN, CNNumNP
],
ConjunctionGer,
VerbGer [
UseV,ComplVV,SlashV2a,ComplSlash,UseComp,CompAP,CompNP,CompAdv,CompCN
,AdvVP,AdVVP
],
AdverbGer,
PhraseGer,
SentenceGer [
PredVP,SlashVP,ImpVP,AdvS,
UseCl,UseQCl,UseSlash,SSubjS,UseRCl
],
QuestionGer - [
ComplSlashIP,AdvQVP,AddAdvQVP,QuestQVP
],
RelativeGer,
IdiomGer [
NP, VP, Tense, Cl, ProgrVP, ExistNP,
neutr, sjalv
],
---- ConstructionGer,
ChunkGer, TranslateGer - [
-- Verb
ComplVS, ComplVQ, ComplVA,
Slash2V3, Slash3V3, SlashV2V, SlashV2S, SlashV2Q, SlashV2A,
SlashVV, SlashV2VNP,
ReflVP,
AdvVPSlash, AdVVPSlash, VPSlashPrep,
-- Sentence
PredSCVP,
AdvSlash, SlashPrep, SlashVS,
EmbedS, EmbedQS, EmbedVP, RelS,
-- Question
ComplSlashIP,AdvQVP,AddAdvQVP,QuestQVP,
-- Idiom
CleftNP, CleftAdv,
ExistIP,
ExistNPAdv, ExistIPAdv,
ImpP3,
SelfAdvVP, SelfAdVVP, SelfNP,
-- Construction
hungry_VP, thirsty_VP, has_age_VP, have_name_Cl, married_Cl, what_name_QCl, how_old_QCl, how_far_QCl,
weather_adjCl, is_right_VP, is_wrong_VP, n_units_AP, bottle_of_CN, cup_of_CN, glass_of_CN,
where_go_QCl, where_come_from_QCl, go_here_VP, come_here_VP, come_from_here_VP, go_there_VP, come_there_VP, come_from_there_VP,
-- Extensions
PassVPSlash, PassAgentVPSlash
]
ExtensionsGer [ ,PhrasebookGer - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv, closed_A, open_A]
CompoundCN,AdAdV,UttAdV,ApposNP,
MkVPI, MkVPS, PredVPS, that_RP, who_RP
],
DocumentationGer, ** open ParadigmsGer, SyntaxGer, Prelude in {
DictionaryGer
,PhrasebookGer - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv, closed_A, open_A]
** open MorphoGer, ResGer, ParadigmsGer, SyntaxGer, CommonScand, (E = ExtraGer), Prelude in {
flags flags
literal=Symb ; literal=Symb ;
@@ -50,13 +40,8 @@ flags
lin lin
PSentence, PQuestion = \s -> lin Text (mkUtt s) ; PSentence, PQuestion = \s -> lin Text (mkUtt s) ;
PGreetingMale, PGreetingFemale = \s -> lin Text s ; PGreetingMale, PGreetingFemale = \s -> lin Text s ;
GObjectPlease o = lin Text (mkUtt o) ; GObjectPlease o = lin Text (mkUtt o) ;
lin
PhrasePhr p = {s = "+" ++ p.s} | p ; PhrasePhr p = {s = "+" ++ p.s} | p ;
Phrase_Chunk p = p ; Phrase_Chunk p = p ;
} }

View File

@@ -1,47 +1,36 @@
--# -path=.:src/chunk:src/translator:../examples/phrasebook/gfos --# -path=.:src/chunk:src/translator:../examples/phrasebook/gfos
concrete AppHin of App = concrete AppHin of App =
TenseX - [AdN,Adv,SC],
NounHin - [PPartNP],
AdjectiveHin,
NumeralHin,
SymbolHin [
PN, Symb, String, CN, Card, NP, MkSymb, SymbPN, CNNumNP
],
ConjunctionHin,
VerbHin [
UseV,ComplVV,SlashV2a,ComplSlash,UseComp,CompAP,CompNP,CompAdv,CompCN
,AdvVP,AdVVP
],
AdverbHin,
PhraseHin,
SentenceHin [
PredVP,SlashVP,ImpVP,AdvS,
UseCl,UseQCl,UseSlash,SSubjS,UseRCl
],
QuestionHin - [
ComplSlashIP,AdvQVP,AddAdvQVP,QuestQVP
],
RelativeHin,
IdiomHin [
NP, VP, Tense, Cl, ProgrVP, ExistNP,
neutr, sjalv
],
---- ConstructionHin,
ChunkHin,
ExtensionsHin [
CompoundCN,AdAdV,UttAdV,ApposNP,
MkVPI, MkVPS, PredVPS, that_RP, who_RP
],
DocumentationHin,
DictionaryHin
TranslateHin - [
-- Verb
ComplVS, ComplVQ, ComplVA,
Slash2V3, Slash3V3, SlashV2V, SlashV2S, SlashV2Q, SlashV2A,
SlashVV, SlashV2VNP,
ReflVP,
AdvVPSlash, AdVVPSlash, VPSlashPrep,
-- Sentence
PredSCVP,
AdvSlash, SlashPrep, SlashVS,
EmbedS, EmbedQS, EmbedVP, RelS,
-- Question
ComplSlashIP,AdvQVP,AddAdvQVP,QuestQVP,
-- Idiom
CleftNP, CleftAdv,
ExistIP,
ExistNPAdv, ExistIPAdv,
ImpP3,
SelfAdvVP, SelfAdVVP, SelfNP,
-- Construction
hungry_VP, thirsty_VP, has_age_VP, have_name_Cl, married_Cl, what_name_QCl, how_old_QCl, how_far_QCl,
weather_adjCl, is_right_VP, is_wrong_VP, n_units_AP, bottle_of_CN, cup_of_CN, glass_of_CN,
where_go_QCl, where_come_from_QCl, go_here_VP, come_here_VP, come_from_here_VP, go_there_VP, come_there_VP, come_from_there_VP,
-- Extensions
PassVPSlash, PassAgentVPSlash
]
,PhrasebookHin - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv, closed_A, open_A] ,PhrasebookHin - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv, closed_A, open_A]
** open MorphoHin, ResHin, ParadigmsHin, SyntaxHin, CommonScand, (E = ExtraHin), Prelude in { ** open ParadigmsHin, SyntaxHin, Prelude in {
flags flags
literal=Symb ; literal=Symb ;
@@ -50,13 +39,9 @@ flags
lin lin
PSentence, PQuestion = \s -> lin Text (mkUtt s) ; PSentence, PQuestion = \s -> lin Text (mkUtt s) ;
PGreetingMale, PGreetingFemale = \s -> lin Text s ; PGreetingMale, PGreetingFemale = \s -> lin Text s ;
GObjectPlease o = lin Text (mkUtt o) ; GObjectPlease o = lin Text (mkUtt o) ;
lin
PhrasePhr p = {s = "+" ++ p.s} | p ; PhrasePhr p = {s = "+" ++ p.s} | p ;
Phrase_Chunk p = p ; Phrase_Chunk p = p ;
} }

View File

@@ -1,62 +1,46 @@
--# -path=.:src/chunk:src/translator:../examples/phrasebook/gfos --# -path=.:src/chunk:src/translator:../examples/phrasebook/gfos
concrete AppIta of App = concrete AppIta of App =
TenseIta,
NounIta - [PPartNP],
AdjectiveIta,
NumeralIta,
SymbolIta [
PN, Symb, String, CN, Card, NP, MkSymb, SymbPN, CNNumNP
],
ConjunctionIta,
VerbIta [
UseV,ComplVV,SlashV2a,ComplSlash,UseComp,CompAP,CompNP,CompAdv,CompCN
,AdvVP,AdVVP
],
AdverbIta,
PhraseIta,
SentenceIta [
PredVP,SlashVP,ImpVP,AdvS,
UseCl,UseQCl,UseSlash,SSubjS,UseRCl
],
QuestionIta - [
ComplSlashIP,AdvQVP,AddAdvQVP,QuestQVP
],
RelativeIta,
IdiomIta [
NP, VP, Tense, Cl, ProgrVP, ExistNP,
neutr, sjalv
],
---- ConstructionIta,
ChunkIta, TranslateIta - [
-- Verb
ComplVS, ComplVQ, ComplVA,
Slash2V3, Slash3V3, SlashV2V, SlashV2S, SlashV2Q, SlashV2A,
SlashVV, SlashV2VNP,
ReflVP,
AdvVPSlash, AdVVPSlash, VPSlashPrep,
-- Sentence
PredSCVP,
AdvSlash, SlashPrep, SlashVS,
EmbedS, EmbedQS, EmbedVP, RelS,
-- Question
ComplSlashIP,AdvQVP,AddAdvQVP,QuestQVP,
-- Idiom
CleftNP, CleftAdv,
ExistIP,
ExistNPAdv, ExistIPAdv,
ImpP3,
SelfAdvVP, SelfAdVVP, SelfNP,
-- Construction
hungry_VP, thirsty_VP, has_age_VP, have_name_Cl, married_Cl, what_name_QCl, how_old_QCl, how_far_QCl,
weather_adjCl, is_right_VP, is_wrong_VP, n_units_AP, bottle_of_CN, cup_of_CN, glass_of_CN,
where_go_QCl, where_come_from_QCl, go_here_VP, come_here_VP, come_from_here_VP, go_there_VP, come_there_VP, come_from_there_VP,
-- Extensions
PassVPSlash, PassAgentVPSlash
]
ExtensionsIta [ ,PhrasebookIta - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_A, closed_A]
CompoundCN,AdAdV,UttAdV,ApposNP,
MkVPI, MkVPS, PredVPS, that_RP, who_RP
],
DocumentationIta, ** open ParadigmsIta, SyntaxIta, Prelude in {
DictionaryIta
,PhrasebookIta - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_A]
** open MorphoIta, ResIta, ParadigmsIta, SyntaxIta, CommonScand, (E = ExtraIta), Prelude in {
flags flags
literal=Symb ; literal=Symb ;
-- to suppress punctuation
lin lin
PSentence, PQuestion = \s -> lin Text (mkUtt s) ; PSentence, PQuestion = \s -> lin Text (mkUtt s) ;
PGreetingMale, PGreetingFemale = \s -> lin Text s ; PGreetingMale, PGreetingFemale = \s -> lin Text s ;
GObjectPlease o = lin Text (mkUtt o) ; GObjectPlease o = lin Text (mkUtt o) ;
lin
PhrasePhr p = {s = "+" ++ p.s} | p ; PhrasePhr p = {s = "+" ++ p.s} | p ;
Phrase_Chunk p = p ; Phrase_Chunk p = p ;
} }

View File

@@ -1,47 +1,37 @@
--# -path=.:src/chunk:src/translator:../examples/phrasebook/gfos --# -path=.:src/chunk:src/translator:../examples/phrasebook/gfos
concrete AppSpa of App = concrete AppSpa of App =
TenseSpa,
NounSpa - [PPartNP],
AdjectiveSpa,
NumeralSpa,
SymbolSpa [
PN, Symb, String, CN, Card, NP, MkSymb, SymbPN, CNNumNP
],
ConjunctionSpa,
VerbSpa [
UseV,ComplVV,SlashV2a,ComplSlash,UseComp,CompAP,CompNP,CompAdv,CompCN
,AdvVP,AdVVP
],
AdverbSpa,
PhraseSpa,
SentenceSpa [
PredVP,SlashVP,ImpVP,AdvS,
UseCl,UseQCl,UseSlash,SSubjS,UseRCl
],
QuestionSpa - [
ComplSlashIP,AdvQVP,AddAdvQVP,QuestQVP
],
RelativeSpa,
IdiomSpa [
NP, VP, Tense, Cl, ProgrVP, ExistNP,
neutr, sjalv
],
---- ConstructionSpa,
ChunkSpa, TranslateSpa - [
-- Verb
ComplVS, ComplVQ, ComplVA,
Slash2V3, Slash3V3, SlashV2V, SlashV2S, SlashV2Q, SlashV2A,
SlashVV, SlashV2VNP,
ReflVP,
AdvVPSlash, AdVVPSlash, VPSlashPrep,
-- Sentence
PredSCVP,
AdvSlash, SlashPrep, SlashVS,
EmbedS, EmbedQS, EmbedVP, RelS,
-- Question
ComplSlashIP,AdvQVP,AddAdvQVP,QuestQVP,
-- Idiom
CleftNP, CleftAdv,
ExistIP,
ExistNPAdv, ExistIPAdv,
ImpP3,
SelfAdvVP, SelfAdVVP, SelfNP,
-- Construction
hungry_VP, thirsty_VP, has_age_VP, have_name_Cl, married_Cl, what_name_QCl, how_old_QCl, how_far_QCl,
weather_adjCl, is_right_VP, is_wrong_VP, n_units_AP, bottle_of_CN, cup_of_CN, glass_of_CN,
where_go_QCl, where_come_from_QCl, go_here_VP, come_here_VP, come_from_here_VP, go_there_VP, come_there_VP, come_from_there_VP,
-- Extensions
PassVPSlash, PassAgentVPSlash
]
ExtensionsSpa [ ,PhrasebookSpa - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, cheap_A,expensive_A, open_A, closed_A]
CompoundCN,AdAdV,UttAdV,ApposNP,
MkVPI, MkVPS, PredVPS, that_RP, who_RP
],
DocumentationSpa, ** open ParadigmsSpa, SyntaxSpa, Prelude in {
DictionarySpa
,PhrasebookSpa - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, cheap_A,expensive_A, open_A]
** open MorphoSpa, ResSpa, ParadigmsSpa, SyntaxSpa, CommonScand, (E = ExtraSpa), Prelude in {
flags flags
literal=Symb ; literal=Symb ;
@@ -50,13 +40,8 @@ flags
lin lin
PSentence, PQuestion = \s -> lin Text (mkUtt s) ; PSentence, PQuestion = \s -> lin Text (mkUtt s) ;
PGreetingMale, PGreetingFemale = \s -> lin Text s ; PGreetingMale, PGreetingFemale = \s -> lin Text s ;
GObjectPlease o = lin Text (mkUtt o) ; GObjectPlease o = lin Text (mkUtt o) ;
lin
PhrasePhr p = {s = "+" ++ p.s} | p ; PhrasePhr p = {s = "+" ++ p.s} | p ;
Phrase_Chunk p = p ; Phrase_Chunk p = p ;
} }

View File

@@ -1,43 +1,32 @@
--# -path=.:src/chunk:src/translator:../examples/phrasebook/gfos --# -path=.:src/chunk:src/translator:../examples/phrasebook/gfos
concrete AppSwe of App = concrete AppSwe of App =
TenseSwe, TranslateSwe - [
NounSwe - [PPartNP], -- Verb
AdjectiveSwe, ComplVS, ComplVQ, ComplVA,
NumeralSwe, Slash2V3, Slash3V3, SlashV2V, SlashV2S, SlashV2Q, SlashV2A,
SymbolSwe [ SlashVV, SlashV2VNP,
PN, Symb, String, CN, Card, NP, MkSymb, SymbPN, CNNumNP ReflVP,
], AdvVPSlash, AdVVPSlash, VPSlashPrep,
ConjunctionSwe, -- Sentence
VerbSwe [ PredSCVP,
UseV,ComplVV,SlashV2a,ComplSlash,UseComp,CompAP,CompNP,CompAdv,CompCN AdvSlash, SlashPrep, SlashVS,
,AdvVP,AdVVP EmbedS, EmbedQS, EmbedVP, RelS,
], -- Question
AdverbSwe, ComplSlashIP,AdvQVP,AddAdvQVP,QuestQVP,
PhraseSwe, -- Idiom
SentenceSwe [ CleftNP, CleftAdv,
PredVP,SlashVP,ImpVP,AdvS, ExistIP,
UseCl,UseQCl,UseSlash,SSubjS,UseRCl ExistNPAdv, ExistIPAdv,
], ImpP3,
QuestionSwe - [ SelfAdvVP, SelfAdVVP, SelfNP,
ComplSlashIP,AdvQVP,AddAdvQVP,QuestQVP -- Construction
], hungry_VP, thirsty_VP, has_age_VP, have_name_Cl, married_Cl, what_name_QCl, how_old_QCl, how_far_QCl,
RelativeSwe, weather_adjCl, is_right_VP, is_wrong_VP, n_units_AP, bottle_of_CN, cup_of_CN, glass_of_CN,
IdiomSwe [ where_go_QCl, where_come_from_QCl, go_here_VP, come_here_VP, come_from_here_VP, go_there_VP, come_there_VP, come_from_there_VP,
NP, VP, Tense, Cl, ProgrVP, ExistNP, -- Extensions
neutr, sjalv PassVPSlash, PassAgentVPSlash
], ]
---- ConstructionSwe,
ChunkSwe,
ExtensionsSwe [
CompoundCN,AdAdV,UttAdV,ApposNP,
MkVPI, MkVPS, PredVPS, that_RP, who_RP
],
DocumentationSwe,
DictionarySwe
,PhrasebookSwe - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv, closed_A, open_A] ,PhrasebookSwe - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv, closed_A, open_A]
@@ -50,13 +39,8 @@ flags
lin lin
PSentence, PQuestion = \s -> lin Text (mkUtt s) ; PSentence, PQuestion = \s -> lin Text (mkUtt s) ;
PGreetingMale, PGreetingFemale = \s -> lin Text s ; PGreetingMale, PGreetingFemale = \s -> lin Text s ;
GObjectPlease o = lin Text (mkUtt o) ; GObjectPlease o = lin Text (mkUtt o) ;
lin
PhrasePhr p = {s = "+" ++ p.s} | p ; PhrasePhr p = {s = "+" ++ p.s} | p ;
Phrase_Chunk p = p ; Phrase_Chunk p = p ;
} }