finnish vowel harmony unlexer ; optimizations and mcfg

This commit is contained in:
aarne
2005-06-23 13:32:43 +00:00
parent 6c5ce5fd9b
commit 5df34601af
7 changed files with 59 additions and 26 deletions

View File

@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
-- > CVS $Date: 2005/06/23 13:23:01 $
-- > CVS $Author: peb $
-- > CVS $Revision: 1.26 $
-- > CVS $Date: 2005/06/23 14:32:43 $
-- > CVS $Author: aarne $
-- > CVS $Revision: 1.27 $
--
-- Macros for building and analysing terms in GFC concrete syntax.
--
@@ -290,7 +290,8 @@ composOp co trm =
do
as' <- mapM co as
return (FV as')
-- peb tried to do this, but then there were errors in GF.Canon.Look.ccompute:
-- V x as -> do as' <- mapM co as
-- return (V x as')
V x as ->
do
as' <- mapM co as
return (V x as')
_ -> return trm -- covers Arg, I, LI, K, E

View File

@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
-- > CVS $Date: 2005/06/17 14:15:17 $
-- > CVS $Author: bringert $
-- > CVS $Revision: 1.14 $
-- > CVS $Date: 2005/06/23 14:32:43 $
-- > CVS $Author: aarne $
-- > CVS $Revision: 1.15 $
--
-- lookup in GFC. AR 2003
-----------------------------------------------------------------------------
@@ -125,8 +125,8 @@ ccompute :: CanonGrammar -> [Term] -> Term -> Err Term
ccompute cnc = comp []
where
comp g xs t = case t of
Arg (A _ i) -> errIn ("argument list") $ xs !? fromInteger i
Arg (AB _ _ i) -> errIn ("argument list for binding") $ xs !? fromInteger i
Arg (A _ i) -> err (const (return t)) return $ xs !? fromInteger i
Arg (AB _ _ i) -> err (const (return t)) return $ xs !? fromInteger i
I c -> look c
LI c -> lookVar c g
@@ -194,8 +194,10 @@ ccompute cnc = comp []
noVar v = case v of
LI _ -> False
Arg _ -> False
R rs -> all noVar [t | Ass _ t <- rs]
Par _ ts -> all noVar ts
FV ts -> all noVar ts
S x y -> noVar x && noVar y
P t _ -> noVar t
_ -> True --- other cases that can be values to pattern match?