superscript-editor icon indicating copy to clipboard operation
superscript-editor copied to clipboard

Question matching bug

Open mariusursache opened this issue 10 years ago • 3 comments

From #14:

Question trigger works for "Any question" and has an interesting way of defining what a question is. "What is this" triggers it even without a question mark at the end. "Really?" is not considered a question. "How are you?" does not trigger it though...

This is indeed a bug. I went back and forth between building a bayes classifier and using rules. I found I could get better results with a rule based approach, but as you can tell it is not perfect. Take a peek at https://github.com/silentrob/qtypes (https://github.com/silentrob/qtypes/blob/master/lib/ruleClassify.js#L302-L321) to see how that works under the hood.

I think that maybe adding an extra rule that considers any trigger ending in ? as a question could solve the problem temporarily. So questions are all triggers matching the qtype rules, plus everything ending in ?.

mariusursache avatar May 19 '15 14:05 mariusursache

Interesting, so this is happening further up the stack.

var ra = require("../lib/ruleClassify.js");

new ra(function(q) {
  console.log(q.isQuestion("Really?")); 
  // true
  console.log(q.isQuestion("How are you?"));
  // true
});

silentrob avatar May 21 '15 07:05 silentrob

This is a caee where normalizer is being a little to greedy. Investigating further.

silentrob avatar May 21 '15 08:05 silentrob

Any updates on this? Also, how can I specify in the editor the answer types, could not get it to work... :-(

mariusursache avatar Jun 15 '15 17:06 mariusursache