summaryrefslogtreecommitdiff
path: root/src/GF/API.hs
diff options
context:
space:
mode:
authoraarne <unknown>2005-05-12 09:03:33 +0000
committeraarne <unknown>2005-05-12 09:03:33 +0000
commitae60299c7def8a4c2af18320be773158936c6ac9 (patch)
tree2dc587f26df0c952d9d6d60dc6f7c682afcd6c66 /src/GF/API.hs
parentd50c932a418e7368ac08cacf77d9c9ac1c98cb9b (diff)
pre-release adjustments
Diffstat (limited to 'src/GF/API.hs')
-rw-r--r--src/GF/API.hs20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/GF/API.hs b/src/GF/API.hs
index 3b252f4f3..8d3b31475 100644
--- a/src/GF/API.hs
+++ b/src/GF/API.hs
@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/05/10 12:49:13 $
+-- > CVS $Date: 2005/05/12 10:03:33 $
-- > CVS $Author: aarne $
--- > CVS $Revision: 1.34 $
+-- > CVS $Revision: 1.35 $
--
-- Application Programmer's Interface to GF; also used by Shell. AR 10/11/2001
-----------------------------------------------------------------------------
@@ -50,6 +50,7 @@ import qualified GF.Grammar.Grammar as G
import GF.Infra.Modules
import GF.Grammar.PrGrammar
import qualified GF.Grammar.Compute as Co
+import qualified GF.Grammar.AbsCompute as AC
import qualified GF.Infra.Ident as I
import qualified GF.Compile.GrammarToCanon as GC
import qualified GF.Canon.CanonToGrammar as CG
@@ -335,23 +336,24 @@ optTermCommand opts st =
customOrDefault opts termCommand customTermCommand st
-{-
-- wraps term in a function and optionally computes the result
wrapByFun :: Options -> GFGrammar -> Ident -> Tree -> Tree
wrapByFun opts gr f t =
if oElem doCompute opts
- then err (const t) id $ computeAbsTerm (stateAbstract g) (appCons f' [t])
- else appCons f' [t]
+ then err (const t) id $ AC.computeAbsTerm (grammar gr) t' >>= annotate g
+ else err (const t) id $ annotate g t'
where
- qualifTerm (absId gr) $
-
+ t' = qualifTerm (absId gr) $ M.appCons f [tree2exp t]
+ g = grammar gr
-optTransfer :: Options -> StateGrammar -> Term -> Term
+{-
+optTransfer :: Options -> StateGrammar -> G.Term -> G.Term
optTransfer opts g = case getOptVal opts transferFun of
- Just f -> wrapByFun (addOption doCompute opts) g (string2id f)
+ Just f -> wrapByFun (addOption doCompute opts) g (M.zIdent f)
_ -> id
-}
+
optTokenizer :: Options -> GFGrammar -> String -> String
optTokenizer opts gr = show . customOrDefault opts useTokenizer customTokenizer gr