diff --git a/.build/TestReferences.Common.targets b/.build/TestReferences.Common.targets
index 3811a42fdf..9eab94e1c1 100644
--- a/.build/TestReferences.Common.targets
+++ b/.build/TestReferences.Common.targets
@@ -25,8 +25,4 @@
-
-
-
-
\ No newline at end of file
diff --git a/.build/azure-templates/publish-nuget-packages.yml b/.build/azure-templates/publish-nuget-packages.yml
index 184fa2de60..92d63d2136 100644
--- a/.build/azure-templates/publish-nuget-packages.yml
+++ b/.build/azure-templates/publish-nuget-packages.yml
@@ -1,4 +1,4 @@
-# Licensed to the Apache Software Foundation (ASF) under one
+# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
@@ -57,7 +57,7 @@ steps:
inputs:
command: push
packagesToPush: '${{ parameters.nugetArtifactName }}/*.nupkg;!${{ parameters.nugetArtifactName }}/*.symbols.nupkg'
- publishVstsFeed: '/${{ parameters.artifactFeedID }}'
+ publishVstsFeed: '${{ parameters.artifactFeedID }}'
allowPackageConflicts: true
- task: PublishSymbols@2
diff --git a/.build/azure-templates/publish-test-results-for-test-projects.yml b/.build/azure-templates/publish-test-results-for-test-projects.yml
index 7ee98b752e..11ebac78fb 100644
--- a/.build/azure-templates/publish-test-results-for-test-projects.yml
+++ b/.build/azure-templates/publish-test-results-for-test-projects.yml
@@ -102,7 +102,28 @@ steps:
testResultsArtifactName: '${{ parameters.testResultsArtifactName }}'
testResultsFileName: '${{ parameters.testResultsFileName }}'
-# Special case: Only supports net48
+# Special case: Only supports net7.0, net6.0 and net48
+
+- template: publish-test-results.yml
+ parameters:
+ testProjectName: 'Lucene.Net.Tests.Analysis.OpenNLP'
+ framework: 'net7.0' # Since condtions are not supported for templates, we check for the file existence within publish-test-results.yml
+ vsTestPlatform: '${{ parameters.vsTestPlatform }}'
+ osName: '${{ parameters.osName }}'
+ testResultsFormat: '${{ parameters.testResultsFormat }}'
+ testResultsArtifactName: '${{ parameters.testResultsArtifactName }}'
+ testResultsFileName: '${{ parameters.testResultsFileName }}'
+
+- template: publish-test-results.yml
+ parameters:
+ testProjectName: 'Lucene.Net.Tests.Analysis.OpenNLP'
+ framework: 'net6.0' # Since condtions are not supported for templates, we check for the file existence within publish-test-results.yml
+ vsTestPlatform: '${{ parameters.vsTestPlatform }}'
+ osName: '${{ parameters.osName }}'
+ testResultsFormat: '${{ parameters.testResultsFormat }}'
+ testResultsArtifactName: '${{ parameters.testResultsArtifactName }}'
+ testResultsFileName: '${{ parameters.testResultsFileName }}'
+
- template: publish-test-results.yml
parameters:
testProjectName: 'Lucene.Net.Tests.Analysis.OpenNLP'
diff --git a/.build/dependencies.props b/.build/dependencies.props
index a37cc27a3e..22d4e0e23c 100644
--- a/.build/dependencies.props
+++ b/.build/dependencies.props
@@ -38,6 +38,8 @@
$(ICU4NPackageVersion)
$(ICU4NPackageVersion)
$(ICU4NPackageVersion)
+ 8.7.5
+ 1.6.7
2.0.0
1.0.9
2.0.0
@@ -68,19 +70,23 @@
13.0.1
3.17.0
3.13.1
- 1.9.1.1
2.7.8
1.4.2
0.4.1.1
- 4.5.4
+ 4.5.5
4.3.0
4.3.0
4.3.0
- 5.0.0
+ 6.0.0
4.3.0
6.0.1
4.3.0
5.0.0
+ 6.0.6
6.1.0
+
+ 1.9.1
+ 4.2.0
+
\ No newline at end of file
diff --git a/.github/workflows/Lucene-Net-Tests-Analysis-OpenNLP.yml b/.github/workflows/Lucene-Net-Tests-Analysis-OpenNLP.yml
index d23d10fe7c..ca1236afc5 100644
--- a/.github/workflows/Lucene-Net-Tests-Analysis-OpenNLP.yml
+++ b/.github/workflows/Lucene-Net-Tests-Analysis-OpenNLP.yml
@@ -56,7 +56,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
- framework: [net48]
+ framework: [net7.0, net48]
platform: [x64]
configuration: [Release]
exclude:
diff --git a/Directory.Build.targets b/Directory.Build.targets
index 92406f90f8..f7e801610e 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -128,9 +128,9 @@
full
-
+
-
+
$(DefineConstants);FEATURE_OPENNLP
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/TypeAsSynonymFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/TypeAsSynonymFilter.cs
new file mode 100644
index 0000000000..b72ec02e0d
--- /dev/null
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/TypeAsSynonymFilter.cs
@@ -0,0 +1,97 @@
+// Lucene version compatibility level 8.2.0
+// LUCENENET NOTE: Ported because Lucene.Net.Analysis.OpenNLP requires this to be useful.
+using Lucene.Net.Analysis.TokenAttributes;
+using Lucene.Net.Util;
+#nullable enable
+
+namespace Lucene.Net.Analysis.Miscellaneous
+{
+ /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ ///
+ /// Adds the as a synonym,
+ /// i.e. another token at the same position, optionally with a specified prefix prepended.
+ ///
+ public sealed class TypeAsSynonymFilter : TokenFilter
+ {
+ private readonly ICharTermAttribute termAtt;
+ private readonly ITypeAttribute typeAtt;
+ private readonly IPositionIncrementAttribute posIncrAtt;
+ private readonly string? prefix;
+
+ private State? savedToken = null;
+
+ ///
+ /// Initializes a new instance of with
+ /// the specified token stream.
+ ///
+ /// Input token stream.
+ public TypeAsSynonymFilter(TokenStream input)
+ : this(input, null)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of with
+ /// the specified token stream and prefix.
+ ///
+ /// Input token stream.
+ /// Prepend this string to every token type emitted as token text.
+ /// If null, nothing will be prepended.
+ public TypeAsSynonymFilter(TokenStream input, string? prefix)
+ : base(input)
+ {
+ this.prefix = prefix;
+ termAtt = AddAttribute();
+ typeAtt = AddAttribute();
+ posIncrAtt = AddAttribute();
+ }
+
+
+ public override bool IncrementToken()
+ {
+ if (savedToken != null)
+ {
+ // Emit last token's type at the same position
+ RestoreState(savedToken);
+ savedToken = null;
+ termAtt.SetEmpty();
+ if (prefix != null)
+ {
+ termAtt.Append(prefix);
+ }
+ termAtt.Append(typeAtt.Type);
+ posIncrAtt.PositionIncrement = 0;
+ return true;
+ }
+ else if (m_input.IncrementToken())
+ {
+ // Ho pending token type to emit
+ savedToken = CaptureState();
+ return true;
+ }
+ return false;
+ }
+
+ public override void Reset()
+ {
+ base.Reset();
+ savedToken = null;
+ }
+ }
+}
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/TypeAsSynonymFilterFactory.cs b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/TypeAsSynonymFilterFactory.cs
new file mode 100644
index 0000000000..462be60bd7
--- /dev/null
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/TypeAsSynonymFilterFactory.cs
@@ -0,0 +1,62 @@
+// Lucene version compatibility level 8.2.0
+// LUCENENET NOTE: Ported because Lucene.Net.Analysis.OpenNLP requires this to be useful.
+using Lucene.Net.Analysis.Util;
+using System;
+using System.Collections.Generic;
+#nullable enable
+
+namespace Lucene.Net.Analysis.Miscellaneous
+{
+ /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ ///
+ /// Factory for .
+ ///
+ /// <fieldType name="text_type_as_synonym" class="solr.TextField" positionIncrementGap="100">
+ /// <analyzer>
+ /// <tokenizer class="solr.UAX29URLEmailTokenizerFactory"/>
+ /// <filter class="solr.TypeAsSynonymFilterFactory" prefix="_type_" />
+ /// </analyzer>
+ /// </fieldType>
+ ///
+ ///
+ ///
+ /// If the optional prefix parameter is used, the specified value will be prepended
+ /// to the type, e.g.with prefix = "_type_", for a token "example.com" with type "<URL>",
+ /// the emitted synonym will have text "_type_<URL>".
+ ///
+ public class TypeAsSynonymFilterFactory : TokenFilterFactory
+ {
+ private readonly string prefix;
+
+ public TypeAsSynonymFilterFactory(IDictionary args)
+ : base(args)
+ {
+ prefix = Get(args, "prefix"); // default value is null
+ if (args.Count > 0)
+ {
+ throw new ArgumentException(string.Format(J2N.Text.StringFormatter.CurrentCulture, "Unknown parameters: {0}", args));
+ }
+ }
+
+ public override TokenStream Create(TokenStream input)
+ {
+ return new TypeAsSynonymFilter(input, prefix);
+ }
+ }
+}
diff --git a/src/Lucene.Net.Analysis.OpenNLP/Lucene.Net.Analysis.OpenNLP.csproj b/src/Lucene.Net.Analysis.OpenNLP/Lucene.Net.Analysis.OpenNLP.csproj
index 625d6ee9c5..33920cdd4a 100644
--- a/src/Lucene.Net.Analysis.OpenNLP/Lucene.Net.Analysis.OpenNLP.csproj
+++ b/src/Lucene.Net.Analysis.OpenNLP/Lucene.Net.Analysis.OpenNLP.csproj
@@ -30,7 +30,10 @@
- net462
+
+ net6.0
+ $(TargetFrameworks);net472
Lucene.Net.Analysis.OpenNLP
$(PackageTags);analysis;natural;language;processing;opennlp
@@ -39,8 +42,6 @@
Lucene.Net.Analysis.OpenNlp
-
-
@@ -49,7 +50,13 @@
-
+
+
+
+
+
+
+
diff --git a/src/Lucene.Net.Analysis.OpenNLP/overview.md b/src/Lucene.Net.Analysis.OpenNLP/overview.md
index ba4f9fc9b6..882ddff08c 100644
--- a/src/Lucene.Net.Analysis.OpenNLP/overview.md
+++ b/src/Lucene.Net.Analysis.OpenNLP/overview.md
@@ -21,4 +21,102 @@ summary: *content
limitations under the License.
-->
-OpenNLP Library Integration
\ No newline at end of file
+OpenNLP Library Integration
+
+This module exposes functionality from Apache OpenNLP to Apache Lucene.NET. The Apache OpenNLP library is a machine learning based toolkit for the processing of natural language text.
+
+For an introduction to Lucene's analysis API, see the [Lucene.Net.Analysis](../core/Lucene.Net.Analysis.html) namespace documentation.
+
+The OpenNLP Tokenizer behavior is similar to the but is smart about inter-word punctuation. The term stream looks very much like the way you parse words and punctuation while reading. The major difference between this tokenizer and most other tokenizers shipped with Lucene is that punctuation is tokenized. This is required for the following taggers to operate properly.
+
+The OpenNLP taggers annotate terms using the .
+
+- segments text into sentences or words. This Tokenizer uses the OpenNLP Sentence Detector and/or Tokenizer classes. When used together, the Tokenizer receives sentences and can do a better job.
+- tags words for Part-of-Speech and tags words for Chunking. These tags are assigned as token types. Note that only one of these operations will tag
+Since the is not stored in the index, it is recommended that one of these filters is used following OpenNLPFilter to enable search against the assigned tags:
+
+- copies the value to the
+- creates a cloned token at the same position as each tagged token, and copies the value to the , optionally with a customized prefix (so that tags effectively occupy a different namespace from token text).
+
+Named Entity Recognition is also supported by OpenNLP, but there is no OpenNLPNERFilter included. For an implementation, see the [lucenenet-opennlp-mavenreference-demo](https://github.com/NightOwl888/lucenenet-opennlp-mavenreference-demo).
+
+## MavenReference Primer
+
+When a `` is included for this NuGet package in your SDK-style MSBuild project, it will automatically include transient dependencies to [`opennlp-tools` on maven.org](https://search.maven.org/artifact/org.apache.opennlp/opennlp-tools/1.9.4/bundle). The transient dependency will automatically include a `` in your MSBuild project.
+
+The `` item group operates similar to a dependency in Maven. All transitive dependencies are collected and resolved, and then the final output is produced. However, unlike `PackageReference`s, `MavenReference`s are collected by the final output project, and reassessed. That is, each dependent Project within your .NET SDK-style solution contributes its `MavenReference`s to project(s) which include it, and each project makes its own dependency graph. Projects do not contribute their final built assemblies up. They only contribute their dependencies. Allowing each project in a complicated solution to make its own local conflict resolution attempt.
+
+> **NOTE** `` is only supported on SDK-style MSBuild projects.
+
+## MavenReference Example
+
+This means this package can be combined with other related packages on Maven in your project and they can be accessed using the same path as in Java like a namespace in .NET. For example, you can add a `` to your project to include a reference to [`opennlp-uima`](https://search.maven.org/artifact/org.apache.opennlp/opennlp-uima/1.9.1/jar). The UIMA (Unstructured Information Management Architecture) integration module is designed to work with the Apache UIMA framework. UIMA is a framework for building applications that analyze unstructured information, and it's often used for processing natural language text. The opennlp-uima module allows you to integrate OpenNLP functionality into UIMA pipelines, leveraging the capabilities of both frameworks.
+
+Here's a basic outline of how you might extend an existing Lucene.NET analyzer to incorporate OpenNLP-UIMA annotators:
+
+```xml
+
+
+ net7.0
+
+
+
+
+
+
+
+
+
+
+```
+
+```c#
+using Lucene.Net.Analysis;
+using Lucene.Net.Analysis.Core;
+using Lucene.Net.Analysis.Util;
+using Lucene.Net.Util;
+using org.apache.uima.analysis_engine;
+using System.IO;
+
+public class CustomOpenNLPAnalyzer : OpenNLPTokenizerFactory
+{
+ // ... constructor and other methods ...
+
+ public override Tokenizer Create(AttributeFactory factory, TextReader reader)
+ {
+ Tokenizer tokenizer = base.Create(factory, reader);
+
+ // Wrap the tokenizer with UIMA annotators
+ AnalysisEngineDescription uimaSentenceAnnotator = CreateUIMASentenceAnnotator();
+ AnalysisEngineDescription uimaTokenAnnotator = CreateUIMATokenAnnotator();
+
+ // Combine OpenNLP-UIMA annotators with the existing tokenizer
+ AnalysisEngine tokenizerAndUIMAAnnotators = CreateAggregate(uimaSentenceAnnotator, uimaTokenAnnotator);
+
+ return new UIMATokenizer(tokenizer, tokenizerAndUIMAAnnotators);
+ }
+
+ // ... other methods ...
+
+ private AnalysisEngineDescription CreateUIMASentenceAnnotator() {
+ // Create and configure UIMA sentence annotator
+ // ...
+
+ return /* UIMA sentence annotator description */;
+ }
+
+ private AnalysisEngineDescription CreateUIMATokenAnnotator() {
+ // Create and configure UIMA token annotator
+ // ...
+
+ return /* UIMA token annotator description */;
+ }
+}
+```
+
+In the above example, `CustomOpenNLPAnalyzer` extends `OpenNLPTokenizerFactory` (assuming that's the analyzer you're using), and it wraps the OpenNLP tokenizer with UIMA annotators. You'll need to replace the placeholder methods (`CreateUIMASentenceAnnotator` and `CreateUIMATokenAnnotator`) with the actual code to create and configure your UIMA annotators. Please note that configuring NLP can be complex. See the [OpenNLP 1.9.4 Manual](https://opennlp.apache.org/docs/1.9.4/manual/opennlp.html) and [OpenNLP UIMA 1.9.4 API Documention](https://opennlp.apache.org/docs/1.9.4/apidocs/opennlp-uima/index.html) for details.
+
+> [!NOTE]
+> IKVM (and ``) does not support Java SE higher than version 8. So it will not be possible to add a `` to OpenNLP 2.x until support is added for it in IKVM.
+
+For a more complete example, see the [lucenenet-opennlp-mavenreference-demo](https://github.com/NightOwl888/lucenenet-opennlp-mavenreference-demo).
\ No newline at end of file
diff --git a/src/Lucene.Net.Facet/Lucene.Net.Facet.csproj b/src/Lucene.Net.Facet/Lucene.Net.Facet.csproj
index 5f489ec875..2406b72f5a 100644
--- a/src/Lucene.Net.Facet/Lucene.Net.Facet.csproj
+++ b/src/Lucene.Net.Facet/Lucene.Net.Facet.csproj
@@ -38,13 +38,19 @@
$(NoWarn);1591;1573
-
-
+
+
+
+
+
+
+
+
diff --git a/src/Lucene.Net.TestFramework/Analysis/CannedTokenStream.cs b/src/Lucene.Net.TestFramework/Analysis/CannedTokenStream.cs
index e7d787d041..824eaec95d 100644
--- a/src/Lucene.Net.TestFramework/Analysis/CannedTokenStream.cs
+++ b/src/Lucene.Net.TestFramework/Analysis/CannedTokenStream.cs
@@ -1,4 +1,4 @@
-using Lucene.Net.Analysis.TokenAttributes;
+using Lucene.Net.Analysis.TokenAttributes;
namespace Lucene.Net.Analysis
{
@@ -31,6 +31,7 @@ public sealed class CannedTokenStream : TokenStream
private readonly IPositionLengthAttribute posLengthAtt;
private readonly IOffsetAttribute offsetAtt;
private readonly IPayloadAttribute payloadAtt;
+ private readonly ITypeAttribute typeAtt; // LUCENENET specific - See IncrementToken()
private readonly int finalOffset;
private readonly int finalPosInc;
@@ -49,6 +50,7 @@ public CannedTokenStream(int finalPosInc, int finalOffset, params Token[] tokens
posLengthAtt = AddAttribute();
offsetAtt = AddAttribute();
payloadAtt = AddAttribute();
+ typeAtt = AddAttribute(); // LUCENENET specific - See IncrementToken()
this.tokens = tokens;
this.finalOffset = finalOffset;
@@ -76,6 +78,12 @@ public override bool IncrementToken()
posLengthAtt.PositionLength = token.PositionLength;
offsetAtt.SetOffset(token.StartOffset, token.EndOffset);
payloadAtt.Payload = token.Payload;
+
+ // LUCENENET: This change is from https://github.com/apache/lucene/commit/72eaeab7151d421a28ecec1634b8c48599e524f5.
+ // We need it for the TestTypeAsSynonymFilterFactory tests to pass (from lucene 8.2.0).
+ // But we don't yet have all of the PackedTokenAttributeImpl plumbing it takes to do it the way they did,
+ // so setting it explicitly as a workaround.
+ typeAtt.Type = token.Type;
return true;
}
else
diff --git a/src/Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj b/src/Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj
index 712ec3b0e2..4eb51d734b 100644
--- a/src/Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj
+++ b/src/Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj
@@ -66,6 +66,11 @@
+
+
+
+
+
diff --git a/src/Lucene.Net.Tests.AllProjects/Lucene.Net.Tests.AllProjects.csproj b/src/Lucene.Net.Tests.AllProjects/Lucene.Net.Tests.AllProjects.csproj
index 6219d75962..92056ba0ab 100644
--- a/src/Lucene.Net.Tests.AllProjects/Lucene.Net.Tests.AllProjects.csproj
+++ b/src/Lucene.Net.Tests.AllProjects/Lucene.Net.Tests.AllProjects.csproj
@@ -118,18 +118,10 @@
-
+
-
-
-
-
-
-
-
-
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestTypeAsSynonymFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestTypeAsSynonymFilterFactory.cs
new file mode 100644
index 0000000000..8f363f4f9b
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestTypeAsSynonymFilterFactory.cs
@@ -0,0 +1,56 @@
+// Lucene version compatibility level 8.2.0
+// LUCENENET NOTE: Ported because Lucene.Net.Analysis.OpenNLP requires this to be useful.
+using Lucene.Net.Analysis.Util;
+using NUnit.Framework;
+
+namespace Lucene.Net.Analysis.Miscellaneous
+{
+ /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ public class TestTypeAsSynonymFilterFactory : BaseTokenStreamFactoryTestCase
+ {
+ private static readonly Token[] TOKENS = { token("Visit", ""), token("example.com", "") };
+
+ [Test]
+ public void TestBasic()
+ {
+ TokenStream stream = new CannedTokenStream(TOKENS);
+ stream = TokenFilterFactory("TypeAsSynonym").Create(stream);
+ AssertTokenStreamContents(stream, new string[] { "Visit", "", "example.com", "" },
+ null, null, new string[] { "", "", "", "" }, new int[] { 1, 0, 1, 0 });
+ }
+
+ [Test]
+ public void TestPrefix()
+ {
+ TokenStream stream = new CannedTokenStream(TOKENS);
+ stream = TokenFilterFactory("TypeAsSynonym", "prefix", "_type_").Create(stream);
+ AssertTokenStreamContents(stream, new string[] { "Visit", "_type_", "example.com", "_type_" },
+ null, null, new string[] { "", "", "", "" }, new int[] { 1, 0, 1, 0 });
+ }
+
+ private static Token token(string term, string type)
+ {
+ Token token = new Token();
+ token.SetEmpty();
+ token.Append(term);
+ token.Type = type;
+ return token;
+ }
+ }
+}
diff --git a/src/Lucene.Net.Tests.Analysis.OpenNLP/Lucene.Net.Tests.Analysis.OpenNLP.csproj b/src/Lucene.Net.Tests.Analysis.OpenNLP/Lucene.Net.Tests.Analysis.OpenNLP.csproj
index 1a3bbbc6b7..d880584623 100644
--- a/src/Lucene.Net.Tests.Analysis.OpenNLP/Lucene.Net.Tests.Analysis.OpenNLP.csproj
+++ b/src/Lucene.Net.Tests.Analysis.OpenNLP/Lucene.Net.Tests.Analysis.OpenNLP.csproj
@@ -24,19 +24,21 @@
-
- net48
-
+
+ net7.0;net6.0
+ $(TargetFrameworks);net48
+
Lucene.Net.Tests.Analysis.OpenNLP
Lucene.Net.Analysis.OpenNlp
+
+
+
false
- true
-
-
false
- true
+
+ net7.0
+ net48
diff --git a/src/Lucene.Net/Lucene.Net.csproj b/src/Lucene.Net/Lucene.Net.csproj
index a1889b96bd..2491eccf46 100644
--- a/src/Lucene.Net/Lucene.Net.csproj
+++ b/src/Lucene.Net/Lucene.Net.csproj
@@ -60,10 +60,14 @@
+
+
+
+
diff --git a/src/dotnet/tools/Lucene.Net.Tests.Cli/Lucene.Net.Tests.Cli.csproj b/src/dotnet/tools/Lucene.Net.Tests.Cli/Lucene.Net.Tests.Cli.csproj
index d0cf2a720b..9e9a0105ae 100644
--- a/src/dotnet/tools/Lucene.Net.Tests.Cli/Lucene.Net.Tests.Cli.csproj
+++ b/src/dotnet/tools/Lucene.Net.Tests.Cli/Lucene.Net.Tests.Cli.csproj
@@ -26,12 +26,15 @@
net7.0;net6.0
-
- net7.0
Lucene.Net.Tests.Cli
+
- false
- false
+
+
+ false
+ false
+
+ net7.0