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
195
Issues
195
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
34bcbffd
Commit
34bcbffd
authored
Jul 30, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DEV] Flow + Main + cosmetics on Learn.
parent
e923bba5
Pipeline
#534
canceled with stage
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
24 deletions
+20
-24
Main.hs
bin/gargantext-import/Main.hs
+1
-1
Flow.hs
src/Gargantext/Database/Flow.hs
+4
-5
Learn.hs
src/Gargantext/Text/Learn.hs
+15
-18
No files found.
bin/gargantext-import/Main.hs
View file @
34bcbffd
...
@@ -50,7 +50,7 @@ main = do
...
@@ -50,7 +50,7 @@ main = do
let
let
--tt = (Unsupervised EN 6 0 Nothing)
--tt = (Unsupervised EN 6 0 Nothing)
tt
=
(
Multi
EN
)
tt
=
(
Multi
EN
)
format
=
Csv
HalFormat
--WOS -- CsvGargV3
format
=
Csv
GargV3
-- CsvHalFormat --WOS
cmd
::
forall
m
.
FlowCmdM
DevEnv
GargError
m
=>
m
CorpusId
cmd
::
forall
m
.
FlowCmdM
DevEnv
GargError
m
=>
m
CorpusId
cmd
=
flowCorpusFile
(
cs
user
)
(
Left
(
cs
name
::
Text
))
(
read
limit
::
Int
)
tt
format
corpusPath
cmd
=
flowCorpusFile
(
cs
user
)
(
Left
(
cs
name
::
Text
))
(
read
limit
::
Int
)
tt
format
corpusPath
{-
{-
...
...
src/Gargantext/Database/Flow.hs
View file @
34bcbffd
...
@@ -18,7 +18,7 @@ Portability : POSIX
...
@@ -18,7 +18,7 @@ Portability : POSIX
-}
-}
{-# OPTIONS_GHC -fno-warn-orphans
#-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RankNTypes #-}
...
@@ -195,12 +195,11 @@ flowCorpusUser l userName corpusName ctype ids = do
...
@@ -195,12 +195,11 @@ flowCorpusUser l userName corpusName ctype ids = do
printDebug
"userListId"
userListId
printDebug
"userListId"
userListId
-- User Graph Flow
-- User Graph Flow
_
<-
mkTexts
userCorpusId
userId
_
<-
mkTexts
userCorpusId
userId
--
_
<-
mkGraph
userCorpusId
userId
_
<-
mkDashboard
userCorpusId
userId
--
_
<-
mkPhylo
userCorpusId
userId
_
<-
mkGraph
userCorpusId
userId
_
<-
mkPhylo
userCorpusId
userId
--}
--}
-- User Dashboard Flow
--
_
<-
mkDashboard
userCorpusId
userId
-- Annuaire Flow
-- Annuaire Flow
-- _ <- mkAnnuaire rootUserId userId
-- _ <- mkAnnuaire rootUserId userId
...
...
src/Gargantext/Text/Learn.hs
View file @
34bcbffd
...
@@ -9,10 +9,8 @@ Portability : POSIX
...
@@ -9,10 +9,8 @@ Portability : POSIX
TODO:
TODO:
- generalize to byteString
- generalize to byteString
- Stop words and (how to learn it).
Stop words and (how to learn it).
- Main type here is String check if Chars on Text would be optimized
Main type here is String.
-}
-}
...
@@ -68,6 +66,19 @@ data CatWord a = CatWord a Word
...
@@ -68,6 +66,19 @@ data CatWord a = CatWord a Word
type
CatProb
a
=
Map
a
Double
type
CatProb
a
=
Map
a
Double
type
Events
a
=
Map
a
EventBook
type
Events
a
=
Map
a
EventBook
------------------------------------------------------------------------
data
EventBook
=
EventBook
{
events_freq
::
Map
String
Freq
,
events_n
::
Map
StringSize
TotalFreq
}
deriving
(
Show
,
Generic
)
instance
Serialise
EventBook
instance
(
Serialise
a
,
Ord
a
)
=>
SaveFile
(
Events
a
)
where
saveFile'
f
d
=
BSL
.
writeFile
f
(
serialise
d
)
instance
(
Serialise
a
,
Ord
a
)
=>
ReadFile
(
Events
a
)
where
readFile'
filepath
=
deserialise
<$>
BSL
.
readFile
filepath
------------------------------------------------------------------------
------------------------------------------------------------------------
detectStopDefault
::
Text
->
Maybe
Bool
detectStopDefault
::
Text
->
Maybe
Bool
...
@@ -174,20 +185,6 @@ toEvents e ns n = foldl' (opEvent (+)) (emptyEvent e ns n) . map (toEvent ns n)
...
@@ -174,20 +185,6 @@ toEvents e ns n = foldl' (opEvent (+)) (emptyEvent e ns n) . map (toEvent ns n)
opEvent
f
=
DM
.
unionWith
(
op
f
)
opEvent
f
=
DM
.
unionWith
(
op
f
)
------------------------------------------------------------------------
------------------------------------------------------------------------
------------------------------------------------------------------------
data
EventBook
=
EventBook
{
events_freq
::
Map
String
Freq
,
events_n
::
Map
StringSize
TotalFreq
}
deriving
(
Show
,
Generic
)
instance
Serialise
EventBook
instance
(
Serialise
a
,
Ord
a
)
=>
SaveFile
(
Events
a
)
where
saveFile'
f
d
=
BSL
.
writeFile
f
(
serialise
d
)
instance
(
Serialise
a
,
Ord
a
)
=>
ReadFile
(
Events
a
)
where
readFile'
filepath
=
deserialise
<$>
BSL
.
readFile
filepath
emptyEventBook
::
[
Int
]
->
Int
->
EventBook
emptyEventBook
::
[
Int
]
->
Int
->
EventBook
emptyEventBook
ns
n
=
wordToBook
ns
n
" "
emptyEventBook
ns
n
=
wordToBook
ns
n
" "
...
...
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