MatchTerm: testing conditions on terms, e.g. nodup

This commit is contained in:
aarne
2006-03-16 21:26:22 +00:00
parent 06ea7fea46
commit 38376083b2
4 changed files with 69 additions and 12 deletions

View File

@@ -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)