Show years

parent 9c607bee
...@@ -63,10 +63,13 @@ mapMP f xs = do ...@@ -63,10 +63,13 @@ mapMP f xs = do
filterTermsAndCooc filterTermsAndCooc
:: TermType Lang :: TermType Lang
-> [Text] -> (Int, [Text])
-> IO (Map (Terms, Terms) Coocs) -> IO (Map (Terms, Terms) Coocs)
filterTermsAndCooc patterns ts = coocOn identity <$> mapM (terms patterns) ts filterTermsAndCooc patterns (year, ts) = do
putStrLn $ "start filterTermsAndCooc " <> show year
r <- coocOn identity <$> mapM (terms patterns) ts
putStrLn $ "stop filterTermsAndCooc " <> show year
pure r
--main :: IO [()] --main :: IO [()]
main = do main = do
...@@ -89,6 +92,6 @@ main = do ...@@ -89,6 +92,6 @@ main = do
let corpus' = DMaybe.catMaybes $ map (\k -> DM.lookup k corpus) years let corpus' = DMaybe.catMaybes $ map (\k -> DM.lookup k corpus) years
r <- zip years <$> mapConcurrently (filterTermsAndCooc patterns) corpus' r <- mapConcurrently (filterTermsAndCooc patterns) (zip years corpus')
putStrLn $ show r putStrLn $ show r
--writeFile outputFile cooc --writeFile outputFile cooc
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment