[refactor] intercalate " " -> unwords

parent 7d777a10
Pipeline #5861 failed with stages
in 127 minutes and 58 seconds
......@@ -66,7 +66,7 @@ class Collage sup inf where
instance Collage Texte Paragraphe where
dec (Texte t) = map Paragraphe $ DT.splitOn "\n" t
inc = Texte . DT.intercalate "\n" . map (\(Paragraphe t) -> t)
inc = Texte . DT.unlines . map (\(Paragraphe t) -> t)
instance Collage Paragraphe Phrase where
dec (Paragraphe t) = map Phrase $ sentences t
......@@ -78,7 +78,7 @@ instance Collage Phrase MultiTerme where
instance Collage MultiTerme Mot where
dec (MultiTerme mt) = map Mot $ DT.words mt
inc = MultiTerme . DT.intercalate " " . map (\(Mot m) -> m)
inc = MultiTerme . DT.unwords . map (\(Mot m) -> m)
-------------------------------------------------------------------
-- Contexts of text
......@@ -92,7 +92,7 @@ isCharStop :: Char -> Bool
isCharStop c = c `elem` ['.','?','!']
unsentences :: [Text] -> Text
unsentences txts = DT.intercalate " " txts
unsentences txts = DT.unwords txts
-- | Ngrams size
size :: Text -> Int
......
......@@ -71,7 +71,7 @@ isidoreToDoc lang (IsidoreDoc t a d u s as) = do
langText :: LangText -> Text
langText (LangText _l t1) = t1
langText (OnlyText t2 ) = t2
langText (ArrayText ts ) = Text.intercalate " " $ map langText ts
langText (ArrayText ts ) = Text.unwords $ map langText ts
let mDateS = maybe (Just $ Text.pack $ show Defaults.year) Just d
let (utcTime, (pub_year, pub_month, pub_day)) = Date.mDateSplit mDateS
......
......@@ -247,7 +247,7 @@ text2titleParagraphs n = catMaybes
n' = n + (round $ (fromIntegral n) / (2 :: Double))
doTitle :: [Text] -> Maybe (Text, Text)
doTitle (t:ts) = Just (t, DT.intercalate " " ts)
doTitle (t:ts) = Just (t, DT.unwords ts)
doTitle [] = Nothing
......
......@@ -70,7 +70,7 @@ groupWith :: GroupParams
groupWith GroupIdentity t = identity t
groupWith (GroupParams { unGroupParams_lang = l }) t =
NgramsTerm
$ Text.intercalate " "
$ Text.unwords
$ map (stem l PorterAlgorithm)
-- . take n
$ List.sort
......
......@@ -50,7 +50,7 @@ data Paragraph = Uniform Grain | AuthorLike
-- Grain: number of Sentences by block of Text
-- Step : overlap of sentence between connex block of Text
groupUniform :: Grain -> [Text] -> [Text]
groupUniform g ts = map (Text.intercalate " ")
groupUniform g ts = map Text.unwords
$ chunkAlong g g
$ sentences
$ Text.concat ts
......
......@@ -87,7 +87,7 @@ extractTerms ncs (Unsupervised {..}) xs = mapM (terms ncs (Unsupervised { _tt_mo
where
m' = case _tt_model of
Just m''-> m''
Nothing -> newTries _tt_windowSize (Text.intercalate " " xs)
Nothing -> newTries _tt_windowSize (Text.unwords xs)
extractTerms ncs termTypeLang xs = mapM (terms ncs termTypeLang) xs
......
......@@ -151,6 +151,6 @@ instance ToHyperdataRow HyperdataContact where
toHyperdataRow (HyperdataContact { _hc_who = Just (ContactWho _ fn ln _ _ _), _hc_where = ou} ) =
HyperdataRowContact (fromMaybe "FirstName" fn) (fromMaybe "LastName" ln) ou'
where
ou' = maybe "CNRS" (Text.intercalate " " . _cw_organization) (head ou)
ou' = maybe "CNRS" (Text.unwords . _cw_organization) (head ou)
toHyperdataRow (HyperdataContact {}) =
HyperdataRowContact "FirstName" "LastName" "Labs"
......@@ -119,14 +119,14 @@ cooc2graphWith' _doPartitions _bridgenessMethod multi similarity threshold stren
partitions <- if (Map.size distanceMap > 0)
then recursiveClustering' (spinglass' 1) distanceMap
else panic $ Text.intercalate " " [ "I can not compute the graph you request"
, "because either the quantity of documents"
, "or the quantity of terms"
, "are lacking."
, "Solution: add more either Documents or Map Terms to your analysis."
, "Follow the available tutorials on the Training EcoSystems."
, "Ask your co-users of GarganText how to have access to it."
]
else panic $ Text.unwords [ "I can not compute the graph you request"
, "because either the quantity of documents"
, "or the quantity of terms"
, "are lacking."
, "Solution: add more either Documents or Map Terms to your analysis."
, "Follow the available tutorials on the Training EcoSystems."
, "Ask your co-users of GarganText how to have access to it."
]
length partitions `seq` pure ()
let
......
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