mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-21 18:59:32 -06:00
PGF2 & PGFService: work in progress on callbacks for nerc & chunks
This commit is contained in:
@@ -151,9 +151,14 @@ cpgfMain command (t,(pgf,pc)) =
|
||||
tp (tree,prob) = makeObj ["tree".=tree,"prob".=prob]
|
||||
|
||||
-- Without caching parse results:
|
||||
parse' start mlimit ((_,concr),input) =
|
||||
return $
|
||||
maybe id take mlimit . drop start # C.parse concr cat input
|
||||
parse' start mlimit ((from,concr),input) =
|
||||
return $
|
||||
maybe id take mlimit . drop start # cparse
|
||||
where
|
||||
cparse = C.parse concr cat input
|
||||
--cparse = C.parseWithHeuristics concr cat input (-1) callbacks
|
||||
callbacks = maybe [] cb $ lookup (C.abstractName pgf) C.literalCallbacks
|
||||
cb fs = [(cat,f pgf (from,concr))|(cat,f)<-fs]
|
||||
{-
|
||||
-- Caching parse results:
|
||||
parse' start mlimit ((from,concr),input) =
|
||||
|
||||
Reference in New Issue
Block a user