diff options
| author | kr.angelov <kr.angelov@gmail.com> | 2013-10-30 12:53:36 +0000 |
|---|---|---|
| committer | kr.angelov <kr.angelov@gmail.com> | 2013-10-30 12:53:36 +0000 |
| commit | 042243f08a321cd8ed5918ba94e83f22a8552adb (patch) | |
| tree | e7c1e17cebe2d7d674f8df54ffda14a829e0ff21 /src/runtime/haskell/PGF.hs | |
| parent | 122c40bb3b4cc4ca077f00ab3b484ae9066fd2be (diff) | |
added the linref construction in GF. The PGF version number is now bumped
Diffstat (limited to 'src/runtime/haskell/PGF.hs')
| -rw-r--r-- | src/runtime/haskell/PGF.hs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/runtime/haskell/PGF.hs b/src/runtime/haskell/PGF.hs index 1d0d13f97..fdb834cad 100644 --- a/src/runtime/haskell/PGF.hs +++ b/src/runtime/haskell/PGF.hs @@ -32,7 +32,7 @@ module PGF( showType, readType, mkType, mkHypo, mkDepHypo, mkImplHypo, unType, - categories, startCat, + categories, categoryContext, startCat, -- * Functions functions, functionsByCat, functionType, missingLins, @@ -221,6 +221,8 @@ abstractName :: PGF -> Language -- with the \'cat\' keyword. categories :: PGF -> [CId] +categoryContext :: PGF -> CId -> Maybe [Hypo] + -- | The start category is defined in the grammar with -- the \'startcat\' flag. This is usually the sentence category -- but it is not necessary. Despite that there is a start category @@ -279,6 +281,11 @@ languageCode pgf lang = categories pgf = [c | (c,hs) <- Map.toList (cats (abstract pgf))] +categoryContext pgf cat = + case Map.lookup cat (cats (abstract pgf)) of + Just (hypos,_,_) -> Just hypos + Nothing -> Nothing + startCat pgf = DTyp [] (lookStartCat pgf) [] functions pgf = Map.keys (funs (abstract pgf)) |
