You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Might be useful to allow the user to specify a regular expression for which to search the feature space. This should hopefully allow users to specify (almost?) any textual query they like even if it is not explicitly supported in Qurro.
Examples:
Given features k__Bacteria and k__Whackteria and k__Smackteria
k__(Bac|Whack)teria should match k__Bacteria and k__Whackteria but notk__Smackteria
k__.*teria should match all three
k__[^h]*teria should match k__Bacteria and k__Smackteria but notk__Whackteria
k__[\w]{5}teria should match k__Whackteria and k__Smackteria but notk__Bacteria
I think this could be done a couple ways - easiest might just be to add a dropdown option for regex filtering.
The text was updated successfully, but these errors were encountered:
Thanks for opening this! Agreed that this would be really useful. From doing some googling, it looks like it's actually not that bad to convert strings to regex objects in JavaScript:
So this should be surprisingly feasible -- the devil will probably be in the details, and making users aware of this. (The most foolproof solution is probably just linking the MDN docs on regular expressions from the selection tutorial, and just say "hey these will be slightly different from python/perl/etc., we recommend going over this".)
One thing I just thought of that might also be a wrinkle is unit testing. There are a lot of possibilities for user-input and it's probably not feasible to account for all of them.
That might be tricky, yeah. I think the main challenge will just be in testing that weird characters like backslashes are being interpreted correctly from the user's input; once that is guaranteed, actually just taking the resulting RegExp object and matching it against strings in the dataset shouldn't be too bad. (...Although I'm realizing now that we'll also have to account for what happens if the user passes in an invalid regular expression string -- for example, strings with unclosed operators like ( or [, either of which currently causes a JS SyntaxError when you try to create a RegExp object from it.)
Came up during discussion with @fedarko
Might be useful to allow the user to specify a regular expression for which to search the feature space. This should hopefully allow users to specify (almost?) any textual query they like even if it is not explicitly supported in Qurro.
Examples:
Given features
k__Bacteria
andk__Whackteria
andk__Smackteria
k__(Bac|Whack)teria
should matchk__Bacteria
andk__Whackteria
but notk__Smackteria
k__.*teria
should match all threek__[^h]*teria
should matchk__Bacteria
andk__Smackteria
but notk__Whackteria
k__[\w]{5}teria
should matchk__Whackteria
andk__Smackteria
but notk__Bacteria
I think this could be done a couple ways - easiest might just be to add a dropdown option for regex filtering.
The text was updated successfully, but these errors were encountered: