commented out the import of Phrasebook in App with --P; the idea is that application grammar parsing is done in a separate phase, which is faster and more flexible. Also re-enabled ComplV3 and ComplV2V, after testing that they don't reduce the parsing speed too much.

This commit is contained in:
aarne
2016-05-14 08:30:49 +00:00
parent bde9dc7cfd
commit 7c8d2f71dc
19 changed files with 36 additions and 38 deletions

View File

@@ -22,7 +22,7 @@ abstract App =
-- Extensions
PassVPSlash, PassAgentVPSlash -- not reachable anyway
]
,Phrasebook
--P ,Phrasebook
** {
flags
@@ -30,19 +30,17 @@ flags
heuristic_search_factor=0.80; -- doesn't seem to affect speed or quality much
fun
PhrasePhr : Phrase -> Phr ;
Phrase_Chunk : Phrase -> Chunk ;
--P PhrasePhr : Phrase -> Phr ;
--P Phrase_Chunk : Phrase -> Chunk ;
ComplV2 : V2 -> NP -> VP ;
PassV2 : V2 -> VP ;
{-
ComplV2V : V2V -> NP -> VP -> VP ;
ComplV2A : V2A -> NP -> AP -> VP ;
ComplV2Q : V2Q -> NP -> QS -> VP ;
ComplV2S : V2S -> NP -> S -> VP ;
-- ComplV2A : V2A -> NP -> AP -> VP ;
-- ComplV2Q : V2Q -> NP -> QS -> VP ;
-- ComplV2S : V2S -> NP -> S -> VP ;
ComplV3 : V3 -> NP -> NP -> VP ;
-}
}

View File

@@ -24,7 +24,7 @@ concrete AppBul of App =
PassVPSlash, PassAgentVPSlash -- not reachable anyway
]
,PhrasebookBul - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv, closed_A, open_A]
--P ,PhrasebookBul - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv, closed_A, open_A]
** open ParadigmsBul, SyntaxBul, Prelude in {

View File

@@ -25,7 +25,7 @@ concrete AppCat of App =
PassVPSlash, PassAgentVPSlash -- not reachable anyway
]
,PhrasebookCat - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, cheap_A,expensive_A, open_A, closed_A]
--P ,PhrasebookCat - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, cheap_A,expensive_A, open_A, closed_A]
** open ParadigmsCat, SyntaxCat, Prelude in {

View File

@@ -24,7 +24,7 @@ concrete AppChi of App =
PassVPSlash, PassAgentVPSlash -- not reachable anyway
]
,PhrasebookChi - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv, closed_A, open_A, at_Prep, by_Prep]
--P ,PhrasebookChi - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv, closed_A, open_A, at_Prep, by_Prep]
** open ParadigmsChi, SyntaxChi, Prelude in {

View File

@@ -24,7 +24,7 @@ concrete AppDut of App =
PassVPSlash, PassAgentVPSlash -- not reachable anyway
]
,PhrasebookDut - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv, closed_A, open_A]
--P ,PhrasebookDut - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv, closed_A, open_A]
** open ParadigmsDut, SyntaxDut, Prelude in {

View File

@@ -24,7 +24,7 @@ concrete AppEng of App =
PassVPSlash, PassAgentVPSlash -- not reachable anyway
]
,PhrasebookEng - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv]
--P ,PhrasebookEng - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv]
** open MorphoEng, ResEng, ParadigmsEng, SyntaxEng, (G = GrammarEng), (E = ExtraEng), Prelude in {
@@ -33,21 +33,21 @@ flags
-- to suppress punctuation
lin
PSentence, PQuestion = \s -> lin Text (mkUtt s) ;
PGreetingMale, PGreetingFemale = \s -> lin Text s ;
GObjectPlease o = lin Text (mkUtt o) ;
PhrasePhr p = {s = "+" ++ p.s} | p ;
Phrase_Chunk p = p ;
--P PSentence, PQuestion = \s -> lin Text (mkUtt s) ;
--P PGreetingMale, PGreetingFemale = \s -> lin Text s ;
--P GObjectPlease o = lin Text (mkUtt o) ;
--P PhrasePhr p = {s = "+" ++ p.s} | p ;
--P Phrase_Chunk p = p ;
ComplV2V v np vp = mkVP v np vp ;
ComplV2A v np vp = mkVP v np vp ;
ComplV2Q v np vp = mkVP v np vp ;
ComplV2S v np vp = mkVP v np vp ;
-- ComplV2A v np vp = mkVP v np vp ;
-- ComplV2Q v np vp = mkVP v np vp ;
-- ComplV2S v np vp = mkVP v np vp ;
ComplV3 v np vp = mkVP v np vp ;
ComplV2 v np = mkVP v np ;
PassV2 v2 = passiveVP v2 ;
PassV2 v2 = passiveVP v2 ;
PassV2 v2 = passiveVP v2 ;
}

View File

