diff options
| author | kr.angelov <kr.angelov@gmail.com> | 2013-10-30 14:42:29 +0000 |
|---|---|---|
| committer | kr.angelov <kr.angelov@gmail.com> | 2013-10-30 14:42:29 +0000 |
| commit | a4194501fe2c60a19160c811c1a7818da5ce715e (patch) | |
| tree | 325d3212391469fa522fe304c1c411d1ea92168b /src/runtime/haskell/PGF/Forest.hs | |
| parent | 5bc9e959d0bbc6f6e2e646d1cf1b72b335d32c87 (diff) | |
linref is now used by the linearizer. The visible change is that the 'l' command in the shell now can linearize discontinuous phrases
Diffstat (limited to 'src/runtime/haskell/PGF/Forest.hs')
| -rw-r--r-- | src/runtime/haskell/PGF/Forest.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/runtime/haskell/PGF/Forest.hs b/src/runtime/haskell/PGF/Forest.hs index e6e3c1136..89ebfb299 100644 --- a/src/runtime/haskell/PGF/Forest.hs +++ b/src/runtime/haskell/PGF/Forest.hs @@ -47,7 +47,7 @@ data Forest --------------------------------------------------------------------
linearizeWithBrackets :: Maybe Int -> Forest -> BracketedString
-linearizeWithBrackets dp = head . snd . untokn Nothing . bracketedTokn dp
+linearizeWithBrackets dp = head . snd . untokn Nothing . (:[]) .bracketedTokn dp
---------------------------------------------------------------
-- Internally we have to do everything with Tokn first because
@@ -67,8 +67,8 @@ bracketedTokn dp f@(Forest abs cnc forest root) = render forest arg@(PArg hypos fid) =
case IntMap.lookup fid forest >>= Set.maxView of
- Just (p,set) -> let (ct,fun,es,(_,lin)) = descend (if Set.null set then forest else IntMap.insert fid set forest) p
- in (ct,fun,es,(map getVar hypos,lin))
+ Just (p,set) -> let (ct,fid',fun,es,(_,lin)) = descend (if Set.null set then forest else IntMap.insert fid set forest) p
+ in (ct,fid',fun,es,(map getVar hypos,lin))
Nothing -> error ("wrong forest id " ++ show fid)
where
descend forest (PApply funid args) = let (CncFun fun lins) = cncfuns cnc ! funid
@@ -78,9 +78,9 @@ bracketedTokn dp f@(Forest abs cnc forest root) = Just (DTyp _ cat _,_,_,_,_) -> cat
largs = map (render forest) args
ltable = mkLinTable cnc isTrusted [] funid largs
- in ((cat,fid),wildCId,either (const []) id $ getAbsTrees f arg Nothing dp,ltable)
+ in ((cat,fid),0,wildCId,either (const []) id $ getAbsTrees f arg Nothing dp,ltable)
descend forest (PCoerce fid) = render forest (PArg [] fid)
- descend forest (PConst cat e ts) = ((cat,fid),wildCId,[e],([],listArray (0,0) [map LeafKS ts]))
+ descend forest (PConst cat e ts) = ((cat,fid),0,wildCId,[e],([],listArray (0,0) [map LeafKS ts]))
getVar (fid,_)
| fid == fidVar = wildCId
|
