dsmiley commented on a change in pull request #1123: LUCENE-9093: Unified 
highlighter with word separator never gives context to the left
URL: https://github.com/apache/lucene-solr/pull/1123#discussion_r361374225
 
 

 ##########
 File path: 
lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/LengthGoalBreakIterator.java
 ##########
 @@ -33,23 +33,32 @@
 
   private final BreakIterator baseIter;
   private final int lengthGoal;
+  private final float fragmentAlignment; // how much text to align before 
match-fragment, valid in range [0, 1]
   private final boolean isMinimumLength; // if false then is "closest to" 
length
+  private int fragmentEndFromPreceding; // store the match-break end for reuse 
in following()
+  private int fragmentEndFollowingLengthGoalFromPreceding; // store the 
remaining length to collect in following()
 
   /** Breaks will be at least {@code minLength} apart (to the extent 
possible). */
-  public static LengthGoalBreakIterator createMinLength(BreakIterator 
baseIter, int minLength) {
-    return new LengthGoalBreakIterator(baseIter, minLength, true);
+  public static LengthGoalBreakIterator createMinLength(BreakIterator 
baseIter, int minLength,
 
 Review comment:
   I propose adding a deprecated version of the current method with 0f for 
back-compat.   Solr won't use it but others out there might.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to