mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 03:32:51 -06:00
fix for linearization with 'pre'
This commit is contained in:
@@ -178,9 +178,9 @@ lengthBracketedString (Leaf _) = 1
|
|||||||
lengthBracketedString (Bracket _ _ _ _ _ bss) = sum (map lengthBracketedString bss)
|
lengthBracketedString (Bracket _ _ _ _ _ bss) = sum (map lengthBracketedString bss)
|
||||||
|
|
||||||
untokn :: Maybe String -> BracketedTokn -> (Maybe String,[BracketedString])
|
untokn :: Maybe String -> BracketedTokn -> (Maybe String,[BracketedString])
|
||||||
untokn nw (LeafKS ts) = (has_tok nw (head ts),map Leaf ts)
|
untokn nw (LeafKS ts) = (has_tok nw ts,map Leaf ts)
|
||||||
untokn nw (LeafKP d vs) = let ts = sel d vs nw
|
untokn nw (LeafKP d vs) = let ts = filter (not . null) (sel d vs nw)
|
||||||
in (has_tok nw (head ts),map Leaf ts)
|
in (has_tok nw ts,map Leaf ts)
|
||||||
where
|
where
|
||||||
sel d vs Nothing = d
|
sel d vs Nothing = d
|
||||||
sel d vs (Just w) =
|
sel d vs (Just w) =
|
||||||
@@ -191,9 +191,8 @@ untokn nw (Bracket_ cat fid index fun es bss) =
|
|||||||
let (nw',bss') = mapAccumR untokn nw bss
|
let (nw',bss') = mapAccumR untokn nw bss
|
||||||
in (nw',[Bracket cat fid index fun es (concat bss')])
|
in (nw',[Bracket cat fid index fun es (concat bss')])
|
||||||
|
|
||||||
has_tok nw t
|
has_tok nw [] = nw
|
||||||
| null t = nw
|
has_tok nw (t:ts) = Just t
|
||||||
| otherwise = Just t
|
|
||||||
|
|
||||||
type CncType = (CId, FId) -- concrete type is the abstract type (the category) + the forest id
|
type CncType = (CId, FId) -- concrete type is the abstract type (the category) + the forest id
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user