hidingmyname opened a new issue, #16823:
URL: https://github.com/apache/lucene/issues/16823

   ### Description
   
   **Location** (lucene @ main f94888d85c1): 
`lucene/analysis/common/src/java/org/apache/lucene/analysis/charfilter/package-info.java:34,
 :43`
   
   **Current text**
   ```
   addOffCorrectMapping()
   ```
   
   **Problem**: The method is `BaseCharFilter.addOffCorrectMap(int, int)`.
   
   **Suggested fix**: Replace both mentions with `addOffCorrectMap()`.
   
   ```diff
   --- 
a/lucene/analysis/common/src/java/org/apache/lucene/analysis/charfilter/package-info.java
   +++ 
b/lucene/analysis/common/src/java/org/apache/lucene/analysis/charfilter/package-info.java
   @@ -32,5 +32,5 @@
     * <p>When the replacement is shorter than the original (e.g. when the 
replacement is the empty
     * string), a single offset correction mapping should be added at the 
replacement's end offset in
   - * the output stream. The <code>cumulativeDiff</code> parameter to the 
<code>addOffCorrectMapping()
   + * the output stream. The <code>cumulativeDiff</code> parameter to the 
<code>addOffCorrectMap()
     * </code> method will be the sum of all previous replacement offset 
adjustments, with the addition
     * of the difference between the lengths of the original substring and the 
replacement string (a
   @@ -41,5 +41,5 @@
     * replacement string and the original substring, starting at the end 
offset the original substring
     * would have had in the output stream. The <code>cumulativeDiff</code> 
parameter to the <code>
   - * addOffCorrectMapping()</code> method will be the sum of all previous 
replacement offset
   + * addOffCorrectMap()</code> method will be the sum of all previous 
replacement offset
     * adjustments, with the addition of the difference between the lengths of 
the original substring
     * and the replacement string so far (a negative value).
   ```
   
   **Already fixed in Lucene.NET**: apache/lucenenet@bffd9b066
   
   **How Lucene.NET fixed it**: commit `bffd9b066f3` (2021-03-28) "docs: 
Lucene.Net.Analysis.Common: Fixed broken formatting and links (see #284, 
#300)", file `src/Lucene.Net.Analysis.Common/Analysis/CharFilter/package.md`
   
   ```diff
   @@ -24,10 +24,10 @@ summary: *content
    
     CharFilters are chainable filters that normalize text before tokenization 
and provide mappings between normalized text offsets and the corresponding 
offset in the original text. 
    
   -<h2>CharFilter offset mappings</h2>
   +## CharFilter offset mappings
    
     CharFilters modify an input stream via a series of substring replacements 
(including deletions and insertions) to produce an output stream. There are 
three possible replacement cases: the replacement string has the same length as 
the original substring; the replacement is shorter; and the replacement is 
longer. In the latter two cases (when the replacement has a different length 
than the original), one or more offset correction mappings are required. 
    
   - When the replacement is shorter than the original (e.g. when the 
replacement is the empty string), a single offset correction mapping should be 
added at the replacement's end offset in the output stream. The 
`cumulativeDiff` parameter to the `addOffCorrectMapping()` method will be the 
sum of all previous replacement offset adjustments, with the addition of the 
difference between the lengths of the original substring and the replacement 
string (a positive value). 
   + When the replacement is shorter than the original (e.g. when the 
replacement is the empty string), a single offset correction mapping should be 
added at the replacement's end offset in the output stream. The 
`cumulativeDiff` parameter to the `AddOffCorrectMap()` method will be the sum 
of all previous replacement offset adjustments, with the addition of the 
difference between the lengths of the original substring and the replacement 
string (a positive value). 
    
   - When the replacement is longer than the original (e.g. when the original 
is the empty string), you should add as many offset correction mappings as the 
difference between the lengths of the replacement string and the original 
substring, starting at the end offset the original substring would have had in 
the output stream. The `cumulativeDiff` parameter to the 
`addOffCorrectMapping()` method will be the sum of all previous replacement 
offset adjustments, with the addition of the difference between the lengths of 
the original substring and the replacement string so far (a negative value). 
   \ No newline at end of file
   + When the replacement is longer than the original (e.g. when the original 
is the empty string), you should add as many offset correction mappings as the 
difference between the lengths of the replacement string and the original 
substring, starting at the end offset the original substring would have had in 
the output stream. The `cumulativeDiff` parameter to the `AddOffCorrectMap()` 
method will be the sum of all previous replacement offset adjustments, with the 
addition of the difference between the lengths of the original substring and 
the replacement string so far (a negative value). 
   \ No newline at end of file
   ```
   
   I can submit a PR for this.
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to