Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
haskell-gargantext
Commits
d2e6426b
Commit
d2e6426b
authored
Apr 24, 2023
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DEBUG] print debug infos
parent
6dd22092
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
6 deletions
+24
-6
gargantext.cabal
gargantext.cabal
+1
-1
Tools.hs
src/Gargantext/Core/Viz/Phylo/API/Tools.hs
+23
-5
No files found.
gargantext.cabal
View file @
d2e6426b
...
...
@@ -5,7 +5,7 @@ cabal-version: 1.12
-- see: https://github.com/sol/hpack
name: gargantext
version: 0.0.6.9.9.1
version:
0.0.6.9.9.1
synopsis: Search, map, share
description: Please see README.md
category: Data
...
...
src/Gargantext/Core/Viz/Phylo/API/Tools.hs
View file @
d2e6426b
...
...
@@ -12,10 +12,10 @@ Portability : POSIX
module
Gargantext.Core.Viz.Phylo.API.Tools
where
import
Data.Proxy
import
Data.Aeson
(
Value
,
decodeFileStrict
,
eitherDecode
,
encode
)
import
Data.Map.Strict
(
Map
)
import
Data.Maybe
(
catMaybes
)
import
Data.Proxy
import
Data.Set
(
Set
)
import
Data.Text
(
Text
,
pack
)
import
Data.Time.Calendar
(
fromGregorian
,
diffGregorianDurationClip
,
cdMonths
,
diffDays
,
showGregorian
)
...
...
@@ -27,19 +27,23 @@ import Gargantext.API.Node.Corpus.Export (getContextNgrams)
import
Gargantext.API.Prelude
(
GargNoServer
)
import
Gargantext.Core.Text.Context
(
TermList
)
import
Gargantext.Core.Types
(
Context
)
-- import Gargantext.Core.Types.Individu (User(..))
import
Gargantext.Core.Types.Main
(
ListType
(
MapTerm
))
import
Gargantext.Core.Viz.Phylo
(
TimeUnit
(
..
),
Date
,
Document
(
..
),
PhyloConfig
(
..
),
Phylo
)
import
Gargantext.Core.Viz.Phylo.PhyloExport
(
toPhyloExport
,
dotToFile
)
import
Gargantext.Core.Viz.Phylo.PhyloMaker
(
toPhylo
,
toPhyloWithoutLink
)
import
Gargantext.Core.Viz.Phylo.PhyloTools
(
{-printIOMsg, printIOComment,-}
setConfig
)
import
Gargantext.Database.Admin.Types.Hyperdata.Document
(
HyperdataDocument
(
..
))
-- import Gargantext.Database.Action.Flow (getOrMk_RootWithCorpus)
-- import Gargantext.Database.Admin.Config (userMaster)
-- import Gargantext.Database.Admin.Types.Hyperdata (HyperdataCorpus)
import
Gargantext.Database.Admin.Types.Hyperdata
(
HyperdataPhylo
(
..
))
import
Gargantext.Database.Admin.Types.Hyperdata.Document
(
HyperdataDocument
(
..
))
import
Gargantext.Database.Admin.Types.Node
(
CorpusId
,
ContextId
,
PhyloId
)
import
Gargantext.Database.Query.Table.Node
(
defaultList
,
getNodeWith
)
import
Gargantext.Database.Query.Table.NodeContext
(
selectDocNodes
)
import
Gargantext.Database.Schema.Context
import
Gargantext.Database.Schema.Node
import
Gargantext.Database.Schema.Ngrams
(
NgramsType
(
..
))
import
Gargantext.Database.Schema.Node
import
Gargantext.Prelude
import
Prelude
import
System.Process
as
Shell
...
...
@@ -48,7 +52,6 @@ import qualified Data.List as List
import
qualified
Data.Map.Strict
as
Map
import
qualified
Data.Set
as
Set
--------------------------------------------------------------------
getPhyloData
::
PhyloId
->
GargNoServer
(
Maybe
Phylo
)
getPhyloData
phyloId
=
do
...
...
@@ -95,17 +98,32 @@ flowPhyloAPI config cId = do
corpusIdtoDocuments
::
TimeUnit
->
CorpusId
->
GargNoServer
(
TermList
,
[
Document
])
corpusIdtoDocuments
timeUnit
corpusId
=
do
docs
<-
selectDocNodes
corpusId
printDebug
"docs *****"
(
length
docs
)
lId
<-
defaultList
corpusId
{-
(_masterUserId, _masterRootId, masterCorpusId) <- getOrMk_RootWithCorpus
(UserName userMaster)
(Left "")
(Nothing :: Maybe HyperdataCorpus)
mListId <- defaultList masterCorpusId
repo <- getRepo [mListId,lId]
-}
repo
<-
getRepo
[
lId
]
-- ngs_terms' <- getContextNgrams corpusId mListId MapTerm NgramsTerms repo
ngs_terms
<-
getContextNgrams
corpusId
lId
MapTerm
NgramsTerms
repo
printDebug
"Size ngs_coterms *****"
(
length
ngs_terms
)
ngs_sources
<-
getContextNgrams
corpusId
lId
MapTerm
Sources
repo
printDebug
"Size ngs_sources Map Sources *****"
(
length
ngs_sources
)
termList
<-
getTermList
lId
MapTerm
NgramsTerms
printDebug
"Size ngs_terms List Map Ngrams *****"
(
length
<$>
termList
)
let
docs'
=
catMaybes
$
List
.
map
(
\
doc
->
context2phyloDocument
timeUnit
doc
(
ngs_terms
,
ngs_sources
)
->
context2phyloDocument
timeUnit
doc
(
ngs_terms
{-<> ngs_terms'-}
,
ngs_sources
)
)
docs
-- printDebug "corpusIdtoDocuments" (Prelude.map date docs')
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment