lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [lucenenet] 19/20: Lucene.Net.Analysis.OpenNLP: Added Lucene compatibility version, made some minor code improvements
Date Tue, 03 Dec 2019 14:03:49 GMT
This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit 40dad16d0ad9c497d1df649b9469513b969a1b5c
Author: Shad Storhaug <shad@shadstorhaug.com>
AuthorDate: Tue Dec 3 05:45:03 2019 +0700

    Lucene.Net.Analysis.OpenNLP: Added Lucene compatibility version, made some minor code
improvements
---
 .../OpenNLPChunkerFilter.cs                        |  7 +++---
 .../OpenNLPChunkerFilterFactory.cs                 |  5 +++--
 .../OpenNLPLemmatizerFilter.cs                     |  4 +++-
 .../OpenNLPLemmatizerFilterFactory.cs              |  7 +++---
 .../OpenNLPPOSFilter.cs                            |  7 +++---
 .../OpenNLPPOSFilterFactory.cs                     |  5 +++--
 .../OpenNLPSentenceBreakIterator.cs                |  3 ++-
 .../OpenNLPTokenizer.cs                            |  7 +++---
 .../OpenNLPTokenizerFactory.cs                     |  3 ++-
 .../Tools/NLPChunkerOp.cs                          |  5 +++--
 .../Tools/NLPLemmatizerOp.cs                       |  3 ++-
 .../Tools/NLPNERTaggerOp.cs                        |  3 ++-
 .../Tools/NLPPOSTaggerOp.cs                        |  5 +++--
 .../Tools/NLPSentenceDetectorOp.cs                 |  3 ++-
 .../Tools/NLPTokenizerOp.cs                        |  3 ++-
 .../Tools/OpenNLPOpsFactory.cs                     | 25 ++++++++--------------
 .../TestOpenNLPChunkerFilterFactory.cs             |  2 +-
 .../TestOpenNLPLemmatizerFilterFactory.cs          |  6 ++----
 .../TestOpenNLPPOSFilterFactory.cs                 |  4 ++--
 .../TestOpenNLPSentenceBreakIterator.cs            |  3 ++-
 .../TestOpenNLPTokenizerFactory.cs                 |  3 ++-
 21 files changed, 61 insertions(+), 52 deletions(-)

diff --git a/src/Lucene.Net.Analysis.OpenNLP/OpenNLPChunkerFilter.cs b/src/Lucene.Net.Analysis.OpenNLP/OpenNLPChunkerFilter.cs
index 9144475..141b8a0 100644
--- a/src/Lucene.Net.Analysis.OpenNLP/OpenNLPChunkerFilter.cs
+++ b/src/Lucene.Net.Analysis.OpenNLP/OpenNLPChunkerFilter.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Analysis.OpenNlp.Tools;
+// Lucene version compatibility level 8.2.0
+using Lucene.Net.Analysis.OpenNlp.Tools;
 using Lucene.Net.Analysis.TokenAttributes;
 using Lucene.Net.Util;
 using System.Collections.Generic;
