Commit 5a2a78fe authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] Corpus V3 + fixes for compilation.

parent b6b0e00f
...@@ -10,6 +10,8 @@ Portability : POSIX ...@@ -10,6 +10,8 @@ Portability : POSIX
@Gargantext@: search, map, share @Gargantext@: search, map, share
-} -}
{-# LANGUAGE NoImplicitPrelude #-}
module Gargantext ( module Gargantext.API module Gargantext ( module Gargantext.API
, module Gargantext.Core , module Gargantext.Core
, module Gargantext.Database , module Gargantext.Database
......
...@@ -34,7 +34,8 @@ nodeTypeId n = ...@@ -34,7 +34,8 @@ nodeTypeId n =
NodeUser -> 1 NodeUser -> 1
Folder -> 2 Folder -> 2
--NodeCorpus -> 3 --NodeCorpus -> 3
NodeCorpus -> 30 -- TODO ERRR NodeCorpusV3 -> 3
NodeCorpus -> 30
Annuaire -> 31 Annuaire -> 31
Document -> 4 Document -> 4
UserPage -> 41 UserPage -> 41
......
...@@ -100,7 +100,7 @@ dbTree conn rootId = map (\(nId, tId, pId, n) -> DbTreeNode nId tId pId n) <$> q ...@@ -100,7 +100,7 @@ dbTree conn rootId = map (\(nId, tId, pId, n) -> DbTreeNode nId tId pId n) <$> q
UNION ALL UNION ALL
SELECT n.id, n.typename, n.parent_id, n.name SELECT n.id, n.typename, n.parent_id, n.name
FROM nodes AS n JOIN descendants AS d ON n.parent_id = d.id FROM nodes AS n JOIN descendants AS d ON n.parent_id = d.id
where n.typename in (2,30,31) where n.typename in (2,3,30,31)
), ),
ancestors (id, typename, parent_id, name) AS ancestors (id, typename, parent_id, name) AS
( (
......
...@@ -271,13 +271,14 @@ type NodeUser = Node HyperdataUser ...@@ -271,13 +271,14 @@ type NodeUser = Node HyperdataUser
type Folder = Node HyperdataFolder type Folder = Node HyperdataFolder
type Project = Node HyperdataProject type Project = Node HyperdataProject
type NodeCorpus = Node HyperdataCorpus type NodeCorpus = Node HyperdataCorpus
type NodeCorpusV3 = Node HyperdataCorpus
type Document = Node HyperdataDocument type Document = Node HyperdataDocument
------------------------------------------------------------------------ ------------------------------------------------------------------------
data NodeType = NodeUser data NodeType = NodeUser
-- | Project -- | Project
| Folder | Folder
| NodeCorpus | Annuaire | NodeCorpus | NodeCorpusV3 | Annuaire
| Document -- | Individu | Document -- | Individu
| UserPage | Favorites | UserPage | Favorites
| Graph | Dashboard | Chart | Graph | Dashboard | Chart
......
...@@ -13,6 +13,7 @@ Page : text mining ...@@ -13,6 +13,7 @@ Page : text mining
-} -}
{-# LANGUAGE NoImplicitPrelude #-}
module Gargantext.Text.Samples.CH where module Gargantext.Text.Samples.CH where
......
...@@ -12,6 +12,8 @@ Page : text mining ...@@ -12,6 +12,8 @@ Page : text mining
-} -}
{-# LANGUAGE NoImplicitPrelude #-}
module Gargantext.Text.Samples.DE where module Gargantext.Text.Samples.DE where
import Data.String (String) import Data.String (String)
......
...@@ -13,6 +13,7 @@ Page : text mining ...@@ -13,6 +13,7 @@ Page : text mining
-} -}
{-# LANGUAGE NoImplicitPrelude #-}
module Gargantext.Text.Samples.EN where module Gargantext.Text.Samples.EN where
......
...@@ -12,9 +12,11 @@ Page : text mining ...@@ -12,9 +12,11 @@ Page : text mining
-} -}
{-# LANGUAGE NoImplicitPrelude #-}
module Gargantext.Text.Samples.FR where module Gargantext.Text.Samples.FR where
import Gargantext.Prelude import Gargantext.Prelude ((<>))
import Data.String (String) import Data.String (String)
textSample :: String textSample :: String
......
...@@ -12,6 +12,8 @@ Page : text mining ...@@ -12,6 +12,8 @@ Page : text mining
-} -}
{-# LANGUAGE NoImplicitPrelude #-}
module Gargantext.Text.Samples.SP where module Gargantext.Text.Samples.SP where
import Data.String (String) import Data.String (String)
......
...@@ -162,7 +162,7 @@ pebLang st = map (\(l,eb) -> (l, peb' st eb)) . DM.toList ...@@ -162,7 +162,7 @@ pebLang st = map (\(l,eb) -> (l, peb' st eb)) . DM.toList
------------------------------------------------------------------------ ------------------------------------------------------------------------
prior :: [(Lang, (Freq, TotalFreq))] -> [(Lang, Double)] prior :: [(Lang, (Freq, TotalFreq))] -> [(Lang, Double)]
prior ps = zip ls $ zipWith (\x y -> x^99 * y) (map (\(a,_) -> part a (sum $ map fst ps')) ps') prior ps = zip ls $ zipWith (\x y -> x^(99::Int) * y) (map (\(a,_) -> part a (sum $ map fst ps')) ps')
(map (\(a,b) -> a / b) ps') (map (\(a,b) -> a / b) ps')
where where
......
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