forked from GitHub/gf-core
fixes in the script for the conversion of PennTreebank
This commit is contained in:
@@ -94,6 +94,7 @@ cidGenNP = mkCId "GenNP"
|
|||||||
cidPredetNP = mkCId "PredetNP"
|
cidPredetNP = mkCId "PredetNP"
|
||||||
cidDetNP = mkCId "DetNP"
|
cidDetNP = mkCId "DetNP"
|
||||||
cidAdAP = mkCId "AdAP"
|
cidAdAP = mkCId "AdAP"
|
||||||
|
cidAdvAP = mkCId "AdvAP"
|
||||||
cidPositAdAAdj = mkCId "PositAdAAdj"
|
cidPositAdAAdj = mkCId "PositAdAAdj"
|
||||||
cideither7or_DConj = mkCId "either7or_DConj"
|
cideither7or_DConj = mkCId "either7or_DConj"
|
||||||
cidboth7and_DConj = mkCId "both7and_DConj"
|
cidboth7and_DConj = mkCId "both7and_DConj"
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ import Data.Tree
|
|||||||
test = False
|
test = False
|
||||||
|
|
||||||
main = do
|
main = do
|
||||||
pgf <- readPGF "PennTreebank.pgf"
|
pgf <- readPGF "ParseEngAbs.pgf"
|
||||||
let Just language = readLanguage "PennTreebankCnc"
|
let Just language = readLanguage "ParseEng"
|
||||||
morpho = buildMorpho pgf language
|
morpho = buildMorpho pgf language
|
||||||
s <- readFile "wsj.02-21"
|
s <- readFile "wsj.02-21"
|
||||||
ref <- newIORef (0,0,0)
|
ref <- newIORef (0,0,0)
|
||||||
@@ -84,8 +84,8 @@ penn =
|
|||||||
v <- inside "JJ" (lemma "V2" "s VPPart")
|
v <- inside "JJ" (lemma "V2" "s VPPart")
|
||||||
pps <- many (cat "PP")
|
pps <- many (cat "PP")
|
||||||
let adj = mkApp cidPastPartAP [mkApp v []]
|
let adj = mkApp cidPastPartAP [mkApp v []]
|
||||||
ap0 = foldr (\ada ap -> mkApp cidAdAP [ada,ap]) (mkApp cidPositA [adj]) adas
|
ap0 = foldr (\ada ap -> mkApp cidAdAP [ada,ap]) adj adas
|
||||||
ap = foldr (\pp ap -> mkApp cidAdAP [ap,pp]) ap0 pps
|
ap = foldr (\pp ap -> mkApp cidAdvAP [ap,pp]) ap0 pps
|
||||||
return ap
|
return ap
|
||||||
`mplus`
|
`mplus`
|
||||||
do adas0 <- many pAdA
|
do adas0 <- many pAdA
|
||||||
|
|||||||
Reference in New Issue
Block a user