From 705ffaa33dbd937222fbddb734a8b04ffb9ef991 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Fri, 19 Dec 2014 09:05:51 +0000 Subject: [PATCH] haddock comments for parseWithHeuristics --- src/runtime/haskell-bind/PGF2.hsc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/runtime/haskell-bind/PGF2.hsc b/src/runtime/haskell-bind/PGF2.hsc index 7b44b6cb8..aa752d4b0 100644 --- a/src/runtime/haskell-bind/PGF2.hsc +++ b/src/runtime/haskell-bind/PGF2.hsc @@ -258,7 +258,21 @@ getAnalysis ref self c_lemma c_anal prob exn = do parse :: Concr -> String -> String -> Either String [(Expr,Float)] parse lang cat sent = parseWithHeuristics lang cat sent (-1.0) [] -parseWithHeuristics :: Concr -> String -> String -> Double -> [(String, Int -> String -> Int -> Maybe (Expr,Float,Int))] -> Either String [(Expr,Float)] +parseWithHeuristics :: Concr -- ^ the language with which we parse + -> String -- ^ the start category + -> String -- ^ the input sentence + -> Double -- ^ the heuristic factor. + -- A negative value tells the parser + -- to lookup up the default from + -- the grammar flags + -> [(String, Int -> String -> Int -> Maybe (Expr,Float,Int))] + -- ^ a list of callbacks for literal categories. + -- The arguments of the callback are: + -- the index of the constituent for the literal category; + -- the input sentence; the current offset in the sentence. + -- If a literal has been recognized then the output should + -- be Just (expr,probability,end_offset) + -> Either String [(Expr,Float)] parseWithHeuristics lang cat sent heuristic callbacks = unsafePerformIO $ do parsePl <- gu_new_pool