diff --git a/src/packages/text_search.gleam b/src/packages/text_search.gleam index b960d3b..9c4e329 100644 --- a/src/packages/text_search.gleam +++ b/src/packages/text_search.gleam @@ -64,6 +64,11 @@ fn remove(index: TextSearchIndex, name: String) -> Result(Nil, Error) { fn stem_words(phrase: String) -> List(String) { phrase + |> string.replace(",", " ") + |> string.replace(".", " ") + |> string.replace("!", " ") + |> string.replace("/", " ") + |> string.replace("'", "") |> string.split(" ") |> list.filter(fn(word) { word != "" }) |> list.map(porter_stemmer.stem)