Commit 34bcbffd authored by Alexandre Delanoë's avatar Alexandre Delanoë

[DEV] Flow + Main + cosmetics on Learn.

parent e923bba5
Pipeline #534 canceled with stage
......@@ -50,7 +50,7 @@ main = do
let
--tt = (Unsupervised EN 6 0 Nothing)
tt = (Multi EN)
format = CsvHalFormat --WOS -- CsvGargV3
format = CsvGargV3 -- CsvHalFormat --WOS
cmd :: forall m. FlowCmdM DevEnv GargError m => m CorpusId
cmd = flowCorpusFile (cs user) (Left (cs name :: Text)) (read limit :: Int) tt format corpusPath
{-
......
......@@ -195,12 +195,11 @@ flowCorpusUser l userName corpusName ctype ids = do
printDebug "userListId" userListId
-- User Graph Flow
_ <- mkTexts userCorpusId userId
--_ <- mkGraph userCorpusId userId
--_ <- mkPhylo userCorpusId userId
_ <- mkDashboard userCorpusId userId
_ <- mkGraph userCorpusId userId
_ <- mkPhylo userCorpusId userId
--}
-- User Dashboard Flow
--_ <- mkDashboard userCorpusId userId
-- Annuaire Flow
-- _ <- mkAnnuaire rootUserId userId
......
......@@ -9,10 +9,8 @@ Portability : POSIX
TODO:
- generalize to byteString
Stop words and (how to learn it).
Main type here is String.
- Stop words and (how to learn it).
- Main type here is String check if Chars on Text would be optimized
-}
......@@ -68,6 +66,19 @@ data CatWord a = CatWord a Word
type CatProb a = Map a Double
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
......@@ -174,20 +185,6 @@ toEvents e ns n = foldl' (opEvent (+)) (emptyEvent e ns n) . map (toEvent ns n)
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 ns n = wordToBook ns n " "
......
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