logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://anongit.hacktivis.me/git/pleroma.git/
commit: 17d885fed87ede236488e80552b9ee9557001e19
parent 80dbbd5501a0665656aadc3b76f3db7d1da9becb
Author: marcin mikołajczak <git@mkljczk.pl>
Date:   Sat,  5 Nov 2022 20:16:32 +0100

Fix fasttext for multiline posts

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>

Diffstat:

Mlib/pleroma/language/language_detector/fasttext.ex2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/pleroma/language/language_detector/fasttext.ex b/lib/pleroma/language/language_detector/fasttext.ex @@ -25,7 +25,7 @@ defmodule Pleroma.Language.LanguageDetector.Fasttext do def detect(text) do text_path = Path.join(System.tmp_dir!(), "fasttext-#{Ecto.UUID.generate()}") - File.write(text_path, text) + File.write(text_path, text |> String.replace(~r/\s+/, " ")) detected_language = case System.cmd("fasttext", ["predict", get_model(), text_path]) do