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
153
Issues
153
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
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
gargantext
haskell-gargantext
Commits
92d85f76
Commit
92d85f76
authored
Jan 21, 2021
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[BIN] upgrade binary for PosTags
parent
e7491362
Pipeline
#1364
failed with stage
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
17 deletions
+20
-17
Main.hs
bin/gargantext-upgrade/Main.hs
+12
-10
package.yaml
package.yaml
+1
-0
WithStem.hs
src/Gargantext/Core/Text/List/Group/WithStem.hs
+1
-1
Flow.hs
src/Gargantext/Database/Action/Flow.hs
+6
-6
No files found.
bin/gargantext-upgrade/Main.hs
View file @
92d85f76
...
...
@@ -15,31 +15,33 @@ Import a corpus binary.
module
Main
where
import
Gargantext.API.Admin.EnvTypes
(
DevEnv
)
import
Gargantext.API.Dev
(
withDevEnv
,
runCmdDev
)
import
Gargantext.API.Prelude
(
GargError
)
import
Gargantext.API.Node
()
-- instances only
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Admin.Types.Hyperdata
import
Gargantext.Database.Query.Table.Node.UpdateOpaleye
import
Gargantext.Database.Prelude
(
Cmd
,
)
import
Gargantext.Database.Prelude
(
Cmd
''
,
)
import
Gargantext.Prelude
import
System.Environment
(
getArgs
)
-- | PosTag
import
Gargantext.Database.Action.Flow
(
indexAllDocumentsWithPosTag
)
import
Gargantext.Database.Query.Table.NgramsPostag
(
createTable_NgramsPostag
)
main
::
IO
()
main
=
do
[
iniPath
]
<-
getArgs
let
updateNodes
::
Cmd
GargError
[
Int64
]
updateNodes
=
updateNodesWithType_
NodeList
defaultHyperdataList
upgrade
::
Cmd''
DevEnv
GargError
()
upgrade
=
do
_
<-
createTable_NgramsPostag
_
<-
indexAllDocumentsWithPosTag
pure
()
withDevEnv
iniPath
$
\
env
->
do
x
<-
runCmdDev
env
updateNodes
putStrLn
$
show
x
_
<-
runCmdDev
env
upgrade
putStrLn
"Uprade"
pure
()
package.yaml
View file @
92d85f76
...
...
@@ -58,6 +58,7 @@ library:
-
Gargantext.Database.Query.Table.User
-
Gargantext.Database.Query.Table.Node
-
Gargantext.Database.Query.Table.Node.UpdateOpaleye
-
Gargantext.Database.Query.Table.NgramsPostag
-
Gargantext.Database.Prelude
-
Gargantext.Database.Admin.Trigger.Init
-
Gargantext.Database.Admin.Config
...
...
src/Gargantext/Core/Text/List/Group/WithStem.hs
View file @
92d85f76
...
...
@@ -91,7 +91,7 @@ groupWith (GroupWithPosTag _ _ m) t =
Nothing
->
clean
t
Just
t'
->
clean
$
NgramsTerm
t'
where
clean
(
NgramsTerm
t
)
=
NgramsTerm
$
Text
.
replace
"-"
" "
t
clean
(
NgramsTerm
t
''
)
=
NgramsTerm
$
Text
.
replace
"-"
" "
t''
--------------------------------------------------------------------
stemPatches
::
GroupParams
...
...
src/Gargantext/Database/Action/Flow.hs
View file @
92d85f76
...
...
@@ -41,7 +41,7 @@ module Gargantext.Database.Action.Flow -- (flowDatabase, ngrams2list)
,
allDataOrigins
,
do_api
,
upgrade
,
indexAllDocumentsWithPosTag
)
where
...
...
@@ -439,14 +439,14 @@ instance HasText a => HasText (Node a)
-- | TODO putelsewhere
-- | Upgrade function
-- Suppose all documents are English (this is the case actually)
upgrade
::
FlowCmdM
env
err
m
=>
m
()
upgrade
=
do
indexAllDocumentsWithPosTag
::
FlowCmdM
env
err
m
=>
m
()
indexAllDocumentsWithPosTag
=
do
rootId
<-
getRootId
(
UserName
userMaster
)
corpusIds
<-
findNodesId
rootId
[
NodeCorpus
]
docs
<-
List
.
concat
<$>
mapM
getDocumentsWithParentId
[
NodeId
5
]
docs
<-
List
.
concat
<$>
mapM
getDocumentsWithParentId
corpusIds
printDebug
"Nb of docs"
(
List
.
length
docs
)
...
...
@@ -458,7 +458,7 @@ upgrade = do
(
extractNgramsT
$
withLang
(
Multi
EN
)
documentsWithId
)
documentsWithId
terms2id
<-
insertExtractedNgrams
$
HashMap
.
keys
mapNgramsDocs'
_
<-
insertExtractedNgrams
$
HashMap
.
keys
mapNgramsDocs'
pure
()
...
...
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