Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean function does not work with multiple emoticons. #9

Open
steveanlorn opened this issue Jan 1, 2025 · 0 comments
Open

Clean function does not work with multiple emoticons. #9

steveanlorn opened this issue Jan 1, 2025 · 0 comments

Comments

@steveanlorn
Copy link

Hi my name is Steve and I am currently learning Elixir.
I stumbled upon this repository and decided to read the code to learn more about Elixir.

I tried to run the code with the following string:

iex(4)> Veritaserum.analyze("Hi I am filling😰 but my friend is😊", return: :score_and_marks)
{-1,
 [
   {:neutral, 0, "hi"},
   {:neutral, 0, "i"},
   {:neutral, 0, "am"},
   {:neutral, 0, "filling"},
   {:emoticon, -2, "😰"},
   {:neutral, 0, "but"},
   {:neutral, 0, "my"},
   {:word, 1, "friend"},
   {:neutral, 0, "is😊"}
 ]}

My assumption "is😊" should be separated from what it does with "filling😰".
If my assumption is correct, then this line of code should be fixed, with the following:

|> :binary.replace(Evaluator.emoticon_list(), "  ", [:global, insert_replaced: 1])

The updated code result:

iex(3)> Veritaserum.analyze("Hi I am filling😰 but my friend is😊", return: :score_and_marks)
{1,
 [
   {:neutral, 0, "hi"},
   {:neutral, 0, "i"},
   {:neutral, 0, "am"},
   {:neutral, 0, "filling"},
   {:emoticon, -2, "😰"},
   {:neutral, 0, "but"},
   {:neutral, 0, "my"},
   {:word, 1, "friend"},
   {:neutral, 0, "is"},
   {:emoticon, 2, "😊"}
 ]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant