summaryrefslogtreecommitdiff
path: root/src/GF/Data
diff options
context:
space:
mode:
authorpeb <unknown>2005-04-20 11:49:44 +0000
committerpeb <unknown>2005-04-20 11:49:44 +0000
commit78108f7817fbf3269bb75f278eb9a8540737873e (patch)
tree6fc47a586e0d4eb223fc5b1bc3a25b1ef77762c8 /src/GF/Data
parent5621344c73f75f6d5a89ec77c6a4b432f391b16d (diff)
"Committed_by_peb"
Diffstat (limited to 'src/GF/Data')
-rw-r--r--src/GF/Data/GeneralDeduction.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/GF/Data/GeneralDeduction.hs b/src/GF/Data/GeneralDeduction.hs
index 75511ee7a..a5d191260 100644
--- a/src/GF/Data/GeneralDeduction.hs
+++ b/src/GF/Data/GeneralDeduction.hs
@@ -4,9 +4,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/04/11 13:52:51 $
+-- > CVS $Date: 2005/04/20 12:49:44 $
-- > CVS $Author: peb $
--- > CVS $Revision: 1.1 $
+-- > CVS $Revision: 1.2 $
--
-- Simple implementation of deductive chart parsing
-----------------------------------------------------------------------------
@@ -21,7 +21,7 @@ module GF.NewParsing.GeneralChart
emptyChart,
chartMember,
chartInsert, chartInsertM,
- chartList,
+ chartList, chartKeys,
addToChart, addToChartM
) where
@@ -35,6 +35,7 @@ import Monad (foldM)
chartLookup :: (Ord item, Ord key) => ParseChart item key -> key -> [item]
chartList :: (Ord item, Ord key) => ParseChart item key -> [item]
+chartKeys :: (Ord item, Ord key) => ParseChart item key -> [key]
buildChart :: (Ord item, Ord key) =>
(item -> key) -- ^ key lookup function
-> [ParseChart item key -> item -> [item]] -- ^ list of inference rules as functions
@@ -95,6 +96,7 @@ emptyChart = KC rbmEmpty
chartMember (KC tree) item key = rbmElem key item tree
chartLookup (KC tree) key = rbmLookup key tree
chartList (KC tree) = concatMap snd (rbmList tree)
+chartKeys (KC tree) = map fst (rbmList tree)
chartInsert (KC tree) item key = fmap KC (rbmInsert key item tree)
chartInsertM (KC tree) item keys = fmap KC (foldM insertItem tree keys)