From 5d772cbfa20abfb84b9925a5670ac5dd28312251 Mon Sep 17 00:00:00 2001 From: aarne Date: Thu, 16 Mar 2006 21:26:22 +0000 Subject: MatchTerm: testing conditions on terms, e.g. nodup --- src/GF/UseGrammar/Custom.hs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/GF/UseGrammar/Custom.hs') diff --git a/src/GF/UseGrammar/Custom.hs b/src/GF/UseGrammar/Custom.hs index 4400c2585..efaa1abeb 100644 --- a/src/GF/UseGrammar/Custom.hs +++ b/src/GF/UseGrammar/Custom.hs @@ -39,6 +39,7 @@ import qualified GF.Grammar.MMacros as MM import GF.Grammar.AbsCompute import GF.Grammar.TypeCheck import GF.UseGrammar.Generate +import GF.UseGrammar.MatchTerm import GF.UseGrammar.Linear (unoptimizeCanon) ------import Compile import GF.Compile.ShellState @@ -373,6 +374,8 @@ customTermCommand = ,(strCI "compute", \g t -> let gr = grammar g in err (const [t]) return (exp2termCommand gr (computeAbsTerm gr) t)) + ,(strCI "nodup", \_ t -> if (hasDupIdent $ tree2exp t) then [] else [t]) + ,(strCI "nodupatom", \_ t -> if (hasDupAtom $ tree2exp t) then [] else [t]) ,(strCI "paraphrase", \g t -> let gr = grammar g in exp2termlistCommand gr (mkParaphrases gr) t) -- cgit v1.2.3