lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From escher2k <esche...@yahoo.com>
Subject Re: Modifying norms...
Date Mon, 30 Apr 2007 23:37:36 GMT

Thanks Hoss. Suppose, I go ahead and modify Similarity.java from 
static {
    for (int i = 0; i < 256; i++)
      NORM_TABLE[i] = SmallFloat.byte315ToFloat((byte)i);
  }
TO
static {
    for (int i = 0; i < 256; i++)
      NORM_TABLE[i] = (float) i  * 100.0 /256.0;
  } 

Should this work ?

Thanks.

P.S. This is a very custom implementation. For the specific problem that I
have, the lengthNorm
is set to 1 (independent of numTerms). 


Chris Hostetter wrote:
> 
> 
> : I want to modify the norms to only include values between 0 and 100.
> : Currently, I have a custom implementation of the default similarity. Is
> it
> : sufficient to override the encodeNorm and decodeNorm methods from the
> base
> : implementation in my custom Similarity class ? Please let me know if
> there
> : are any performance implications to this.
> 
> those methods are static, so it's not possible to override them.  if you
> are not using doc or field boosts, overriding lengthNorm is suitable for
> your goal.
> 
> -Hoss
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Modifying-norms...-tf3671499.html#a10262494
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message