lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject svn commit: r1344962 - in /lucene/dev/branches/branch_4x: ./ dev-tools/ lucene/ lucene/analysis/ lucene/analysis/common/ lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/std31/ lucene/analysis/common/src/java/org/apache/lucene/analys...
Date Fri, 01 Jun 2012 01:30:58 GMT
Author: koji
Date: Fri Jun  1 01:30:56 2012
New Revision: 1344962

URL: http://svn.apache.org/viewvc?rev=1344962&view=rev
Log:
LUCENE-4091: add getter methods to FVH, part of LUCENE-3440

Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/dev-tools/   (props changed)
    lucene/dev/branches/branch_4x/lucene/   (props changed)
    lucene/dev/branches/branch_4x/lucene/CHANGES.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/LICENSE.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/analysis/   (props changed)
    lucene/dev/branches/branch_4x/lucene/analysis/common/   (props changed)
    lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/std31/package.html
  (props changed)
    lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/std34/package.html
  (props changed)
    lucene/dev/branches/branch_4x/lucene/backwards/   (props changed)
    lucene/dev/branches/branch_4x/lucene/build.xml   (props changed)
    lucene/dev/branches/branch_4x/lucene/common-build.xml   (props changed)
    lucene/dev/branches/branch_4x/lucene/core/   (props changed)
    lucene/dev/branches/branch_4x/lucene/facet/   (props changed)
    lucene/dev/branches/branch_4x/lucene/highlighter/   (props changed)
    lucene/dev/branches/branch_4x/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldFragList.java
    lucene/dev/branches/branch_4x/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldPhraseList.java
    lucene/dev/branches/branch_4x/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/ScoreOrderFragmentsBuilder.java
    lucene/dev/branches/branch_4x/lucene/memory/   (props changed)
    lucene/dev/branches/branch_4x/lucene/misc/   (props changed)
    lucene/dev/branches/branch_4x/lucene/site/   (props changed)
    lucene/dev/branches/branch_4x/lucene/test-framework/   (props changed)
    lucene/dev/branches/branch_4x/lucene/tools/   (props changed)
    lucene/dev/branches/branch_4x/solr/   (props changed)
    lucene/dev/branches/branch_4x/solr/CHANGES.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/common-build.xml   (props changed)
    lucene/dev/branches/branch_4x/solr/contrib/   (props changed)
    lucene/dev/branches/branch_4x/solr/core/   (props changed)
    lucene/dev/branches/branch_4x/solr/example/   (props changed)
    lucene/dev/branches/branch_4x/solr/lib/   (props changed)
    lucene/dev/branches/branch_4x/solr/lib/httpclient-LICENSE-ASL.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/lib/httpclient-NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/lib/httpcore-LICENSE-ASL.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/lib/httpcore-NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/lib/httpmime-LICENSE-ASL.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/lib/httpmime-NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/solrj/   (props changed)
    lucene/dev/branches/branch_4x/solr/test-framework/   (props changed)
    lucene/dev/branches/branch_4x/solr/testlogging.properties   (props changed)

