Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
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
Przemyslaw Kaminski
haskell-gargantext
Commits
e4cbfa19
Commit
e4cbfa19
authored
Jan 27, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Upload CSV + new Lang all
parent
f84213ca
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
13 additions
and
10 deletions
+13
-10
New.hs
src/Gargantext/API/Corpus/New.hs
+7
-5
API.hs
src/Gargantext/Text/Corpus/API.hs
+1
-1
Date.hs
src/Gargantext/Text/Corpus/Parsers/Date.hs
+1
-1
Learn.hs
src/Gargantext/Text/Learn.hs
+1
-0
Stem.hs
src/Gargantext/Text/Terms/Mono/Stem.hs
+1
-1
Multi.hs
src/Gargantext/Text/Terms/Multi.hs
+1
-1
PosTagging.hs
src/Gargantext/Text/Terms/Multi/PosTagging.hs
+1
-1
No files found.
src/Gargantext/API/Corpus/New.hs
View file @
e4cbfa19
...
...
@@ -43,7 +43,7 @@ import Gargantext.Database.Types.Node (CorpusId)
import
Gargantext.Database.Types.Node
(
ToHyperdataDocument
(
..
))
import
Gargantext.Database.Types.Node
(
UserId
)
import
Gargantext.Prelude
import
Gargantext.Text.Corpus.Parsers.CSV
(
parseCsv'
)
--parseHal')--, parseCsv
')
import
Gargantext.Text.Corpus.Parsers.CSV
(
parseCsv'
,
parseHal
'
)
import
Gargantext.Text.Terms
(
TermType
(
..
))
import
Servant
import
Servant.API.Flatten
(
Flat
)
...
...
@@ -223,15 +223,17 @@ addToCorpusWithForm :: FlowCmdM env err m
->
m
ScraperStatus
addToCorpusWithForm
cid
(
WithForm
ft
d
)
logStatus
=
do
printDebug
"ft"
ft
let
parse
=
case
ft
of
Just
CSV_HAL
->
parseHal'
Just
CSV
->
parseCsv'
_
->
parseHal'
CSV_HAL
->
parseHal'
CSV
->
parseCsv'
_
->
parseHal'
docs
=
splitEvery
500
$
take
1000000
$
parse
Csv'
(
cs
d
)
$
parse
(
cs
d
)
logStatus
ScraperStatus
{
_scst_succeeded
=
Just
1
,
_scst_failed
=
Just
0
...
...
src/Gargantext/Text/Corpus/API.hs
View file @
e4cbfa19
...
...
@@ -36,7 +36,6 @@ import qualified Gargantext.Text.Corpus.API.Istex as ISTEX
-- | Get External API metadata main function
get
::
ExternalAPIs
->
Query
->
Maybe
Limit
->
IO
[
HyperdataDocument
]
get
All
_
_
=
undefined
get
PubMed
q
l
=
PUBMED
.
get
q
l
...
...
@@ -49,6 +48,7 @@ get IsTex_FR q l = ISTEX.get FR q l
get
Isidore_EN
q
l
=
ISIDORE
.
get
EN
(
fromIntegral
<$>
l
)
(
Just
q
)
Nothing
get
Isidore_FR
q
l
=
ISIDORE
.
get
FR
(
fromIntegral
<$>
l
)
(
Just
q
)
Nothing
get
_
_
_
=
undefined
-- | Some Sugar for the documentation
type
Query
=
PUBMED
.
Query
type
Limit
=
PUBMED
.
Limit
...
...
src/Gargantext/Text/Corpus/Parsers/Date.hs
View file @
e4cbfa19
...
...
@@ -84,7 +84,7 @@ parseDate' format def lang s = do
parserLang
::
Lang
->
DC
.
Lang
parserLang
FR
=
DC
.
FR
parserLang
EN
=
DC
.
EN
--
parserLang _ = panic "not implemented"
parserLang
_
=
panic
"not implemented"
-- | Final Date parser API
-- IO can be avoided here:
...
...
src/Gargantext/Text/Learn.hs
View file @
e4cbfa19
...
...
@@ -117,6 +117,7 @@ detectLangDefault = detectCat 99 eventLang
textSample
::
Lang
->
String
textSample
EN
=
EN
.
textSample
textSample
FR
=
FR
.
textSample
textSample
_
=
panic
"textSample: not impl yet"
--textSample DE = DE.textSample
--textSample SP = SP.textSample
--textSample CH = CH.textSample
...
...
src/Gargantext/Text/Terms/Mono/Stem.hs
View file @
e4cbfa19
...
...
@@ -55,7 +55,7 @@ stem lang = DT.pack . N.stem lang' . DT.unpack
lang'
=
case
lang
of
EN
->
N
.
English
FR
->
N
.
French
--
_
->
panic
$
DT
.
pack
"not implemented yet"
_
->
panic
$
DT
.
pack
"not implemented yet"
src/Gargantext/Text/Terms/Multi.hs
View file @
e4cbfa19
...
...
@@ -57,4 +57,4 @@ tokenTags' lang t = map tokens2tokensTags
group
::
Lang
->
[
TokenTag
]
->
[
TokenTag
]
group
EN
=
En
.
group
group
FR
=
Fr
.
group
--
group _ = panic $ pack "group :: Lang not implemeted yet"
group
_
=
panic
$
pack
"group :: Lang not implemeted yet"
src/Gargantext/Text/Terms/Multi/PosTagging.hs
View file @
e4cbfa19
...
...
@@ -124,7 +124,7 @@ corenlp' lang txt = do
EN
->
"{
\"
annotators
\"
:
\"
tokenize,ssplit,pos,ner
\"
,
\"
outputFormat
\"
:
\"
json
\"
}"
-- FR -> "{\"annotators\": \"tokenize,ssplit,pos,ner\", \"outputFormat\": \"json\"}"
FR
->
"{
\"
annotators
\"
:
\"
tokenize,ssplit,pos,ner
\"
,
\"
parse.model
\"
:
\"
edu/stanford/nlp/models/lexparser/frenchFactored.ser.gz
\"
,
\"
pos.model
\"
:
\"
edu/stanford/nlp/models/pos-tagger/french/french.tagger
\"
,
\"
tokenize.language
\"
:
\"
fr
\"
,
\"
outputFormat
\"
:
\"
json
\"
}"
--
_ -> panic $ pack "not implemented yet"
_
->
panic
$
pack
"not implemented yet"
url
<-
parseRequest
$
"POST http://localhost:9000/?properties="
<>
properties
let
request
=
setRequestBodyLBS
(
cs
txt
)
url
httpJSON
request
...
...
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