summaryrefslogtreecommitdiff
path: root/src/GF/Data/Glue.hs
diff options
context:
space:
mode:
authoraarne <unknown>2003-11-18 15:30:08 +0000
committeraarne <unknown>2003-11-18 15:30:08 +0000
commitaf4bf660024928da20b3a1e004d347d6bc0647c4 (patch)
tree53e4bea7a712ec02dd49b7893df0a42ac86d810d /src/GF/Data/Glue.hs
parent8ecf475d5a4c09939ee76106440bf08878be34b4 (diff)
Using trie more.
Diffstat (limited to 'src/GF/Data/Glue.hs')
-rw-r--r--src/GF/Data/Glue.hs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/GF/Data/Glue.hs b/src/GF/Data/Glue.hs
index 247224075..a533a6c2f 100644
--- a/src/GF/Data/Glue.hs
+++ b/src/GF/Data/Glue.hs
@@ -1,19 +1,18 @@
module Glue where
-import Trie
+import Trie2
import Operations
import List
-------- AR 8/11/2003, using Markus Forsberg's implementation of Huet's unglue
-tcompileSimple :: [String] -> Trie
-tcompileSimple ss = tcompile [(s,[(atWP,s)]) | s <- ss]
-
-decomposeSimple :: Trie -> String -> Err [String]
+decomposeSimple :: Trie Char a -> [Char] -> Err [[Char]]
decomposeSimple t s = do
let ss = map (decompose t) $ words s
if any null ss
then Bad "unknown word in input"
else return $ concat [intersperse "&+" ws | ws <- ss]
-exTrie = tcompileSimple $ words "ett två tre tjugo trettio hundra tusen"
+exTrie = tcompile (zip ws ws) where
+ ws = words "ett två tre tjugo trettio hundra tusen"
+