On Fri, May 29, 2009 at 11:47:47AM +0200, Peter Maas wrote: > The next step would be to add stemming, not to hard either (have a > working prototype already). This does however present me with a new > problem. I'd like to stem the provided keys in the REST parameters using > the same stemmer used by the mapping code. Is there a way to process the > parameters passed to a REST view within CouchDB? Or would I need to > duplicate (port) the stemmer in the clients (which are various in various > languages)?
I'm afraid the latter. I have quite a bit of logic duplicated between Javascript and Ruby (e.g. parsing of IP addresses) To make this sane, I put the source code side-by-side, and I use the same unit tests for both: that is, I write out the test values as docs and then shove out the Javascript as part of a temp_view, and check what comes back.
