From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.142.125.10 with SMTP id x10cs17990wfc; Tue, 7 Jun 2011 23:38:34 -0700 (PDT) Received: by 10.52.97.33 with SMTP id dx1mr356609vdb.34.1307515113348; Tue, 07 Jun 2011 23:38:33 -0700 (PDT) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id dy9si205484vdb.81.2011.06.07.23.38.32; Tue, 07 Jun 2011 23:38:32 -0700 (PDT) Received-SPF: pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-devel-bounces@rubyforge.org Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id DC8DA185838A for ; Wed, 8 Jun 2011 02:38:31 -0400 (EDT) Received: from masanjin.net (masanjin.net [209.20.72.13]) by rubyforge.org (Postfix) with ESMTP id DED401858387 for ; Wed, 8 Jun 2011 01:12:57 -0400 (EDT) Received: from w by masanjin.net with local (Exim 4.71) (envelope-from ) id 1QUBD7-00081N-Bd for sup-devel@rubyforge.org; Wed, 08 Jun 2011 05:21:45 +0000 From: William Morgan To: sup-devel In-reply-to: References: <201104251023.19659.hsanson@gmail.com> <1303793294-sup-688@masanjin.net> <1304052708-sup-4240@masanjin.net> <1304460745-sup-6241@masanjin.net> <1304527268-sup-7661@masanjin.net> Date: Wed, 08 Jun 2011 05:21:45 +0000 Message-Id: <1307509658-sup-6995@masanjin.net> User-Agent: Sup/git Subject: Re: [sup-devel] Cannot query Japanese characters X-BeenThere: sup-devel@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Sup developer discussion List-Id: Sup developer discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-devel-bounces@rubyforge.org Errors-To: sup-devel-bounces@rubyforge.org Reformatted excerpts from Horacio Sanson's message of 2011-05-06: > Great, let me know when you have the modifications so I can stress > test them. In the most recent version of Heliotrope, there are two hooks you can use to do this: transform-text and transform-query. To use them, place your Ruby code in files called /hooks/.rb. For transform-text, place your code in /hooks/transform-text.rb This hook will be called on any text added to the index. The 'text' variable will contain the text, and the hook should return (i.e. the last command should evaluate to) the transformed text. Example: $ cat store/hooks/transform-text.rb require 'MeCab' MeCab::Tagger.new("-Owakati").parse(text).gsub(/\s+/, " ") For transform-query, place your code in /hooks/transform-query.rb. This hook will be called on any query before it is executed. The 'query' variable will contain the query string, and the hook should return (i.e. the last command should evaluate to) the transformed query. Example: $ cat store/hooks/transform-query.rb require 'MeCab' MeCab::Tagger.new("-Owakati").parse(query).gsub(/\s+/, " ") Let me know if you have any problems with these hooks! -- William _______________________________________________ Sup-devel mailing list Sup-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-devel