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
Julien Moutinho
haskell-gargantext
Commits
04e82dd6
Commit
04e82dd6
authored
Jul 13, 2023
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Maybe Lang
parent
13b5d6a1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
8 deletions
+9
-8
List.hs
src/Gargantext/API/Ngrams/List.hs
+2
-2
Update.hs
src/Gargantext/API/Node/Corpus/Update.hs
+1
-1
Tools.hs
src/Gargantext/Core/Viz/Phylo/API/Tools.hs
+2
-2
LegacyMain.hs
src/Gargantext/Core/Viz/Phylo/Legacy/LegacyMain.hs
+2
-1
Corpus.hs
src/Gargantext/Database/Admin/Types/Hyperdata/Corpus.hs
+2
-2
No files found.
src/Gargantext/API/Ngrams/List.hs
View file @
04e82dd6
...
...
@@ -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
)
import
Gargantext.Core
(
Lang
(
EN
)
)
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
=
view
(
node_hyperdata
.
to
_hc_lang
)
corpus_node
let
corpusLang
=
fromMaybe
EN
$
view
(
node_hyperdata
.
to
_hc_lang
)
corpus_node
-- Getting [NgramsTerm]
ts
<-
List
.
concat
...
...
src/Gargantext/API/Node/Corpus/Update.hs
View file @
04e82dd6
...
...
@@ -23,5 +23,5 @@ addLanguageToCorpus :: (FlowCmdM env err m, MonadJobStatus m)
->
m
()
addLanguageToCorpus
cId
lang
=
do
hyperNode
<-
getNodeWith
cId
(
Proxy
@
HyperdataCorpus
)
let
hyperNode'
=
hyperNode
&
over
node_hyperdata
(
\
corpus
->
corpus
{
_hc_lang
=
lang
})
let
hyperNode'
=
hyperNode
&
over
node_hyperdata
(
\
corpus
->
corpus
{
_hc_lang
=
Just
lang
})
void
$
updateHyperdata
cId
hyperNode'
src/Gargantext/Core/Viz/Phylo/API/Tools.hs
View file @
04e82dd6
...
...
@@ -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
)
import
Gargantext.Core
(
Lang
(
EN
)
)
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
corpusLang
patterns
timeUnit
)
(
map
_context_hyperdata
docs
)
pure
$
map
(
toPhyloDocs
(
fromMaybe
EN
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 @
04e82dd6
...
...
@@ -40,6 +40,7 @@ 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.Viz.Phylo.LevelMaker (toPhylo)
-- import Gargantext.Core.Viz.Phylo.Tools
...
...
@@ -57,7 +58,7 @@ flowPhylo :: (FlowCmdM env err m, HasDBid NodeType)
flowPhylo
cId
=
do
corpus_node
<-
getNodeWith
cId
(
Proxy
@
HyperdataCorpus
)
let
lang
=
view
(
node_hyperdata
.
to
_hc_lang
)
corpus_node
let
lang
=
fromMaybe
EN
$
view
(
node_hyperdata
.
to
_hc_lang
)
corpus_node
list
<-
defaultList
cId
termList
<-
HashMap
.
toList
<$>
getTermsWith
(
Text
.
words
.
unNgramsTerm
)
[
list
]
NgramsTerms
(
Set
.
singleton
MapTerm
)
...
...
src/Gargantext/Database/Admin/Types/Hyperdata/Corpus.hs
View file @
04e82dd6
...
...
@@ -33,7 +33,7 @@ data HyperdataCorpus =
,
_hc_pubmed_api_key
::
Maybe
APIKey
-- | The language for the corpus. It defaults to
-- 'defaultLanguage' if we don't know which language it is.
,
_hc_lang
::
!
Lang
,
_hc_lang
::
Maybe
Lang
}
deriving
(
Generic
)
...
...
@@ -49,7 +49,7 @@ defaultHyperdataCorpus =
(
JsonField
"Title"
"Descr"
"Bool query"
"Authors"
)
]
,
_hc_pubmed_api_key
=
Nothing
,
_hc_lang
=
defaultLanguage
,
_hc_lang
=
Just
defaultLanguage
}
------------------------------------------------------------------------
...
...
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