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
618f711a
Commit
618f711a
authored
Jan 16, 2024
by
Fabien Manière
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace _nlp_all with _nlp_default
parent
035036f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
6 deletions
+3
-6
NLP.hs
src/Gargantext/Prelude/NLP.hs
+2
-5
Types.hs
src/Gargantext/Prelude/NLP/Types.hs
+1
-1
No files found.
src/Gargantext/Prelude/NLP.hs
View file @
618f711a
...
@@ -31,20 +31,17 @@ readConfig :: FilePath -> IO NLPConfig
...
@@ -31,20 +31,17 @@ readConfig :: FilePath -> IO NLPConfig
readConfig
fp
=
do
readConfig
fp
=
do
ini
<-
readIniFile'
fp
ini
<-
readIniFile'
fp
let
val'
=
val
ini
iniSection
let
val'
=
val
ini
iniSection
let
lang_default_text
=
"EN"
-- Change this value by one of your choice: "All"
or "FR",
"EN"
let
lang_default_text
=
"EN"
-- Change this value by one of your choice: "All"
, "FR", or
"EN"
-- let m_nlp_all = parseURI $ cs $ val'
let
m_nlp_default
=
parseURI
$
cs
$
val'
lang_default_text
let
m_nlp_default
=
parseURI
$
cs
$
val'
lang_default_text
let
m_nlp_keys
=
filter
(
\
k
->
k
`
notElem
`
[
lang_default_text
])
$
fromRight
[]
$
Ini
.
keys
iniSection
ini
let
m_nlp_keys
=
filter
(
\
k
->
k
`
notElem
`
[
lang_default_text
])
$
fromRight
[]
$
Ini
.
keys
iniSection
ini
let
m_nlp_other
=
listToMaybeAll
$
(
\
k
->
(,)
k
<$>
(
parseURI
$
cs
$
val'
k
))
<$>
m_nlp_keys
let
m_nlp_other
=
listToMaybeAll
$
(
\
k
->
(,)
k
<$>
(
parseURI
$
cs
$
val'
k
))
<$>
m_nlp_keys
-- let mRet = NLPConfig <$> m_nlp_all <*> (Map.fromList <$> m_nlp_other)
let
mRet
=
NLPConfig
<$>
m_nlp_default
<*>
(
Map
.
fromList
<$>
m_nlp_other
)
let
mRet
=
NLPConfig
<$>
m_nlp_default
<*>
(
Map
.
fromList
<$>
m_nlp_other
)
case
mRet
of
case
mRet
of
Nothing
->
panicTrace
$
T
.
concat
[
"Cannot read config file: _nlp_all = "
Nothing
->
panicTrace
$
T
.
concat
[
"Cannot read config file: _nlp_default = "
-- , T.pack $ show m_nlp_all
,
T
.
pack
$
show
m_nlp_default
,
T
.
pack
$
show
m_nlp_default
,
", _nlp_other = "
,
", _nlp_other = "
,
T
.
pack
$
show
m_nlp_other
]
,
T
.
pack
$
show
m_nlp_other
]
...
...
src/Gargantext/Prelude/NLP/Types.hs
View file @
618f711a
...
@@ -21,7 +21,7 @@ import Network.Socket (PortNumber)
...
@@ -21,7 +21,7 @@ import Network.Socket (PortNumber)
import
Network.URI
(
URI
)
import
Network.URI
(
URI
)
import
Protolude
import
Protolude
data
NLPConfig
=
NLPConfig
{
_nlp_
all
::
URI
data
NLPConfig
=
NLPConfig
{
_nlp_
default
::
URI
,
_nlp_languages
::
(
Map
.
Map
T
.
Text
URI
)
}
,
_nlp_languages
::
(
Map
.
Map
T
.
Text
URI
)
}
deriving
(
Generic
,
Show
)
deriving
(
Generic
,
Show
)
...
...
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