You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2017/02/02 12:42:40 UTC
[09/14] lucenenet git commit:
Lucene.Net.Tests.Analysis.Common.Miscellaneous: Added missing
TestKeywordRepeatFilter tests
Lucene.Net.Tests.Analysis.Common.Miscellaneous: Added missing TestKeywordRepeatFilter tests
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/5d556167
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/5d556167
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/5d556167
Branch: refs/heads/api-work
Commit: 5d556167073782c27cd50d857759b0a5b9d0fa3e
Parents: ddb054a
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Thu Feb 2 15:48:28 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Thu Feb 2 18:30:34 2017 +0700
----------------------------------------------------------------------
.../Miscellaneous/TestKeywordRepeatFilter.cs | 46 +++++++++-----------
.../Lucene.Net.Tests.Analysis.Common.csproj | 1 +
.../project.json | 3 +-
3 files changed, 23 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/5d556167/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestKeywordRepeatFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestKeywordRepeatFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestKeywordRepeatFilter.cs
index e9674ba..ef977fd 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestKeywordRepeatFilter.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestKeywordRepeatFilter.cs
@@ -1,7 +1,9 @@
-\ufeffnamespace org.apache.lucene.analysis.miscellaneous
-{
+\ufeffusing NUnit.Framework;
+using System.IO;
- /*
+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.
@@ -18,31 +20,25 @@
* limitations under the License.
*/
- using SnowballFilter = org.apache.lucene.analysis.snowball.SnowballFilter;
-
-
- public class TestKeywordRepeatFilter : BaseTokenStreamTestCase
- {
-
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: public void testBasic() throws java.io.IOException
- public virtual void testBasic()
- {
- TokenStream ts = new RemoveDuplicatesTokenFilter(new SnowballFilter(new KeywordRepeatFilter(new MockTokenizer(new StringReader("the birds are flying"), MockTokenizer.WHITESPACE, false)), "English"));
- assertTokenStreamContents(ts, new string[] {"the", "birds", "bird", "are", "flying", "fli"}, new int[] {1,1,0,1,1,0});
- }
-
+ using SnowballFilter = Lucene.Net.Analysis.Snowball.SnowballFilter;
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: public void testComposition() throws java.io.IOException
- public virtual void testComposition()
- {
- TokenStream ts = new RemoveDuplicatesTokenFilter(new SnowballFilter(new KeywordRepeatFilter(new KeywordRepeatFilter(new MockTokenizer(new StringReader("the birds are flying"), MockTokenizer.WHITESPACE, false))), "English"));
- assertTokenStreamContents(ts, new string[] {"the", "birds", "bird", "are", "flying", "fli"}, new int[] {1,1,0,1,1,0});
- }
+ public class TestKeywordRepeatFilter : BaseTokenStreamTestCase
+ {
+ [Test]
+ public virtual void TestBasic()
+ {
+ TokenStream ts = new RemoveDuplicatesTokenFilter(new SnowballFilter(new KeywordRepeatFilter(new MockTokenizer(new StringReader("the birds are flying"), MockTokenizer.WHITESPACE, false)), "English"));
+ AssertTokenStreamContents(ts, new string[] { "the", "birds", "bird", "are", "flying", "fli" }, new int[] { 1, 1, 0, 1, 1, 0 });
+ }
- }
+ [Test]
+ public virtual void TestComposition()
+ {
+ TokenStream ts = new RemoveDuplicatesTokenFilter(new SnowballFilter(new KeywordRepeatFilter(new KeywordRepeatFilter(new MockTokenizer(new StringReader("the birds are flying"), MockTokenizer.WHITESPACE, false))), "English"));
+ AssertTokenStreamContents(ts, new string[] { "the", "birds", "bird", "are", "flying", "fli" }, new int[] { 1, 1, 0, 1, 1, 0 });
+ }
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/5d556167/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.csproj b/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.csproj
index b5587d0..0bd31c1 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.csproj
+++ b/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.csproj
@@ -195,6 +195,7 @@
<Compile Include="Analysis\Miscellaneous\TestKeepWordFilter.cs" />
<Compile Include="Analysis\Miscellaneous\TestKeywordMarkerFilter.cs" />
<Compile Include="Analysis\Miscellaneous\TestKeywordMarkerFilterFactory.cs" />
+ <Compile Include="Analysis\Miscellaneous\TestKeywordRepeatFilter.cs" />
<Compile Include="Analysis\Miscellaneous\TestLengthFilter.cs" />
<Compile Include="Analysis\Miscellaneous\TestLengthFilterFactory.cs" />
<Compile Include="Analysis\Miscellaneous\TestLimitTokenCountAnalyzer.cs" />
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/5d556167/src/Lucene.Net.Tests.Analysis.Common/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/project.json b/src/Lucene.Net.Tests.Analysis.Common/project.json
index b621d6e..46a3833 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/project.json
+++ b/src/Lucene.Net.Tests.Analysis.Common/project.json
@@ -100,8 +100,7 @@
"excludeFiles": [
"DateTimeHelperClass.cs",
"HashMapHelperClass.cs",
- "StringHelperClass.cs",
- "Analysis/Miscellaneous/TestKeywordRepeatFilter.cs"
+ "StringHelperClass.cs"
]
}
},