Commit 43901901 authored by Alfredo Di Napoli's avatar Alfredo Di Napoli

Fix bug in GargPorter implementation

parent d44831d0
Pipeline #6830 failed with stages
in 45 minutes and 57 seconds
...@@ -52,6 +52,7 @@ tests = sequential $ aroundAll withTestDBAndPort $ do ...@@ -52,6 +52,7 @@ tests = sequential $ aroundAll withTestDBAndPort $ do
let corpusId = _sctx_data let corpusId = _sctx_data
withApplication _sctx_app $ do withApplication _sctx_app $ do
withValidLogin _sctx_port "alice" (GargPassword "alice") $ \clientEnv token -> do withValidLogin _sctx_port "alice" (GargPassword "alice") $ \clientEnv token -> do
liftIO $ do liftIO $ do
(HashedResponse _ tr1) (HashedResponse _ tr1)
<- checkEither $ runClientM (get_table token <- checkEither $ runClientM (get_table token
...@@ -63,8 +64,8 @@ tests = sequential $ aroundAll withTestDBAndPort $ do ...@@ -63,8 +64,8 @@ tests = sequential $ aroundAll withTestDBAndPort $ do
(Just $ RawQuery "soy") (Just $ RawQuery "soy")
Nothing Nothing
) clientEnv ) clientEnv
length (tr_docs tr1) `shouldBe` 4
length (tr_docs tr1) `shouldBe` 3
createSoySauceCorpus :: SpecContext () -> IO (SpecContext CorpusId) createSoySauceCorpus :: SpecContext () -> IO (SpecContext CorpusId)
createSoySauceCorpus ctx@SpecContext{..} = do createSoySauceCorpus ctx@SpecContext{..} = do
......
...@@ -135,6 +135,8 @@ stemmingTest :: TestEnv -> Assertion ...@@ -135,6 +135,8 @@ stemmingTest :: TestEnv -> Assertion
stemmingTest _env = do stemmingTest _env = do
stem EN GargPorterAlgorithm "Ajeje" `shouldBe` "Ajeje" stem EN GargPorterAlgorithm "Ajeje" `shouldBe` "Ajeje"
stem EN GargPorterAlgorithm "PyPlasm:" `shouldBe` "PyPlasm:" stem EN GargPorterAlgorithm "PyPlasm:" `shouldBe` "PyPlasm:"
stem EN GargPorterAlgorithm "soy" `shouldBe` "soy"
stem EN GargPorterAlgorithm "cry" `shouldBe` "cri"
-- This test outlines the main differences between Porter and Lancaster. -- This test outlines the main differences between Porter and Lancaster.
stem EN GargPorterAlgorithm "dancer" `shouldBe` "dancer" stem EN GargPorterAlgorithm "dancer" `shouldBe` "dancer"
stem EN LancasterAlgorithm "dancer" `shouldBe` "dant" stem EN LancasterAlgorithm "dancer" `shouldBe` "dant"
......
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