Modified: lucene/dev/branches/branch_4x/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldFragList.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldFragList.java?rev=1344962&r1=1344961&r2=1344962&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldFragList.java
(original)
+++ lucene/dev/branches/branch_4x/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldFragList.java
Fri Jun  1 01:30:56 2012
@@ -61,19 +61,19 @@ public class FieldFragList {
 
   public static class WeightedFragInfo {
 
-    List<SubInfo> subInfos;
-    float totalBoost;
-    int startOffset;
-    int endOffset;
+    private List<SubInfo> subInfos;
+    private float totalBoost;
+    private int startOffset;
+    private int endOffset;
 
     public WeightedFragInfo( int startOffset, int endOffset, List<WeightedPhraseInfo>
phraseInfoList ){
       this.startOffset = startOffset;
       this.endOffset = endOffset;
       subInfos = new ArrayList<SubInfo>();
       for( WeightedPhraseInfo phraseInfo : phraseInfoList ){
-        SubInfo subInfo = new SubInfo( phraseInfo.text, phraseInfo.termsOffsets, phraseInfo.seqnum
);
+        SubInfo subInfo = new SubInfo( phraseInfo.getText(), phraseInfo.getTermsOffsets(),
phraseInfo.getSeqnum() );
         subInfos.add( subInfo );
-        totalBoost += phraseInfo.boost;
+        totalBoost += phraseInfo.getBoost();
       }
     }
     
@@ -104,12 +104,12 @@ public class FieldFragList {
     }
     
     public static class SubInfo {
-      final String text;  // unnecessary member, just exists for debugging purpose
-      final List<Toffs> termsOffsets;   // usually termsOffsets.size() == 1,
+      private final String text;  // unnecessary member, just exists for debugging purpose
+      private final List<Toffs> termsOffsets;   // usually termsOffsets.size() == 1,
                               // but if position-gap > 1 and slop > 0 then size() could
be greater than 1
-      int seqnum;
+      private int seqnum;
 
-      SubInfo( String text, List<Toffs> termsOffsets, int seqnum ){
+      public SubInfo( String text, List<Toffs> termsOffsets, int seqnum ){
         this.text = text;
         this.termsOffsets = termsOffsets;
         this.seqnum = seqnum;

Modified: lucene/dev/branches/branch_4x/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldPhraseList.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldPhraseList.java?rev=1344962&r1=1344961&r2=1344962&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldPhraseList.java
(original)
+++ lucene/dev/branches/branch_4x/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldPhraseList.java
Fri Jun  1 01:30:56 2012
@@ -97,7 +97,7 @@ public class FieldPhraseList {
     }
   }
   
-  void addIfNoOverlap( WeightedPhraseInfo wpi ){
+  public void addIfNoOverlap( WeightedPhraseInfo wpi ){
     for( WeightedPhraseInfo existWpi : phraseList ){
       if( existWpi.isOffsetOverlap( wpi ) ) return;
     }
@@ -106,19 +106,40 @@ public class FieldPhraseList {
   
   public static class WeightedPhraseInfo {
 
-    String text;  // unnecessary member, just exists for debugging purpose
-    List<Toffs> termsOffsets;   // usually termsOffsets.size() == 1,
+    private String text;  // unnecessary member, just exists for debugging purpose
+    private List<Toffs> termsOffsets;   // usually termsOffsets.size() == 1,
                             // but if position-gap > 1 and slop > 0 then size() could
be greater than 1
-    float boost;  // query boost
-    int seqnum;
+    private float boost;  // query boost
+    private int seqnum;
     
+    /**
+     * @return the text
+     */
+    public String getText() {
+      return text;
+    }
+
+    /**
+     * @return the termsOffsets
+     */
+    public List<Toffs> getTermsOffsets() {
+      return termsOffsets;
+    }
+
+    /**
+     * @return the boost
+     */
+    public float getBoost() {
+      return boost;
+    }
+
     public WeightedPhraseInfo( LinkedList<TermInfo> terms, float boost ){
       this( terms, boost, 0 );
     }
     
-    public WeightedPhraseInfo( LinkedList<TermInfo> terms, float boost, int number
){
+    public WeightedPhraseInfo( LinkedList<TermInfo> terms, float boost, int seqnum
){
       this.boost = boost;
-      this.seqnum = number;
+      this.seqnum = seqnum;
       termsOffsets = new ArrayList<Toffs>( terms.size() );
       TermInfo ti = terms.get( 0 );
       termsOffsets.add( new Toffs( ti.getStartOffset(), ti.getEndOffset() ) );
@@ -175,9 +196,16 @@ public class FieldPhraseList {
       return sb.toString();
     }
     
+    /**
+     * @return the seqnum
+     */
+    public int getSeqnum() {
+      return seqnum;
+    }
+
     public static class Toffs {
-      int startOffset;
-      int endOffset;
+      private int startOffset;
+      private int endOffset;
       public Toffs( int startOffset, int endOffset ){
         this.startOffset = startOffset;
         this.endOffset = endOffset;

Modified: lucene/dev/branches/branch_4x/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/ScoreOrderFragmentsBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/ScoreOrderFragmentsBuilder.java?rev=1344962&r1=1344961&r2=1344962&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/ScoreOrderFragmentsBuilder.java
(original)
+++ lucene/dev/branches/branch_4x/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/ScoreOrderFragmentsBuilder.java
Fri Jun  1 01:30:56 2012
@@ -65,12 +65,12 @@ public class ScoreOrderFragmentsBuilder 
   public static class ScoreComparator implements Comparator<WeightedFragInfo> {
 
     public int compare( WeightedFragInfo o1, WeightedFragInfo o2 ) {
-      if( o1.totalBoost > o2.totalBoost ) return -1;
-      else if( o1.totalBoost < o2.totalBoost ) return 1;
+      if( o1.getTotalBoost() > o2.getTotalBoost() ) return -1;
+      else if( o1.getTotalBoost() < o2.getTotalBoost() ) return 1;
       // if same score then check startOffset
       else{
-        if( o1.startOffset < o2.startOffset ) return -1;
-        else if( o1.startOffset > o2.startOffset ) return 1;
+        if( o1.getStartOffset() < o2.getStartOffset() ) return -1;
+        else if( o1.getStartOffset() > o2.getStartOffset() ) return 1;
       }
       return 0;
     }



Mime
View raw message