Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-gargantext-prelude
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
gargantext
haskell-gargantext-prelude
Commits
175d4b29
Verified
Commit
175d4b29
authored
Mar 16, 2023
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[nlp] allow to specify NLP in ini files
parent
791c2a70
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
83 additions
and
6 deletions
+83
-6
gargantext-prelude.cabal
gargantext-prelude.cabal
+6
-3
package.yaml
package.yaml
+1
-0
Hash.hs
src/Gargantext/Prelude/Crypto/Hash.hs
+0
-1
Mail.hs
src/Gargantext/Prelude/Mail.hs
+1
-2
NLP.hs
src/Gargantext/Prelude/NLP.hs
+46
-0
Types.hs
src/Gargantext/Prelude/NLP/Types.hs
+29
-0
No files found.
gargantext-prelude.cabal
View file @
175d4b29
cabal-version: 1.12
-- This file has been generated from package.yaml by hpack version 0.34.
4
.
-- This file has been generated from package.yaml by hpack version 0.34.
7
.
--
-- see: https://github.com/sol/hpack
--
-- hash: 6d2d8c161ae59694c70216c31e6ac2cdb0f16397f06fd30a24d7098e86f268e8
name: gargantext-prelude
version: 0.1.0.0
...
...
@@ -40,6 +38,8 @@ library
Gargantext.Prelude.Fibonacci
Gargantext.Prelude.Mail
Gargantext.Prelude.Mail.Types
Gargantext.Prelude.NLP
Gargantext.Prelude.NLP.Types
Gargantext.Prelude.Utils
other-modules:
Paths_gargantext_prelude
...
...
@@ -81,6 +81,7 @@ library
, mime-mail
, mtl
, network
, network-uri
, password
, protolude
, qrcode-core
...
...
@@ -140,6 +141,7 @@ executable gargantext-prelude-exe
, mime-mail
, mtl
, network
, network-uri
, password
, protolude
, qrcode-core
...
...
@@ -200,6 +202,7 @@ test-suite gargantext-prelude-test
, mime-mail
, mtl
, network
, network-uri
, password
, protolude
, qrcode-core
...
...
package.yaml
View file @
175d4b29
...
...
@@ -43,6 +43,7 @@ dependencies:
-
mime-mail
-
mtl
-
network
-
network-uri
-
password
-
protolude
-
qrcode-core
...
...
src/Gargantext/Prelude/Crypto/Hash.hs
View file @
175d4b29
...
...
@@ -51,4 +51,3 @@ instance IsHashable (Set Hash) where
instance
{-# OVERLAPPABLE #-}
IsHashable
a
=>
IsHashable
[
a
]
where
hash
=
hash
.
Set
.
fromList
.
map
hash
src/Gargantext/Prelude/Mail.hs
View file @
175d4b29
{-|
Module : Gargantext.
Cor
e.Mail
Module : Gargantext.
Prelud
e.Mail
Description :
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
...
...
@@ -67,4 +67,3 @@ gargMail (MailConfig {..}) (GargMail { .. }) = do
to
=
[
Address
gm_name
gm_to
]
cc
=
[]
bcc
=
[]
src/Gargantext/Prelude/NLP.hs
0 → 100644
View file @
175d4b29
{-|
Module : Gargantext.Prelude.NLP
Description :
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
Maintainer : team@gargantext.org
Stability : experimental
Portability : POSIX
-}
module
Gargantext.Prelude.NLP
(
NLPConfig
(
..
),
readConfig
)
where
import
Data.Text
(
Text
,
unpack
)
import
qualified
Data.Text
as
T
import
Data.Maybe
import
Gargantext.Prelude
import
Gargantext.Prelude.Config
(
readIniFile'
,
val
)
import
Gargantext.Prelude.NLP.Types
(
NLPConfig
(
..
))
import
Network.URI
(
parseURI
)
import
System.IO
(
FilePath
)
type
URL
=
Text
readConfig
::
FilePath
->
IO
NLPConfig
readConfig
fp
=
do
ini
<-
readIniFile'
fp
let
val'
=
val
ini
"nlp"
let
m_nlp_en
=
parseURI
$
cs
$
val'
"EN"
let
m_nlp_fr
=
parseURI
$
cs
$
val'
"FR"
let
m_nlp_all
=
parseURI
$
cs
$
val'
"All"
let
mRet
=
NLPConfig
<$>
m_nlp_en
<*>
m_nlp_fr
<*>
m_nlp_all
case
mRet
of
Nothing
->
panic
$
T
.
concat
[
"Cannot read config file: _nlp_en = "
,
T
.
pack
$
show
m_nlp_en
,
", _nlp_fr = "
,
T
.
pack
$
show
m_nlp_fr
,
", _nlp_all = "
,
T
.
pack
$
show
m_nlp_all
]
Just
ret
->
pure
ret
src/Gargantext/Prelude/NLP/Types.hs
0 → 100644
View file @
175d4b29
{-|
Module : Gargantext.Prelude.NLP.Types
Description : Textmining Collaborative Platform
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
Maintainer : team@gargantext.org
Stability : experimental
Portability : POSIX
-}
{-# LANGUAGE TemplateHaskell #-}
module
Gargantext.Prelude.NLP.Types
where
import
Control.Lens
(
makeLenses
)
import
qualified
Data.Text
as
T
import
GHC.Generics
(
Generic
)
import
Network.Socket
(
PortNumber
)
import
Network.URI
(
URI
)
import
Protolude
data
NLPConfig
=
NLPConfig
{
_nlp_en
::
!
URI
,
_nlp_fr
::
!
URI
,
_nlp_all
::
!
URI
}
deriving
(
Generic
,
Show
)
makeLenses
''
N
LPConfig
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