From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.90.117.16 with SMTP id p16cs279388agc; Mon, 19 Oct 2009 23:14:03 -0700 (PDT) Received: by 10.224.57.72 with SMTP id b8mr3073166qah.222.1256019243637; Mon, 19 Oct 2009 23:14:03 -0700 (PDT) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id 2si7298017qyk.77.2009.10.19.23.14.03; Mon, 19 Oct 2009 23:14:03 -0700 (PDT) Received-SPF: pass (google.com: domain of sup-talk-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-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-talk-bounces@rubyforge.org Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 6BDE018582DD; Tue, 20 Oct 2009 02:14:03 -0400 (EDT) Received: from pion.club.cc.cmu.edu (PION.CLUB.CC.cmu.edu [128.237.157.88]) by rubyforge.org (Postfix) with ESMTP id D3A9818582D0 for ; Tue, 20 Oct 2009 02:13:58 -0400 (EDT) Received: from rlane by pion.club.cc.cmu.edu with local (Exim 4.69) (envelope-from ) id 1N07yo-00074p-Gj for sup-talk@rubyforge.org; Tue, 20 Oct 2009 02:13:58 -0400 From: Rich Lane To: sup-talk In-reply-to: <1256016877-5238-1-git-send-email-rlane@club.cc.cmu.edu> References: <20091012223449.GB31940@tilus.net> <1256016877-5238-1-git-send-email-rlane@club.cc.cmu.edu> Date: Tue, 20 Oct 2009 02:13:58 -0400 Message-Id: <1256019034-sup-9298@zyrg.net> User-Agent: Sup/git Subject: Re: [sup-talk] [PATCH] xapian: replace DocumentMethods module with plain monkeypatching X-BeenThere: sup-talk@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: User & developer discussion of Sup 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-talk-bounces@rubyforge.org Errors-To: sup-talk-bounces@rubyforge.org Disregard this one. (I thought master had already gotten my update-message-state patch) Excerpts from Rich Lane's message of Tue Oct 20 01:34:37 -0400 2009: > --- > lib/sup/xapian_index.rb | 25 +++++++++++++++++++++++++ > 1 files changed, 25 insertions(+), 0 deletions(-) > > diff --git a/lib/sup/xapian_index.rb b/lib/sup/xapian_index.rb > index e1cfe65..c373c17 100644 > --- a/lib/sup/xapian_index.rb > +++ b/lib/sup/xapian_index.rb > @@ -560,7 +560,32 @@ EOS > raise "Invalid term type #{type}" > end > end > +end > > end > > +class Xapian::Document > + def entry > + Marshal.load data > + end > + > + def entry=(x) > + self.data = Marshal.dump x > + end > + > + def index_text text, prefix, weight=1 > + term_generator = Xapian::TermGenerator.new > + term_generator.stemmer = > Xapian::Stem.new(Redwood::XapianIndex::STEM_LANGUAGE) > + term_generator.document = self > + term_generator.index_text text, weight, prefix > + end > + > + alias old_add_term add_term > + def add_term term > + if term.length <= Redwood::XapianIndex::MAX_TERM_LENGTH > + old_add_term term > + else > + warn "dropping excessively long term #{term}" > + end > + end > end _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk