@@ -0,0 +1,2266 @@
+package com.github.bot.curiosone.core.analysis;%0A%0Aimport static org.assertj.core.api.Assertions.assertThat;%0A%0Aimport com.github.bot.curiosone.core.nlp.Token;%0A%0Aimport java.util.List;%0A%0Aimport org.junit.Test;%0A%0Apublic class TokenScorerTest %7B%0A%0A  @Test%0A  public void testCalculateScoreSingleToken() %7B%0A    TokenScorer ts = new TokenScorer();%0A    List%3CToken%3E lt = Token.tokenize(%22The cat is on the car and the dog is on the table.%22);%0A    Token t = Token.tokenize(%22I am happy%22).get(2);%0A%0A    assertThat(ts.calculateScore(t)).isEqualTo(0.5625);%0A%0A    t = lt.get(1);%0A    assertThat(ts.calculateScore(t)).isEqualTo(-0.0125);%0A%0A    t = lt.get(5);%0A    assertThat(ts.calculateScore(t)).isEqualTo(0.0);%0A%0A    t = lt.get(9);%0A    assertThat(ts.calculateScore(t)).isEqualTo(0.0);%0A%0A    lt = Token.tokenize(%22Watch your mouth! Speak politely! None should be emotionally upset!%22);%0A    t = lt.get(0);%0A    assertThat(ts.calculateScore(t)).isEqualTo(0.057692307692307696);%0A%0A    t = lt.get(2);%0A    assertThat(ts.calculateScore(t)).isEqualTo(0.0);%0A%0A    t = lt.get(3);%0A    assertThat(ts.calculateScore(t)).isEqualTo(0.0);%0A%0A    t = lt.get(4);%0A    assertThat(ts.calculateScore(t)).isEqualTo(0.125);%0A%0A    t = lt.get(5);%0A    assertThat(ts.calculateScore(t)).isEqualTo(-0.28125);%0A%0A    t = lt.get(8);%0A    assertThat(ts.calculateScore(t)).isEqualTo(0.0625);%0A%0A    t = lt.get(9);%0A    assertThat(ts.calculateScore(t)).isEqualTo(-0.23529411764705882);%0A  %7D%0A%0A  @Test%0A  public void testCalculateScoreListToken() %7B%0A    TokenScorer ts = new TokenScorer();%0A    List%3CToken%3E lt = Token.tokenize(%22I am very happy today!%22);%0A    assertThat(ts.calculateScore(lt)).isGreaterThan(0.0);%0A%0A    lt = Token.tokenize(%22I am very happy today! I feel ok.%22);%0A    assertThat(ts.calculateScore(lt)).isGreaterThan(0.0);%0A%0A    lt = Token.tokenize(%22I am very happy today! I feel ok. Happiness is crucial for peace of mind%22);%0A    assertThat(ts.calculateScore(lt)).isGreaterThan(0.0);%0A%0A    lt = Token.tokenize(%22Let's go negative, down down down negative negative score%22);%0A    assertThat(ts.calculateScore(lt)).isLessThan(0.0);%0A%0A    lt = Token.tokenize(%22That's a sad story :(%22);%0A    assertThat(ts.calculateScore(lt)).isLessThan(0.0);%0A%0A    lt = Token.tokenize(%22Microfossil curbstone%22);%0A    assertThat(ts.calculateScore(lt)).isEqualTo(0.0);%0A  %7D%0A%7D%0A

add TokenScorerTest