diff --git a/lib/sentient.ex b/lib/sentient.ex index 9b14f31..0ef96a3 100644 --- a/lib/sentient.ex +++ b/lib/sentient.ex @@ -1,3 +1,5 @@ +require IEx + defmodule Sentient do @afinn_source File.read!(__DIR__ <> "/../config/AFINN-111.json") |> Poison.Parser.parse! @@ -7,9 +9,11 @@ defmodule Sentient do |> Map.merge(override_words) phrase + |> String.replace(~r/\n/, "") |> Tokenizer.tokenize |> Enum.filter(&(afinn[&1])) |> Enum.map(&(afinn[&1])) - |> Enum.reduce(&(&1 + &2)) + |> Enum.reduce(0, &(&1 + &2)) + end end