On Mar 28, 2016 3:01 PM, "Olly Betts" <olly at survex.com> wrote:> That's where a new command needs to be hooked up, but in this case I'd > put the actual implementation into transform.cc alongside the > implementation of $transform - then it can share $transform's regex > cache (which avoids recompiling a regex if it's used multiple times, > either explicitly or in something like $hitlist which gets evaluated > multiple times). >Yes, that would be a much better way of hooking up the function since the regex cache doesn't need to be created again.> It would be useful to also support an optional flags argument, like > $transform does. Then the user can do things like a case insensitive > match. >Oh yes I'm sorry I forgot to mention this. We can use the options provided by the pcre library to let the user modify functionality accordingly.> Isn't that backwards? >That's the way I thought it could be done looking at the way $transform has been written. If there is any other way, do guide me through that. Can I start with trying to implement this? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xapian.org/pipermail/xapian-devel/attachments/20160329/4522635a/attachment.html>
On Tue, Mar 29, 2016 at 10:12:54AM +0530, Richhiey Thomas wrote:> On Mar 28, 2016 3:01 PM, "Olly Betts" <olly at survex.com> wrote: > > Isn't that backwards? > > That's the way I thought it could be done looking at the way $transform has > been written. If there is any other way, do guide me through that.I mean you seem to have true and false reversed: | 3. Then using pcre library, we check for a regex match using | pcre_exec( ) and if the value it returns is lesser than or equal to | zero, return true or else return false. pcre_exec() returning <= 0 means "didn't match" (or there was an error).> Can I start with trying to implement this?Sure - there's really no need to ask permission to work on something. Cheers, Olly
On Tue, Mar 29, 2016 at 06:20:21AM +0100, Olly Betts wrote:> > Can I start with trying to implement this? > > Sure - there's really no need to ask permission to work on something.It's probably helpful to create a ticket and claim it (and update the project ideas list to link to it), so other people don't try to work on it as well. (I have a feeling that it might have been among the things Nirmal was looking at, but I'm not sure what the state of that was.) This is mentioned in our draft developer guide (https://xapian-developer-guide.readthedocs.org/en/latest/contributing/new-contributors.html#picking-something-to-start-with), but that's a very recent thing so I don't expect anyone to have actually found it by themselves. (I strongly recommend reading through it, along with xapian-core/HACKING, as there are some useful tips that will help you get your work ready for review and merge.) J -- James Aylett, occasional trouble-maker xapian.org