fetchKeywords :: HTMLDoc -> [(String, Integer)] -> WG.Keywords
fetchKeywords doc = foldl (\m (tag, val) -> foldl (\mp (word, points) -> M.insertWith (+) word points mp) m $ getAndClassify tag val) M.empty
  where
    getAndClassify :: String -> Integer -> [(String, Integer)]
    getAndClassify tag val = zip (map (map toLower) $ concatMap words $ fetchTag tag doc) (repeat val)
          

-- | Assigns a rank to every page in a WebGraph according to the number
-- | of times they are referenced
fetchKeywords :: HTMLDoc -> [(String, Integer)] -> WG.Keywords
fetchKeywords doc = foldl (\m (tag, val) -> foldl (\mp (word, points) -> M.insertWith (+) word points mp) m $ getAndClassify tag val) M.empty
  where
    getAndClassify :: String -> Integer -> [(String, Integer)]
    getAndClassify tag val = zip (map (map toLower) $ concatMap words $ fetchTag tag doc) (repeat val)
          

-- | Assigns a rank to every page in a WebGraph according to the number
-- | of times they are referenced
fetchKeywords doc = foldl (\m (tag, val) -> foldl (\mp (word, points) -> M.insertWith (+) word points mp) m $ getAndClassify tag val) M.empty
  where
    getAndClassify :: String -> Integer -> [(String, Integer)]
    getAndClassify tag val = zip (map (map toLower) $ concatMap words $ fetchTag tag doc) (repeat val)
          

-- | Assigns a rank to every page in a WebGraph according to the number
-- | of times they are referenced