Skip to content

Commit

Permalink
Merge branch 'master' into issue/832
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirwin authored Jan 21, 2025
2 parents 81d36cb + ab73b08 commit f910628
Show file tree
Hide file tree
Showing 389 changed files with 1,254 additions and 1,618 deletions.
11 changes: 8 additions & 3 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
<!-- Features in .NET Core 3.x, .NET 5.x, .NET 6.x, .NET 7.x, .NET 8.x, and .NET 9.x only -->
<PropertyGroup Condition=" $(TargetFramework.StartsWith('netcoreapp3.')) Or $(TargetFramework.StartsWith('net5.')) Or $(TargetFramework.StartsWith('net6.')) Or $(TargetFramework.StartsWith('net7.')) Or $(TargetFramework.StartsWith('net8.')) Or $(TargetFramework.StartsWith('net9.')) ">

<DefineConstants>$(DefineConstants);FEATURE_ARGITERATOR</DefineConstants>
<DefineConstants>$(DefineConstants);FEATURE_PROCESS_KILL_ENTIREPROCESSTREE</DefineConstants>
<DefineConstants>$(DefineConstants);FEATURE_STRING_CONCAT_READONLYSPAN</DefineConstants>

Expand All @@ -80,7 +79,7 @@
<DebugType>portable</DebugType>
</PropertyGroup>

<!-- Features in .NET Standard 2.1, .NET 5.x, .NET 6.x, .NET 7.x, .NET 8.x, and .NET 9.x only -->
<!-- Features in .NET Standard 2.1, .NET Core 3.x, .NET 5.x, .NET 6.x, .NET 7.x, .NET 8.x, and .NET 9.x only -->
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.1' Or $(TargetFramework.StartsWith('netcoreapp3.')) Or $(TargetFramework.StartsWith('net5.')) Or $(TargetFramework.StartsWith('net6.')) Or $(TargetFramework.StartsWith('net7.')) Or $(TargetFramework.StartsWith('net8.')) Or $(TargetFramework.StartsWith('net9.')) ">

<DefineConstants>$(DefineConstants);FEATURE_ARRAY_FILL</DefineConstants>
Expand All @@ -93,6 +92,13 @@

</PropertyGroup>

<!-- Features in .NET Standard 2.1, .NET Core 2.1-2.2, .NET Core 3.x, .NET 5.x, .NET 6.x, .NET 7.x, .NET 8.x, and .NET 9.x only -->
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.1' Or '$(TargetFramework)' == 'netcoreapp2.1' Or '$(TargetFramework)' == 'netcoreapp2.2' Or $(TargetFramework.StartsWith('netcoreapp3.')) Or $(TargetFramework.StartsWith('net5.')) Or $(TargetFramework.StartsWith('net6.')) Or $(TargetFramework.StartsWith('net7.')) Or $(TargetFramework.StartsWith('net8.')) Or $(TargetFramework.StartsWith('net9.')) ">

<DefineConstants>$(DefineConstants);FEATURE_STRING_CONTAINS_STRINGCOMPARISON</DefineConstants>

</PropertyGroup>

<!-- Features in .NET Standard 2.x, .NET Core 2.x, .NET Core 3.x, .NET 5.x, .NET 6.x, .NET 7.x, .NET 8.x, and .NET 9.x -->
<PropertyGroup Condition=" $(TargetFramework.StartsWith('netstandard2.')) Or $(TargetFramework.StartsWith('netcoreapp2.')) Or $(TargetFramework.StartsWith('netcoreapp3.')) Or $(TargetFramework.StartsWith('net5.')) Or $(TargetFramework.StartsWith('net6.')) Or $(TargetFramework.StartsWith('net7.')) Or $(TargetFramework.StartsWith('net8.')) Or $(TargetFramework.StartsWith('net9.')) ">

Expand Down Expand Up @@ -137,7 +143,6 @@
<PropertyGroup Condition="$(TargetFramework.StartsWith('net4'))">