@@ -24,7 +24,7 @@ concrete AppEst of App =
PassVPSlash, PassAgentVPSlash -- not reachable anyway
]
,PhrasebookEst - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_A, open_Adv]
--P ,PhrasebookEst - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_A, open_Adv]
** open ParadigmsEst, SyntaxEst, Prelude in {

View File

@@ -24,7 +24,7 @@ concrete AppFin of App =
PassVPSlash, PassAgentVPSlash -- not reachable anyway
]
,PhrasebookFin - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_A, open_Adv]
--P ,PhrasebookFin - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_A, open_Adv]
** open ParadigmsFin, SyntaxFin, Prelude in {

View File

@@ -22,7 +22,7 @@ concrete AppFre of App =
-- Extensions
PassVPSlash, PassAgentVPSlash -- not reachable anyway
]
,PhrasebookFre - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_A, closed_A]
--P ,PhrasebookFre - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_A, closed_A]
** open ParadigmsFre, SyntaxFre, Prelude in {

View File

@@ -24,7 +24,7 @@ concrete AppGer of App =
PassVPSlash, PassAgentVPSlash -- not reachable anyway
]
,PhrasebookGer - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv, closed_A, open_A]
--P ,PhrasebookGer - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv, closed_A, open_A]
** open ParadigmsGer, SyntaxGer, Prelude in {

View File

@@ -23,7 +23,7 @@ concrete AppHin of App =
-- Extensions
PassVPSlash, PassAgentVPSlash -- not reachable anyway
]
,PhrasebookHin - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv, closed_A, open_A]
--P ,PhrasebookHin - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv, closed_A, open_A]
** open ParadigmsHin, SyntaxHin, Prelude in {

View File

@@ -24,7 +24,7 @@ concrete AppIta of App =
PassVPSlash, PassAgentVPSlash -- not reachable anyway
]
,PhrasebookIta - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_A, closed_A]
--P ,PhrasebookIta - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_A, closed_A]
** open ParadigmsIta, SyntaxIta, Prelude in {

View File

@@ -24,7 +24,7 @@ concrete AppJpn of App =
PassVPSlash, PassAgentVPSlash -- not reachable anyway
]
,PhrasebookJpn ---- - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv, closed_A, open_A, at_Prep, by_Prep]
--P ,PhrasebookJpn ---- - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv, closed_A, open_A, at_Prep, by_Prep]
** open ParadigmsJpn, SyntaxJpn, Prelude in {

View File

@@ -24,7 +24,7 @@ concrete AppRus of App =
PassVPSlash, PassAgentVPSlash -- not reachable anyway
]
,PhrasebookRus - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv, closed_A, open_A, cost_V]
--P ,PhrasebookRus - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv, closed_A, open_A, cost_V]
** open ParadigmsRus, SyntaxRus, Prelude in {

View File

@@ -25,7 +25,7 @@ concrete AppSpa of App =
PassVPSlash, PassAgentVPSlash -- not reachable anyway
]
,PhrasebookSpa - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, cheap_A,expensive_A, open_A, closed_A]
--P ,PhrasebookSpa - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, cheap_A,expensive_A, open_A, closed_A]
** open ParadigmsSpa, SyntaxSpa, Prelude in {

View File

@@ -23,7 +23,7 @@ concrete AppSwe of App =
PassVPSlash, PassAgentVPSlash -- not reachable anyway
]
,PhrasebookSwe - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv, closed_A, open_A]
--P ,PhrasebookSwe - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv, closed_A, open_A]
** open MorphoSwe, ResSwe, ParadigmsSwe, SyntaxSwe, CommonScand, (E = ExtraSwe), Prelude in {

View File

@@ -24,7 +24,7 @@ concrete AppTha of App =
PassVPSlash, PassAgentVPSlash -- not reachable anyway
]
,PhrasebookTha - [at_Prep, closed_A, open_A] --- - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv, closed_A, open_A, at_Prep, by_Prep]
--P ,PhrasebookTha - [at_Prep, closed_A, open_A] --- - [PSentence, PQuestion, PGreetingMale, PGreetingFemale, GObjectPlease, open_Adv, closed_A, open_A, at_Prep, by_Prep]
** open ParadigmsTha, SyntaxTha, Prelude in {

View File

@@ -1,4 +1,4 @@
all: Phrasebook App15.pgf
all: App15.pgf
PROBSFILE=./app.probs
GFODIR=./gfos

View File

@@ -3,7 +3,7 @@
-- the new files are produced in ./tmp/ which has to be created first
-- usage: runghc MkApp.hs
langs = words "Bul Cat Chi Dut Eng Fin Fre Ger Hin Ita Jpn Spa Swe Tha"
langs = words "Bul Cat Chi Dut Eng Est Fin Fre Ger Hin Ita Jpn Spa Swe Tha"
appCnc lang = "App" ++ lang ++ ".gf"
appAbs = "App.gf"
@@ -23,5 +23,5 @@ putImports i s =
extra s = unlines (init (lines s) ++ extraLines ++ ["}"])
extraLines = [
" PassV2 v2 = passiveVP v2 ;"
-- " PassV2 v2 = passiveVP v2 ;"
] -- default: no extra