summaryrefslogtreecommitdiff
path: root/src/runtime/haskell-bind
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@gmail.com>2014-12-19 09:05:51 +0000
committerkr.angelov <kr.angelov@gmail.com>2014-12-19 09:05:51 +0000
commit856683f79f698d50555ef832adf00c15591f344c (patch)
tree175520a2e4c7ca95ea643d251fcc9e838b6fa5af /src/runtime/haskell-bind
parentf44f9a1b00568e205fd68be0f0ea7728e7502a49 (diff)
haddock comments for parseWithHeuristics
Diffstat (limited to 'src/runtime/haskell-bind')
-rw-r--r--src/runtime/haskell-bind/PGF2.hsc16
1 files changed, 15 insertions, 1 deletions
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