<DefineConstants>$(DefineConstants);NETFRAMEWORK</DefineConstants>
<DefineConstants>$(DefineConstants);FEATURE_ARGITERATOR</DefineConstants>
<!-- Although code access security is available in .NET Standard 2.0+ via platform extensions, we are excluding
it due to the fact it is not a primary feature of Lucene.NET and it is supported in .NET Framework -->
<DefineConstants>$(DefineConstants);FEATURE_CODE_ACCESS_SECURITY</DefineConstants>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ namespace Lucene.Net.Analysis.Br
*/

/// <summary>
/// <see cref="Analyzer"/> for Brazilian Portuguese language.
/// <see cref="Analyzer"/> for Brazilian Portuguese language.
/// <para>
/// Supports an external list of stopwords (words that
/// will not be indexed at all) and an external list of exclusions (words that will
/// not be stemmed, but indexed).
/// </para>
///
///
/// <para><b>NOTE</b>: This class uses the same <see cref="LuceneVersion"/>
/// dependent settings as <see cref="StandardAnalyzer"/>.</para>
/// </summary>
Expand Down Expand Up @@ -77,7 +77,7 @@ private static CharArraySet LoadDefaultStopSet() // LUCENENET: Avoid static cons
/// <summary>
/// Contains words that should be indexed but not stemmed.
/// </summary>
private CharArraySet excltable = CharArraySet.Empty;
private readonly CharArraySet excltable = CharArraySet.Empty; // LUCENENET: marked readonly

/// <summary>
/// Builds an analyzer with the default stop words (<see cref="DefaultStopSet"/>).
Expand Down Expand Up @@ -135,4 +135,4 @@ protected internal override TokenStreamComponents CreateComponents(string fieldN
return new TokenStreamComponents(source, new BrazilianStemFilter(result));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30792,19 +30792,19 @@ CharArrayDictionary<char> result
private static readonly char STYLE_REPLACEMENT = '\n';
private static readonly char REPLACEMENT_CHARACTER = '\uFFFD';

private CharArraySet escapedTags = null;
private readonly CharArraySet escapedTags = null; // LUCENENET: marked readonly
private int inputStart;
private int cumulativeDiff;
private bool escapeBR = false;
private bool escapeSCRIPT = false;
private bool escapeSTYLE = false;
private readonly bool escapeBR = false; // LUCENENET: marked readonly
private readonly bool escapeSCRIPT = false; // LUCENENET: marked readonly
private readonly bool escapeSTYLE = false; // LUCENENET: marked readonly
private int restoreState;
private int previousRestoreState;
private int outputCharCount;
private int eofReturnValue;
private TextSegment inputSegment = new TextSegment(INITIAL_INPUT_SEGMENT_SIZE);
private readonly TextSegment inputSegment = new TextSegment(INITIAL_INPUT_SEGMENT_SIZE); // LUCENENET: marked readonly
private TextSegment outputSegment;
private TextSegment entitySegment = new TextSegment(2);
private readonly TextSegment entitySegment = new TextSegment(2); // LUCENENET: marked readonly

/// <summary>
/// Creates a new HTMLStripCharFilter over the provided TextReader.
Expand Down
8 changes: 4 additions & 4 deletions src/Lucene.Net.Analysis.Common/Analysis/Cjk/CJKWidthFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ namespace Lucene.Net.Analysis.Cjk
/// </summary>
public sealed class CJKWidthFilter : TokenFilter
{
private ICharTermAttribute termAtt;
private readonly ICharTermAttribute termAtt; // LUCENENET: marked readonly

/// <summary>
/// halfwidth kana mappings: 0xFF65-0xFF9D
/// halfwidth kana mappings: 0xFF65-0xFF9D
/// <para/>
/// note: 0xFF9C and 0xFF9D are only mapped to 0x3099 and 0x309A
/// as a fallback when they cannot properly combine with a preceding
/// as a fallback when they cannot properly combine with a preceding
/// character into a composed form.
/// </summary>
private static readonly char[] KANA_NORM = new char[] {
Expand Down Expand Up @@ -124,4 +124,4 @@ private static bool Combine(char[] text, int pos, char ch)
return false;
}
}
}
}
10 changes: 5 additions & 5 deletions src/Lucene.Net.Analysis.Common/Analysis/Cn/ChineseFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace Lucene.Net.Analysis.Cn
*/