@@ -29,7 +30,7 @@ namespace Lucene.Net.Analysis.OpenNlp
     /// </summary>
     public sealed class OpenNLPChunkerFilter : TokenFilter
     {
-        private List<AttributeSource> sentenceTokenAttrs = new List<AttributeSource>();
+        private readonly IList<AttributeSource> sentenceTokenAttrs = new List<AttributeSource>();
         private int tokenNum = 0;
         private bool moreTokensAvailable = true;
         private string[] sentenceTerms = null;
@@ -41,7 +42,7 @@ namespace Lucene.Net.Analysis.OpenNlp
         private readonly ICharTermAttribute termAtt;
 
         public OpenNLPChunkerFilter(TokenStream input, NLPChunkerOp chunkerOp)
-                  : base(input)
+            : base(input)
         {
             this.chunkerOp = chunkerOp;
             this.typeAtt = AddAttribute<ITypeAttribute>();
diff --git a/src/Lucene.Net.Analysis.OpenNLP/OpenNLPChunkerFilterFactory.cs b/src/Lucene.Net.Analysis.OpenNLP/OpenNLPChunkerFilterFactory.cs
index 5669603..cded9a6 100644
--- a/src/Lucene.Net.Analysis.OpenNLP/OpenNLPChunkerFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.OpenNLP/OpenNLPChunkerFilterFactory.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Analysis.OpenNlp.Tools;
+// Lucene version compatibility level 8.2.0
+using Lucene.Net.Analysis.OpenNlp.Tools;
 using Lucene.Net.Analysis.Util;
 using System;
 using System.Collections.Generic;
@@ -39,7 +40,7 @@ namespace Lucene.Net.Analysis.OpenNlp
     /// <since>7.3.0</since>
     public class OpenNLPChunkerFilterFactory : TokenFilterFactory, IResourceLoaderAware
     {
-        public static readonly string CHUNKER_MODEL = "chunkerModel";
+        public const string CHUNKER_MODEL = "chunkerModel";
 
         private readonly string chunkerModelFile;
 
diff --git a/src/Lucene.Net.Analysis.OpenNLP/OpenNLPLemmatizerFilter.cs b/src/Lucene.Net.Analysis.OpenNLP/OpenNLPLemmatizerFilter.cs
index 977d98a..096516b 100644
--- a/src/Lucene.Net.Analysis.OpenNLP/OpenNLPLemmatizerFilter.cs
+++ b/src/Lucene.Net.Analysis.OpenNLP/OpenNLPLemmatizerFilter.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Analysis.OpenNlp.Tools;
+// Lucene version compatibility level 8.2.0
+using Lucene.Net.Analysis.OpenNlp.Tools;
 using Lucene.Net.Analysis.TokenAttributes;
 using Lucene.Net.Util;
 using System.Collections.Generic;
@@ -119,6 +120,7 @@ namespace Lucene.Net.Analysis.OpenNlp
         private void Clear()
         {
             sentenceTokenAttrs.Clear();
+            sentenceTokenAttrsIter?.Dispose();
             sentenceTokenAttrsIter = null;
             sentenceTokens = null;
             sentenceTokenTypes = null;
diff --git a/src/Lucene.Net.Analysis.OpenNLP/OpenNLPLemmatizerFilterFactory.cs b/src/Lucene.Net.Analysis.OpenNLP/OpenNLPLemmatizerFilterFactory.cs
index e8fa98c..b133a67 100644
--- a/src/Lucene.Net.Analysis.OpenNLP/OpenNLPLemmatizerFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.OpenNLP/OpenNLPLemmatizerFilterFactory.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Analysis.OpenNlp.Tools;
+// Lucene version compatibility level 8.2.0
+using Lucene.Net.Analysis.OpenNlp.Tools;
 using Lucene.Net.Analysis.Util;
 using System;
 using System.Collections.Generic;
@@ -42,8 +43,8 @@ namespace Lucene.Net.Analysis.OpenNlp
     /// </summary>
     public class OpenNLPLemmatizerFilterFactory : TokenFilterFactory, IResourceLoaderAware
     {
-        public static readonly string DICTIONARY = "dictionary";
-        public static readonly string LEMMATIZER_MODEL = "lemmatizerModel";
+        public const string DICTIONARY = "dictionary";
+        public const string LEMMATIZER_MODEL = "lemmatizerModel";
 
         private readonly string dictionaryFile;
         private readonly string lemmatizerModelFile;
diff --git a/src/Lucene.Net.Analysis.OpenNLP/OpenNLPPOSFilter.cs b/src/Lucene.Net.Analysis.OpenNLP/OpenNLPPOSFilter.cs
index 449f5ef..0539efe 100644
--- a/src/Lucene.Net.Analysis.OpenNLP/OpenNLPPOSFilter.cs
+++ b/src/Lucene.Net.Analysis.OpenNLP/OpenNLPPOSFilter.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Analysis.OpenNlp.Tools;
+// Lucene version compatibility level 8.2.0
+using Lucene.Net.Analysis.OpenNlp.Tools;
 using Lucene.Net.Analysis.TokenAttributes;
 using Lucene.Net.Util;
 using System.Collections.Generic;
@@ -28,7 +29,7 @@ namespace Lucene.Net.Analysis.OpenNlp
     /// </summary>
     public sealed class OpenNLPPOSFilter : TokenFilter
     {
-        private IList<AttributeSource> sentenceTokenAttrs = new List<AttributeSource>();
+        private readonly IList<AttributeSource> sentenceTokenAttrs = new List<AttributeSource>();
         string[] tags = null;
         private int tokenNum = 0;
         private bool moreTokensAvailable = true;
@@ -39,7 +40,7 @@ namespace Lucene.Net.Analysis.OpenNlp
         private readonly ICharTermAttribute termAtt;
 
         public OpenNLPPOSFilter(TokenStream input, NLPPOSTaggerOp posTaggerOp)
-                  : base(input)
+            : base(input)
         {
             this.posTaggerOp = posTaggerOp;
             this.typeAtt = AddAttribute<ITypeAttribute>();
diff --git a/src/Lucene.Net.Analysis.OpenNLP/OpenNLPPOSFilterFactory.cs b/src/Lucene.Net.Analysis.OpenNLP/OpenNLPPOSFilterFactory.cs
index 57c3262..a8d927d 100644
--- a/src/Lucene.Net.Analysis.OpenNLP/OpenNLPPOSFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.OpenNLP/OpenNLPPOSFilterFactory.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Analysis.OpenNlp.Tools;
+// Lucene version compatibility level 8.2.0
+using Lucene.Net.Analysis.OpenNlp.Tools;
 using Lucene.Net.Analysis.Util;
 using System;
 using System.Collections.Generic;
@@ -43,7 +44,7 @@ namespace Lucene.Net.Analysis.OpenNlp
         private readonly string posTaggerModelFile;
 
         public OpenNLPPOSFilterFactory(IDictionary<string, string> args)
-                  : base(args)
+            : base(args)
         {
             posTaggerModelFile = Require(args, POS_TAGGER_MODEL);
             if (args.Any())
diff --git a/src/Lucene.Net.Analysis.OpenNLP/OpenNLPSentenceBreakIterator.cs b/src/Lucene.Net.Analysis.OpenNLP/OpenNLPSentenceBreakIterator.cs
index 426f7b6..99c9b07 100644
--- a/src/Lucene.Net.Analysis.OpenNLP/OpenNLPSentenceBreakIterator.cs
+++ b/src/Lucene.Net.Analysis.OpenNLP/OpenNLPSentenceBreakIterator.cs
@@ -1,4 +1,5 @@
-using ICU4N.Support.Text;
+// Lucene version compatibility level 8.2.0
+using ICU4N.Support.Text;
 using ICU4N.Text;
 using Lucene.Net.Analysis.OpenNlp.Tools;
 using Lucene.Net.Analysis.Util;
diff --git a/src/Lucene.Net.Analysis.OpenNLP/OpenNLPTokenizer.cs b/src/Lucene.Net.Analysis.OpenNLP/OpenNLPTokenizer.cs
index 0a45b1e..68c1b84 100644
--- a/src/Lucene.Net.Analysis.OpenNLP/OpenNLPTokenizer.cs
+++ b/src/Lucene.Net.Analysis.OpenNLP/OpenNLPTokenizer.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Analysis.OpenNlp.Tools;
+// Lucene version compatibility level 8.2.0
+using Lucene.Net.Analysis.OpenNlp.Tools;
 using Lucene.Net.Analysis.TokenAttributes;
 using Lucene.Net.Analysis.Util;
 using opennlp.tools.util;
@@ -41,8 +42,8 @@ namespace Lucene.Net.Analysis.OpenNlp
         private int termNum = 0;
         private int sentenceStart = 0;
 
-        private NLPSentenceDetectorOp sentenceOp = null;
-        private NLPTokenizerOp tokenizerOp = null;
+        private readonly NLPSentenceDetectorOp sentenceOp = null;
+        private readonly NLPTokenizerOp tokenizerOp = null;
 
         /// <summary>
         /// Creates a new <see cref="OpenNLPTokenizer"/> </summary>
diff --git a/src/Lucene.Net.Analysis.OpenNLP/OpenNLPTokenizerFactory.cs b/src/Lucene.Net.Analysis.OpenNLP/OpenNLPTokenizerFactory.cs
index d015d10..5209f2a 100644
--- a/src/Lucene.Net.Analysis.OpenNLP/OpenNLPTokenizerFactory.cs
+++ b/src/Lucene.Net.Analysis.OpenNLP/OpenNLPTokenizerFactory.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Analysis.OpenNlp.Tools;
+// Lucene version compatibility level 8.2.0
+using Lucene.Net.Analysis.OpenNlp.Tools;
 using Lucene.Net.Analysis.Util;
 using System;
 using System.Collections.Generic;
diff --git a/src/Lucene.Net.Analysis.OpenNLP/Tools/NLPChunkerOp.cs b/src/Lucene.Net.Analysis.OpenNLP/Tools/NLPChunkerOp.cs
index 1c3ecc8..de53e3b 100644
--- a/src/Lucene.Net.Analysis.OpenNLP/Tools/NLPChunkerOp.cs
+++ b/src/Lucene.Net.Analysis.OpenNLP/Tools/NLPChunkerOp.cs
@@ -1,4 +1,5 @@
-using opennlp.tools.chunker;
+// Lucene version compatibility level 8.2.0
+using opennlp.tools.chunker;
 
 
 namespace Lucene.Net.Analysis.OpenNlp.Tools
@@ -26,7 +27,7 @@ namespace Lucene.Net.Analysis.OpenNlp.Tools
     /// </summary>
     public class NLPChunkerOp
     {
-        private ChunkerME chunker = null;
+        private readonly ChunkerME chunker = null;
 
         public NLPChunkerOp(ChunkerModel chunkerModel) 
         {
diff --git a/src/Lucene.Net.Analysis.OpenNLP/Tools/NLPLemmatizerOp.cs b/src/Lucene.Net.Analysis.OpenNLP/Tools/NLPLemmatizerOp.cs
index 56b1d2b..65a5509 100644
--- a/src/Lucene.Net.Analysis.OpenNLP/Tools/NLPLemmatizerOp.cs
+++ b/src/Lucene.Net.Analysis.OpenNLP/Tools/NLPLemmatizerOp.cs
@@ -1,4 +1,5 @@
-using opennlp.tools.lemmatizer;
+// Lucene version compatibility level 8.2.0
+using opennlp.tools.lemmatizer;
 using System.Diagnostics;
 using System.IO;
 
diff --git a/src/Lucene.Net.Analysis.OpenNLP/Tools/NLPNERTaggerOp.cs b/src/Lucene.Net.Analysis.OpenNLP/Tools/NLPNERTaggerOp.cs
index e4b43ac..614ae52 100644
--- a/src/Lucene.Net.Analysis.OpenNLP/Tools/NLPNERTaggerOp.cs
+++ b/src/Lucene.Net.Analysis.OpenNLP/Tools/NLPNERTaggerOp.cs
@@ -1,4 +1,5 @@
-using opennlp.tools.namefind;
+// Lucene version compatibility level 8.2.0
+using opennlp.tools.namefind;
 using opennlp.tools.util;
 
 namespace Lucene.Net.Analysis.OpenNlp.Tools
diff --git a/src/Lucene.Net.Analysis.OpenNLP/Tools/NLPPOSTaggerOp.cs b/src/Lucene.Net.Analysis.OpenNLP/Tools/NLPPOSTaggerOp.cs
index a69a7d0..2f1e090 100644
--- a/src/Lucene.Net.Analysis.OpenNLP/Tools/NLPPOSTaggerOp.cs
+++ b/src/Lucene.Net.Analysis.OpenNLP/Tools/NLPPOSTaggerOp.cs
@@ -1,4 +1,5 @@
-using opennlp.tools.postag;
+// Lucene version compatibility level 8.2.0
+using opennlp.tools.postag;
 
 namespace Lucene.Net.Analysis.OpenNlp.Tools
 {
@@ -25,7 +26,7 @@ namespace Lucene.Net.Analysis.OpenNlp.Tools
     /// </summary>
     public class NLPPOSTaggerOp
     {
-        private POSTagger tagger = null;
+        private readonly POSTagger tagger = null;
 
         public NLPPOSTaggerOp(POSModel model)
         {
diff --git a/src/Lucene.Net.Analysis.OpenNLP/Tools/NLPSentenceDetectorOp.cs b/src/Lucene.Net.Analysis.OpenNLP/Tools/NLPSentenceDetectorOp.cs
index ebca1c5..70c69ac 100644
--- a/src/Lucene.Net.Analysis.OpenNLP/Tools/NLPSentenceDetectorOp.cs
+++ b/src/Lucene.Net.Analysis.OpenNLP/Tools/NLPSentenceDetectorOp.cs
@@ -1,4 +1,5 @@
-using opennlp.tools.sentdetect;
+// Lucene version compatibility level 8.2.0
+using opennlp.tools.sentdetect;
 using opennlp.tools.util;
 
 namespace Lucene.Net.Analysis.OpenNlp.Tools
diff --git a/src/Lucene.Net.Analysis.OpenNLP/Tools/NLPTokenizerOp.cs b/src/Lucene.Net.Analysis.OpenNLP/Tools/NLPTokenizerOp.cs
index 1e96163..81df103 100644
--- a/src/Lucene.Net.Analysis.OpenNLP/Tools/NLPTokenizerOp.cs
+++ b/src/Lucene.Net.Analysis.OpenNLP/Tools/NLPTokenizerOp.cs
@@ -1,4 +1,5 @@
-using opennlp.tools.tokenize;
+// Lucene version compatibility level 8.2.0
+using opennlp.tools.tokenize;
 using opennlp.tools.util;
 
 namespace Lucene.Net.Analysis.OpenNlp.Tools
diff --git a/src/Lucene.Net.Analysis.OpenNLP/Tools/OpenNLPOpsFactory.cs b/src/Lucene.Net.Analysis.OpenNLP/Tools/OpenNLPOpsFactory.cs
index c49e429..e4b3dc5 100644
--- a/src/Lucene.Net.Analysis.OpenNLP/Tools/OpenNLPOpsFactory.cs
+++ b/src/Lucene.Net.Analysis.OpenNLP/Tools/OpenNLPOpsFactory.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Analysis.Util;
+// Lucene version compatibility level 8.2.0
+using Lucene.Net.Analysis.Util;
 using opennlp.tools.chunker;
 using opennlp.tools.lemmatizer;
 using opennlp.tools.namefind;
@@ -59,9 +60,7 @@ namespace Lucene.Net.Analysis.OpenNlp.Tools
 
         public static SentenceModel GetSentenceModel(string modelName, IResourceLoader loader)
         {
-            //SentenceModel model = sentenceModels.get(modelName);
-            sentenceModels.TryGetValue(modelName, out SentenceModel model);
-            if (model == null)
+            if (!sentenceModels.TryGetValue(modelName, out SentenceModel model) || model
== null)
             {
                 using (Stream resource = loader.OpenResource(modelName))
                 {
@@ -87,8 +86,7 @@ namespace Lucene.Net.Analysis.OpenNlp.Tools
 
         public static TokenizerModel GetTokenizerModel(string modelName, IResourceLoader
loader)
         {
-            tokenizerModels.TryGetValue(modelName, out TokenizerModel model);
-            if (model == null)
+            if (!tokenizerModels.TryGetValue(modelName, out TokenizerModel model) || model
== null)
             {
                 using (Stream resource = loader.OpenResource(modelName))
                 {
@@ -107,8 +105,7 @@ namespace Lucene.Net.Analysis.OpenNlp.Tools
 
         public static POSModel GetPOSTaggerModel(string modelName, IResourceLoader loader)
         {
-            posTaggerModels.TryGetValue(modelName, out POSModel model);
-            if (model == null)
+            if (!posTaggerModels.TryGetValue(modelName, out POSModel model) || model == null)
             {
                 using (Stream resource = loader.OpenResource(modelName))
                 {
@@ -127,8 +124,7 @@ namespace Lucene.Net.Analysis.OpenNlp.Tools
 
         public static ChunkerModel GetChunkerModel(string modelName, IResourceLoader loader)
         {
-            chunkerModels.TryGetValue(modelName, out ChunkerModel model);
-            if (model == null)
+            if (!chunkerModels.TryGetValue(modelName, out ChunkerModel model) || model ==
null)
             {
                 using (Stream resource = loader.OpenResource(modelName))
                 {
@@ -147,8 +143,7 @@ namespace Lucene.Net.Analysis.OpenNlp.Tools
 
         public static TokenNameFinderModel GetNERTaggerModel(string modelName, IResourceLoader
loader)
         {
-            nerModels.TryGetValue(modelName, out TokenNameFinderModel model);
-            if (model == null)
+            if (!nerModels.TryGetValue(modelName, out TokenNameFinderModel model) || model
== null)
             {
                 using (Stream resource = loader.OpenResource(modelName))
                 {
@@ -174,8 +169,7 @@ namespace Lucene.Net.Analysis.OpenNlp.Tools
 
         public static string GetLemmatizerDictionary(string dictionaryFile, IResourceLoader
loader)
         {
-            lemmaDictionaries.TryGetValue(dictionaryFile, out string dictionary);
-            if (dictionary == null)
+            if (!lemmaDictionaries.TryGetValue(dictionaryFile, out string dictionary) ||
dictionary == null)
             {
                 using (TextReader reader = new StreamReader(loader.OpenResource(dictionaryFile),
Encoding.UTF8))
                 {
@@ -199,8 +193,7 @@ namespace Lucene.Net.Analysis.OpenNlp.Tools
 
         public static LemmatizerModel GetLemmatizerModel(string modelName, IResourceLoader
loader)
         {
-            lemmatizerModels.TryGetValue(modelName, out LemmatizerModel model);
-            if (model == null)
+            if (!lemmatizerModels.TryGetValue(modelName, out LemmatizerModel model) || model
== null)
             {
                 using (Stream resource = loader.OpenResource(modelName))
                 {
diff --git a/src/Lucene.Net.Tests.Analysis.OpenNLP/TestOpenNLPChunkerFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.OpenNLP/TestOpenNLPChunkerFilterFactory.cs
index 0a0afc3..553a754 100644
--- a/src/Lucene.Net.Tests.Analysis.OpenNLP/TestOpenNLPChunkerFilterFactory.cs
+++ b/src/Lucene.Net.Tests.Analysis.OpenNLP/TestOpenNLPChunkerFilterFactory.cs
@@ -1,4 +1,4 @@
-using Lucene.Net.Analysis;
+// Lucene version compatibility level 8.2.0
 using Lucene.Net.Analysis.Payloads;
 using Lucene.Net.Analysis.Util;
 using NUnit.Framework;
diff --git a/src/Lucene.Net.Tests.Analysis.OpenNLP/TestOpenNLPLemmatizerFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.OpenNLP/TestOpenNLPLemmatizerFilterFactory.cs
index f249131..55b466a 100644
--- a/src/Lucene.Net.Tests.Analysis.OpenNLP/TestOpenNLPLemmatizerFilterFactory.cs
+++ b/src/Lucene.Net.Tests.Analysis.OpenNLP/TestOpenNLPLemmatizerFilterFactory.cs
@@ -1,11 +1,9 @@
-using Lucene.Net.Analysis.Miscellaneous;
+// Lucene version compatibility level 8.2.0
+using Lucene.Net.Analysis.Miscellaneous;
 using Lucene.Net.Analysis.Util;
 using NUnit.Framework;
 using System;
 using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 
 namespace Lucene.Net.Analysis.OpenNlp
 {
diff --git a/src/Lucene.Net.Tests.Analysis.OpenNLP/TestOpenNLPPOSFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.OpenNLP/TestOpenNLPPOSFilterFactory.cs
index 0d54d49..8af46cd 100644
--- a/src/Lucene.Net.Tests.Analysis.OpenNLP/TestOpenNLPPOSFilterFactory.cs
+++ b/src/Lucene.Net.Tests.Analysis.OpenNLP/TestOpenNLPPOSFilterFactory.cs
@@ -1,11 +1,11 @@
-using Lucene.Net.Analysis.Payloads;
+// Lucene version compatibility level 8.2.0
+using Lucene.Net.Analysis.Payloads;
 using Lucene.Net.Analysis.Util;
 using NUnit.Framework;
 using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
-using System.Threading.Tasks;
 
 namespace Lucene.Net.Analysis.OpenNlp
 {
diff --git a/src/Lucene.Net.Tests.Analysis.OpenNLP/TestOpenNLPSentenceBreakIterator.cs b/src/Lucene.Net.Tests.Analysis.OpenNLP/TestOpenNLPSentenceBreakIterator.cs
index ca6c3cc..1b2bf4d 100644
--- a/src/Lucene.Net.Tests.Analysis.OpenNLP/TestOpenNLPSentenceBreakIterator.cs
+++ b/src/Lucene.Net.Tests.Analysis.OpenNLP/TestOpenNLPSentenceBreakIterator.cs
@@ -1,4 +1,5 @@
-using ICU4N.Support.Text;
+// Lucene version compatibility level 8.2.0
+using ICU4N.Support.Text;
 using ICU4N.Text;
 using Lucene.Net.Analysis.OpenNlp.Tools;
 using Lucene.Net.Analysis.Util;
diff --git a/src/Lucene.Net.Tests.Analysis.OpenNLP/TestOpenNLPTokenizerFactory.cs b/src/Lucene.Net.Tests.Analysis.OpenNLP/TestOpenNLPTokenizerFactory.cs
index 51ae740..8c9d2cf 100644
--- a/src/Lucene.Net.Tests.Analysis.OpenNLP/TestOpenNLPTokenizerFactory.cs
+++ b/src/Lucene.Net.Tests.Analysis.OpenNLP/TestOpenNLPTokenizerFactory.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Analysis.Util;
+// Lucene version compatibility level 8.2.0
+using Lucene.Net.Analysis.Util;
 using NUnit.Framework;
 using System;
 using System.Collections.Generic;


Mime
View raw message