mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-28 14:02:50 -06:00
Synopsis: add sections for lexical categories. They are still empty, but at least most links work now. The links to param types still don't work.
This commit is contained in:
@@ -119,10 +119,9 @@ inChunks i f = concat . intersperse ["\n\n"] . map f . chunks i where
|
||||
-- Makes one table per result category.
|
||||
-- Adds a subsection header for each table.
|
||||
mkSplitTables :: Bool -> Bool -> Cats -> Rules -> [String]
|
||||
mkSplitTables hasEx isLatex cs rs = concatMap t (sortRules rs)
|
||||
where t xs = [subtitle c expl] ++ mkTable hasEx isLatex cs xs
|
||||
where c = resultCat (head xs)
|
||||
expl = case [e | (n,e,_) <- cs, n == c] of
|
||||
mkSplitTables hasEx isLatex cs = concatMap t . addLexicalCats cs . sortRules
|
||||
where t (c, xs) = [subtitle c expl] ++ mkTable hasEx isLatex cs xs
|
||||
where expl = case [e | (n,e,_) <- cs, n == c] of
|
||||
[] -> ""
|
||||
e:_ -> e
|
||||
|
||||
@@ -191,6 +190,11 @@ sortRules = groupBy sameCat . sortBy compareRules
|
||||
compareRules r1@(n1,_,_) r2@(n2,_,_)
|
||||
= compare (resultCat r1,n1) (resultCat r2,n2)
|
||||
|
||||
addLexicalCats :: Cats -> [Rules] -> [(String,Rules)]
|
||||
addLexicalCats cs rss =
|
||||
sortBy (\x y -> compare (fst x) (fst y)) $
|
||||
[ (resultCat r, rs) | rs@(r:_) <- rss] ++ [(n,[]) | (n,_,_) <- cs]
|
||||
|
||||
resultCat :: (String,String,String) -> String
|
||||
resultCat (_,t,_) = last (words t)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user