/// <summary>
/// A <see cref="TokenFilter"/> with a stop word table.
/// A <see cref="TokenFilter"/> with a stop word table.
/// <list type="bullet">
/// <item><description>Numeric tokens are removed.</description></item>
/// <item><description>English tokens must be larger than 1 character.</description></item>
Expand All @@ -39,7 +39,7 @@ namespace Lucene.Net.Analysis.Cn
/// </list>
/// </summary>
/// @deprecated (3.1) Use <see cref="Core.StopFilter"/> instead, which has the same functionality.
/// This filter will be removed in Lucene 5.0
/// This filter will be removed in Lucene 5.0
[Obsolete("(3.1) Use StopFilter instead, which has the same functionality.")]
public sealed class ChineseFilter : TokenFilter
{
Expand All @@ -52,9 +52,9 @@ public sealed class ChineseFilter : TokenFilter
"they", "this", "to", "was", "will", "with"
};

private CharArraySet stopTable;
private readonly CharArraySet stopTable; // LUCENENET: marked readonly

private ICharTermAttribute termAtt;
private readonly ICharTermAttribute termAtt; // LUCENENET: marked readonly

public ChineseFilter(TokenStream @in)
: base(@in)
Expand Down Expand Up @@ -97,4 +97,4 @@ public override bool IncrementToken()
return false;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -24,7 +24,7 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation
/// <summary>
/// This class implements a simple byte vector with access to the underlying
/// array.
/// This class has been taken from the Apache FOP project (http://xmlgraphics.apache.org/fop/). They have been slightly modified.
/// This class has been taken from the Apache FOP project (http://xmlgraphics.apache.org/fop/). They have been slightly modified.
/// </summary>
public class ByteVector
{
Expand All @@ -33,7 +33,7 @@ public class ByteVector
/// </summary>
private const int DEFAULT_BLOCK_SIZE = 2048;

private int blockSize;
private readonly int blockSize; // LUCENENET: marked readonly

/// <summary>
/// The encapsulated array
Expand All @@ -45,7 +45,7 @@ public class ByteVector
/// </summary>
private int n;

public ByteVector()
public ByteVector()
: this(DEFAULT_BLOCK_SIZE)
{
}
Expand Down Expand Up @@ -148,4 +148,4 @@ public virtual void TrimToSize()
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -25,8 +25,8 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation
/// <summary>
/// This class implements a simple char vector with access to the underlying
/// array.
///
/// This class has been taken from the Apache FOP project (http://xmlgraphics.apache.org/fop/). They have been slightly modified.
///
/// This class has been taken from the Apache FOP project (http://xmlgraphics.apache.org/fop/). They have been slightly modified.
/// </summary>
public class CharVector // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
{
Expand All @@ -35,7 +35,7 @@ public class CharVector // LUCENENET specific: Not implementing ICloneable per M
/// </summary>
private const int DEFAULT_BLOCK_SIZE = 2048;

private int blockSize;
private readonly int blockSize; // LUCENENET: marked readonly

/// <summary>
/// The encapsulated array
Expand All @@ -47,7 +47,7 @@ public class CharVector // LUCENENET specific: Not implementing ICloneable per M
/// </summary>
private int n;

public CharVector()
public CharVector()
: this(DEFAULT_BLOCK_SIZE)
{
}
Expand Down Expand Up @@ -160,4 +160,4 @@ public virtual void TrimToSize()
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class PatternParser

internal IPatternConsumer consumer;

internal StringBuilder token;
internal readonly StringBuilder token; // LUCENENET: marked readonly

internal IList<object> exception;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -27,7 +27,7 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation

/// <summary>
/// <h2>Ternary Search Tree.</h2>
///
///
/// <para>
/// A ternary search tree is a hybrid between a binary tree and a digital search
/// tree (trie). Keys are limited to strings. A data value of type char is stored
Expand All @@ -42,7 +42,7 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation
/// trie. Performance is comparable with a hash table, sometimes it outperforms a
/// hash function (most of the time can determine a miss faster than a hash).
/// </para>
///
///
/// <para>
/// The main purpose of this java port is to serve as a base for implementing
/// TeX's hyphenation algorithm (see The TeXBook, appendix H). Each language
Expand All @@ -56,15 +56,15 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation
/// tests the english patterns took 7694 nodes and the german patterns 10055
/// nodes, so I think we are safe.
/// </para>
///
///
/// <para>
/// All said, this is a map with strings as keys and char as value. Pretty
/// limited!. It can be extended to a general map by using the string
/// representation of an object and using the char value as an index to an array
/// that contains the object values.
/// </para>
///
/// This class has been taken from the Apache FOP project (http://xmlgraphics.apache.org/fop/). They have been slightly modified.
///
/// This class has been taken from the Apache FOP project (http://xmlgraphics.apache.org/fop/). They have been slightly modified.
/// </summary>

public class TernaryTree // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
Expand Down Expand Up @@ -475,7 +475,7 @@ public virtual void Balance()
/// tree is traversed to find the key substrings actually used. In addition,
/// duplicate substrings are removed using a map (implemented with a
/// TernaryTree!).
///
///
/// </summary>
public virtual void TrimToSize()
{
Expand Down Expand Up @@ -560,7 +560,7 @@ public class Enumerator : IEnumerator<string>

private class Item // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
{
internal char parent;
internal readonly char parent; // LUCENENET: marked readonly
internal char child;

// LUCENENET: This constructor is unnecessary
Expand Down Expand Up @@ -814,4 +814,4 @@ public static void main(String[] args) {
*/

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Lucene.Net.Analysis.En
/// <para>You must specify the required <see cref="LuceneVersion"/>
/// compatibility when creating <see cref="EnglishPossessiveFilter"/>:
/// <list type="bullet">
/// <item><description> As of 3.6, U+2019 RIGHT SINGLE QUOTATION MARK and
/// <item><description> As of 3.6, U+2019 RIGHT SINGLE QUOTATION MARK and
/// U+FF07 FULLWIDTH APOSTROPHE are also treated as
/// quotation marks.</description></item>
/// </list>
Expand All @@ -36,16 +36,16 @@ namespace Lucene.Net.Analysis.En
public sealed class EnglishPossessiveFilter : TokenFilter
{
private readonly ICharTermAttribute termAtt;
private LuceneVersion matchVersion;
private readonly LuceneVersion matchVersion; // LUCENENET: marked readonly

/// @deprecated Use <see cref="EnglishPossessiveFilter(LuceneVersion, TokenStream)"/> instead.
/// @deprecated Use <see cref="EnglishPossessiveFilter(LuceneVersion, TokenStream)"/> instead.
[Obsolete(@"Use <see cref=""#EnglishPossessiveFilter(org.apache.lucene.util.Version, org.apache.lucene.analysis.TokenStream)""/> instead.")]
public EnglishPossessiveFilter(TokenStream input)
public EnglishPossessiveFilter(TokenStream input)
: this(LuceneVersion.LUCENE_35, input)
{
}

public EnglishPossessiveFilter(LuceneVersion version, TokenStream input)
public EnglishPossessiveFilter(LuceneVersion version, TokenStream input)
: base(input)
{
this.matchVersion = version;
Expand Down Expand Up @@ -73,4 +73,4 @@ public override bool IncrementToken()
return true;
}
}
}
}
Loading

0 comments on commit f910628

Please sign in to comment.