Packages

Woolly is the text mining and natural language toolkit for the Elixir programming language.

Current section

Files

Jump to
woolly lib utils punctuation punctuation.ex
Raw

lib/utils/punctuation/punctuation.ex

defmodule Woolly.Utils.Punctuation do
@moduledoc ~S"""
Punctuation Remover
A module that removes punctuation from a sentence.
"""
def remove_punctuation(sent) do
punctuation = ~w{" ' ( ) [ ] : ; , . - ... ! ? |}
sent |> Enum.reject(fn(x) -> x in punctuation end)
end
end