Commit 180f49fe authored by Alexandre Delanoë's avatar Alexandre Delanoë

[ISSUE #104] adding language

parent 262a4e7d
Pipeline #2409 failed with stage
in 10 minutes and 54 seconds
......@@ -77,7 +77,7 @@ instance HasDBid Lang where
type Form = Text
type Lem = Text
------------------------------------------------------------------------
data PosTagAlgo = CoreNLP
data PosTagAlgo = CoreNLP | JohnSnowServer
deriving (Show, Read, Eq, Ord, Generic)
instance Hashable PosTagAlgo
......@@ -85,5 +85,6 @@ instance Hashable PosTagAlgo
instance HasDBid PosTagAlgo where
toDBid CoreNLP = 1
fromDBid 1 = CoreNLP
fromDBid 2 = JohnSnowServer
fromDBid _ = panic "HasDBid posTagAlgo : Not implemented"
......@@ -139,4 +139,13 @@ tokenWith f lang s = map (map (\t -> (_tokenWord t, f t)))
<$> _sentences
<$> corenlp lang s
----------------------------------------------------------------------------------
-- Here connect to the JohnSnow Server as it has been done above with the corenlp'
-- We need the PosTagging according to the language and the lems
serverNLP :: Lang -> Text -> IO PosSentences
serverNLP = undefined
......@@ -264,7 +264,8 @@ flowCorpusUser l user corpusName ctype ids mfslw = do
(masterUserId, _masterRootId, masterCorpusId)
<- getOrMk_RootWithCorpus (UserName userMaster) (Left "") ctype
--let gp = (GroupParams l 2 3 (StopSize 3))
--let gp = (GroupParams l 2 3 (StopSize 3))
-- Here the PosTagAlgo should be chosen according the Lang
let gp = GroupWithPosTag l CoreNLP HashMap.empty
ngs <- buildNgramsLists user userCorpusId masterCorpusId mfslw gp
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment