diff options
| author | krasimir <krasimir@chalmers.se> | 2010-06-18 12:55:58 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2010-06-18 12:55:58 +0000 |
| commit | 992a7ffb381190ffa67f59f33d0dfadf41f84e78 (patch) | |
| tree | f76a7b6120f4bcc92b41a17651efb51717c8f7bb /src/compiler/GF/Compile/Concrete/AppPredefined.hs | |
| parent | 5dfc9bbc0b87d27b4ef8848a36520605fa868fe3 (diff) | |
Yay!! Direct generation of PMCFG from GF grammar
Diffstat (limited to 'src/compiler/GF/Compile/Concrete/AppPredefined.hs')
| -rw-r--r-- | src/compiler/GF/Compile/Concrete/AppPredefined.hs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/compiler/GF/Compile/Concrete/AppPredefined.hs b/src/compiler/GF/Compile/Concrete/AppPredefined.hs index 73355381e..30f555b60 100644 --- a/src/compiler/GF/Compile/Concrete/AppPredefined.hs +++ b/src/compiler/GF/Compile/Concrete/AppPredefined.hs @@ -73,17 +73,17 @@ appPredefined t = case t of -- one-place functions Q (mod,f) | mod == cPredef -> case x of - (K s) | f == cLength -> retb $ EInt $ toInteger $ length s + (K s) | f == cLength -> retb $ EInt $ length s _ -> retb t -- two-place functions App (Q (mod,f)) z0 | mod == cPredef -> do (z,_) <- appPredefined z0 case (norm z, norm x) of - (EInt i, K s) | f == cDrop -> retb $ K (drop (fi i) s) - (EInt i, K s) | f == cTake -> retb $ K (take (fi i) s) - (EInt i, K s) | f == cTk -> retb $ K (take (max 0 (length s - fi i)) s) - (EInt i, K s) | f == cDp -> retb $ K (drop (max 0 (length s - fi i)) s) + (EInt i, K s) | f == cDrop -> retb $ K (drop i s) + (EInt i, K s) | f == cTake -> retb $ K (take i s) + (EInt i, K s) | f == cTk -> retb $ K (take (max 0 (length s - i)) s) + (EInt i, K s) | f == cDp -> retb $ K (drop (max 0 (length s - i)) s) (K s, K t) | f == cEqStr -> retb $ if s == t then predefTrue else predefFalse (K s, K t) | f == cOccur -> retb $ if substring s t then predefTrue else predefFalse (K s, K t) | f == cOccurs -> retb $ if any (flip elem t) s then predefTrue else predefFalse @@ -119,7 +119,6 @@ appPredefined t = case t of (K x,K y) -> K (x +++ y) _ -> t _ -> t - fi = fromInteger -- read makes variables into constants |
