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
Christian Merten
haskell-gargantext
Commits
29b3b771
Commit
29b3b771
authored
Jul 17, 2023
by
Alfredo Di Napoli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace 'fromMaybe EN' with 'withDefaultLanguage'
parent
a8b8b4fc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
7 deletions
+6
-7
List.hs
src/Gargantext/API/Ngrams/List.hs
+2
-2
Tools.hs
src/Gargantext/Core/Viz/Phylo/API/Tools.hs
+2
-2
LegacyMain.hs
src/Gargantext/Core/Viz/Phylo/Legacy/LegacyMain.hs
+2
-3
No files found.
src/Gargantext/API/Ngrams/List.hs
View file @
29b3b771
...
...
@@ -25,7 +25,7 @@ import Data.Set (Set)
import
Data.Text
(
Text
,
concat
,
pack
,
splitOn
)
import
Data.Vector
(
Vector
)
import
Gargantext.API.Admin.EnvTypes
(
Env
,
GargJob
(
..
))
import
Gargantext.Core
(
Lang
(
EN
)
)
import
Gargantext.Core
(
Lang
,
withDefaultLanguage
)
import
Gargantext.API.Admin.Orchestrator.Types
import
Gargantext.API.Ngrams
(
setListNgrams
)
import
Gargantext.API.Ngrams.List.Types
...
...
@@ -157,7 +157,7 @@ reIndexWith :: ( HasNodeStory env err m
reIndexWith
cId
lId
nt
lts
=
do
-- printDebug "(cId,lId,nt,lts)" (cId, lId, nt, lts)
corpus_node
<-
getNodeWith
cId
(
Proxy
@
HyperdataCorpus
)
let
corpusLang
=
fromMaybe
EN
$
view
(
node_hyperdata
.
to
_hc_lang
)
corpus_node
let
corpusLang
=
withDefaultLanguage
$
view
(
node_hyperdata
.
to
_hc_lang
)
corpus_node
-- Getting [NgramsTerm]
ts
<-
List
.
concat
...
...
src/Gargantext/Core/Viz/Phylo/API/Tools.hs
View file @
29b3b771
...
...
@@ -27,7 +27,7 @@ import Gargantext.API.Ngrams.Prelude (getTermList)
import
Gargantext.API.Ngrams.Types
(
NgramsTerm
(
..
))
import
Gargantext.API.Prelude
(
GargNoServer
)
import
Gargantext.Core.Text.Terms.WithList
(
Patterns
,
buildPatterns
,
termsInText
)
import
Gargantext.Core
(
Lang
(
EN
)
)
import
Gargantext.Core
(
withDefaultLanguage
,
Lang
)
import
Gargantext.Core.Types
(
Context
)
-- import Gargantext.Core.Types.Individu (User(..))
import
Gargantext.Core.Types.Main
(
ListType
(
MapTerm
))
...
...
@@ -114,7 +114,7 @@ corpusIdtoDocuments timeUnit corpusId = do
let
patterns
=
case
termList
of
Nothing
->
panic
"[G.C.V.Phylo.API] no termList found"
Just
termList'
->
buildPatterns
termList'
pure
$
map
(
toPhyloDocs
(
fromMaybe
EN
corpusLang
)
patterns
timeUnit
)
(
map
_context_hyperdata
docs
)
pure
$
map
(
toPhyloDocs
(
withDefaultLanguage
corpusLang
)
patterns
timeUnit
)
(
map
_context_hyperdata
docs
)
termsInText'
::
Lang
->
Patterns
->
Text
->
[
Text
]
termsInText'
lang
p
t
=
(
map
fst
)
$
termsInText
lang
p
t
...
...
src/Gargantext/Core/Viz/Phylo/Legacy/LegacyMain.hs
View file @
29b3b771
...
...
@@ -39,8 +39,7 @@ import Gargantext.Database.Schema.Ngrams (NgramsType(..))
import
Gargantext.Database.Schema.Node
import
Gargantext.Database.Query.Table.NodeContext
(
selectDocs
)
import
Gargantext.Core.Types
import
Gargantext.Core
(
HasDBid
)
import
Gargantext.Core
(
Lang
(
EN
))
import
Gargantext.Core
(
HasDBid
,
withDefaultLanguage
)
-- import Gargantext.Core.Viz.Phylo.LevelMaker (toPhylo)
-- import Gargantext.Core.Viz.Phylo.Tools
...
...
@@ -58,7 +57,7 @@ flowPhylo :: (FlowCmdM env err m, HasDBid NodeType)
flowPhylo
cId
=
do
corpus_node
<-
getNodeWith
cId
(
Proxy
@
HyperdataCorpus
)
let
lang
=
fromMaybe
EN
$
view
(
node_hyperdata
.
to
_hc_lang
)
corpus_node
let
lang
=
withDefaultLanguage
$
view
(
node_hyperdata
.
to
_hc_lang
)
corpus_node
list
<-
defaultList
cId
termList
<-
HashMap
.
toList
<$>
getTermsWith
(
Text
.
words
.
unNgramsTerm
)
[
list
]
NgramsTerms
(
Set
.
singleton
MapTerm
)
...
...
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