Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

13
LINES

< > BotCompany Repo | #1001930 // feedbackScore - parse NL feedback

JavaX fragment (include)

static int feedbackScore(S s) {
  s = dropWords(s, "bot");
  s = dropPunctuation(s);
  L<S> tok = nlTok(s);
  if (l(tok) != 3) ret 0;
  S word = tok.get(1).toLowerCase();
  word = collapseWord(word);
  if (litlist("nice", "god" /* matches both "god" and "good" :) */, "ok", "corect", "right", "true", "yes", "col" /* cool */).contains(word))
    ret 1;
  if (litlist("no", "wrong", "bad").contains(word))
    ret -1;
  ret 0;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1001930
Snippet name: feedbackScore - parse NL feedback
Eternal ID of this version: #1001930/1
Text MD5: 21f35221efc43e91741b70d28a2724c3
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-12-08 18:03:56
Source code size: 439 bytes / 13 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 565 / 1117
Referenced in: [show references]