forked from GitHub/gf-core
PGF web api, command c-wordforword: re-enable parsing of individual words
The space leak in the Haskell binding to the C parser has been fixed.
This commit is contained in:
@@ -200,15 +200,12 @@ cpgfMain command (t,(pgf,pc)) =
|
|||||||
|
|
||||||
parse_word w =
|
parse_word w =
|
||||||
maybe (Left ("["++w++"]")) Right $
|
maybe (Left ("["++w++"]")) Right $
|
||||||
msum [{-parse1 w,parse1 ow,-}morph w,morph ow]
|
msum [parse1 w,parse1 ow,morph w,morph ow]
|
||||||
-- omit parsing for now, to avoid space leaks
|
|
||||||
where
|
where
|
||||||
ow = if w==lw then capitInit w else lw
|
ow = if w==lw then capitInit w else lw
|
||||||
lw = uncapitInit w
|
lw = uncapitInit w
|
||||||
{-
|
|
||||||
parse1 = either (const Nothing) (fmap fst . listToMaybe) .
|
parse1 = either (const Nothing) (fmap fst . listToMaybe) .
|
||||||
C.parse concr cat
|
C.parse concr cat
|
||||||
-}
|
|
||||||
morph w = listToMaybe
|
morph w = listToMaybe
|
||||||
[t | (f,a,p)<-C.lookupMorpho concr w,
|
[t | (f,a,p)<-C.lookupMorpho concr w,
|
||||||
t<-maybeToList (C.readExpr f)]
|
t<-maybeToList (C.readExpr f)]
|
||||||
|
|||||||
Reference in New Issue
Block a user