diff options
Diffstat (limited to 'src/runtime/haskell-bind/PGF2.hsc')
| -rw-r--r-- | src/runtime/haskell-bind/PGF2.hsc | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/runtime/haskell-bind/PGF2.hsc b/src/runtime/haskell-bind/PGF2.hsc index aa752d4b0..44f9d2b1c 100644 --- a/src/runtime/haskell-bind/PGF2.hsc +++ b/src/runtime/haskell-bind/PGF2.hsc @@ -318,11 +318,8 @@ mkCallbacksMap concr callbacks pool = do where match_callback match _ clin_idx csentence poffset out_pool = do sentence <- peekCString csentence - coffset <- peek poffset - offset <- alloca $ \pcsentence -> do - poke pcsentence csentence - gu2hs_string_offset pcsentence (plusPtr csentence (fromIntegral coffset)) 0 - case match (fromIntegral clin_idx) sentence offset of + coffset <- peek poffset + case match (fromIntegral clin_idx) sentence (fromIntegral coffset) of Nothing -> return nullPtr Just (e,prob,offset') -> do poke poffset (fromIntegral offset') @@ -345,13 +342,6 @@ mkCallbacksMap concr callbacks pool = do predict_callback _ _ _ _ = return nullPtr - gu2hs_string_offset pcstart cend offset = do - cstart <- peek pcstart - if cstart < cend - then do gu_utf8_decode pcstart - gu2hs_string_offset pcstart cend (offset+1) - else return offset - linearize :: Concr -> Expr -> String linearize lang e = unsafePerformIO $ withGuPool $ \pl -> |
