length of string javascript
https://duckduckgo.com/?q=length%20of%20string%20javascript
_Comment: The answer is incorrect._
IA Page: http://duck.co/ia/view/chars
Maintainer: @mahi30795
@bsstoner is it a good idea if we have a regex checking if string is a programming language and exiting in such a case? Or do you have a better(more generic) fix idea?
That's a good question. I'm not sure if we've encountered this elsewhere in any of the open source IA's. @moollaza @pjhampton any ideas?
I know we have this issue with maps (e.g. "perl map"). We were considering ways to solve that internally but maybe there's a general programming false positive solution. Open to ideas here.
@nalinbhardwaj @bsstoner
To be honest, I'm kinda confused what the feedback means.
The answer is incorrect.
length of string is a trigger sequence for Character Count IA. See https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/Chars.pm#L17
"javascript" = 10 chars, so this answer is correct if the trigger sequence length of string is reasonable.
If they are referring to https://duck.co/ia/view/mdnjs which shows up on the about tab, then I can see their point - but this answer is still correct. String.prototype.length isn't very helpful when what you want is length("javascript") => 10. This is something we can make more helpful.
@bsstoner -- When a user submits their feedback through the SERP does it record the IA tab they have open? Or does it record feedback against whatever had the higher priority?
@pjhampton I think the user expected the fathead query answer but referenced the _wrong_ goodie answer. I think this is a relevancy issue. The fathead here would have provided a more relevant result than the goodie, which they expected to be the default tab.
@pjhampton yes, they had the answer IA open. You're right, the answer itself is correct. But in terms of serving the user's intent, it is not correct. They were expecting something programming related to be shown by default here.
@moollaza and I chatted about this on our weekly call. I'm not sure handling exceptions with regexs is a scalable/maintainable idea.
@bsstoner Lowering the priority of the Char IA might be the easiest / most effective idea. Does data exist for how many times others IAs have triggered alongside this one (and what they are)?
@pjhampton I was wrong about changing the priority, it looks like we only have a low priority block for Spice IA's, it's been a while since I used the priorities, so I thought we had that for Goodies as well.
@bsstoner you mentioned we shouldn't set Goodies to signal: 'high', but is it OK to set it to low?
@moollaza set it to low all the time? Or just in specific cases? I think if it's always low it will never open.
I think if it's always low it will never open.
Ah, alright. An internal low-priority Goodie block might help for IA's like these that are capable of producing unexpected results (e.g. md5, reverse, string length)
I don't have a better solution right now aside from a stricter trigger.
We should probably force this IA to a start trigger as well to prevent triggering on queries like: "c# trim string with custom chars"
So what are we trying to achieve here? Ignoring programming languages in the query so the user is not confused when asking about something technical in that programming language? Like: "length of string in javascript" so the user was searching about how to find the length of a string in javascript and not the string "javascript" ?
Closed in favour of https://github.com/duckduckgo/zeroclickinfo-goodies/issues/4028