GitHub user NightOwl888 opened a pull request:
https://github.com/apache/lucenenet/pull/189
Fixed 24 Failing Analaysis Tests + Completed CharArraySet/CharArrayMap
Implementation
This fixes the 23 Analysis tests that were failing all of the time, and 1
test that was failing about 10% of the time.
> NOTE: This includes the commits from #185.
Also, the CharArraySet and CharArrayMap classes were refactored:
1. An `ICharArrayMap` interface was introduced to allow CharArraySet to
hold a reference to CharArrayMap without knowing its generic type.
2. A `MapValue` class was introduced to emulate Java's ability to put an
`object()` instance into a generic type, whose only purpose is to make the
value non-null (since null has a special meaning and default(TValue) would
break the null check anyway if we were dealing with value types).
3. A `ValueCollection` class and `ValueEnumerator` class were introduced to
house the logic that converts the `MapValue` to a real value, and to override
the `ToString()` method to output the correct representation of the data for
the tests.
4. A similar `KeyCollection` and `KeyEnumerator` were introduced to break
the infinite recursion between CharArraySet/CharArrayMap without consuming RAM.
5. Overloads were created for all main methods of CharArrayMap and
CharArraySet for `char[]`, `ICharSequence`, `string` and `object`.
6. Extension methods were created for the main methods for string-able
value types, converting them to strings automatically using the invariant
culture.
7. The generic closing type of CharArrayMap and CharArraySet was changed
from object to string (similar to how it was done in Lucene.Net 3.0.3).
8. Added a `CharArrayMap` class to house the static methods and public
classes of `CharArrayMap<TValue>` so they can be accessed without specifying a
generic class type for CharArrayMap (`CharArrayMap.Copy(x)` rather than
`CharArrayMap<object>.Copy(x)`).
> NOTE: I know this looks a lot like a .NET 1.0 type with all of the
overloads, but I ran some experiments and determined that it is 11x - 17x
faster to do have several overloads than to have a single overload (whether it
is generic or object) that checks the type and takes the appropriate action.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/NightOwl888/lucenenet analysis-bugz
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/lucenenet/pull/189.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #189
----
commit c67366fd4b383c31971a8ae68b458dec7aee2d7f
Author: Shad Storhaug <[email protected]>
Date: 2016-09-05T14:25:35Z
Setup InternalsVisibleTo Lucene.Net.Core <- Lucene.Net.Tests for testing.
commit b56ebc22bb06fddc941b467d8310cfd735e5f9e9
Author: Shad Storhaug <[email protected]>
Date: 2016-09-06T06:17:13Z
Setup InternalsVisibleTo Lucene.Net.TestFramework <- Lucene.Net.Tests for
testing.
commit 243ada716c47dafeaf8d2aa39c9ebd8f4c0e8bd7
Author: Shad Storhaug <[email protected]>
Date: 2016-09-05T11:21:23Z
Fixed bugs in FST that were causing test failures and Debug.Assert failures
in Misc.Util.Fst.
commit 9a562204f973b8380ead3ed89fc3ee527fa904a9
Author: Shad Storhaug <[email protected]>
Date: 2016-09-05T12:21:45Z
Ported Core.Util.Fst.TestBytesStore
commit 297f92653a0e8e64c25b171444ca18f0387f190a
Author: Shad Storhaug <[email protected]>
Date: 2016-09-06T07:18:19Z
.NETify FST: Public member names should be PascalCase.
commit 3da18fb7d9101d42fedc5932fb22afc7254c52a4
Author: Shad Storhaug <[email protected]>
Date: 2016-09-06T11:55:43Z
Ported Core.Util.Fst.TestFSTs
commit 5effb005955f357825cb9447f186b221a8d63cb7
Author: Shad Storhaug <[email protected]>
Date: 2016-09-06T19:01:26Z
Ported Core.Util.Packed.TestPackedInts
commit 510413ce4b99d15a79a70d876e5f89ca657dc193
Author: Shad Storhaug <[email protected]>
Date: 2016-09-07T09:18:17Z
.NETify FST: Changed Final, Last, Compiled, and Reversed() to IsFinal,
IsLast, IsCompiled, and IsReversed to make it clear that they are boolean
states.
commit dfa23109cbe204fa9339e7d4ab23f854c18b46c9
Author: Shad Storhaug <[email protected]>
Date: 2016-09-07T09:49:13Z
Removed duplicate (hidden) class definitions in FST.
commit b8db797ba917041dabe034e3ddf5960dd14fc04a
Author: Shad Storhaug <[email protected]>
Date: 2016-09-07T10:28:33Z
.NETify FST: Private/protected fields should be camelCase.
commit 18f84437970c1cc0d16312952a4e6726d35f97df
Author: Shad Storhaug <[email protected]>
Date: 2016-09-07T10:30:10Z
.NETify FST: Interfaces should start with "I"
commit 3994051b243f9e4a39cdda107ac8c6d1d68a78e2
Author: Shad Storhaug <[email protected]>
Date: 2016-09-07T11:07:43Z
Moved BytesRefFSTEnum<T>.InputOutput<T> and
IntsRefFSTEnum<T>.InputOutput<T> classes into non-generic classes with the same
name so we don't need to specify the generic type twice.
commit 0ccb5b65809ad6b341b3b04fcdfb43c58e53aff5
Author: Shad Storhaug <[email protected]>
Date: 2016-09-07T11:17:58Z
Normalized FST license headers
commit 01e903b1022cf13d708d8c1b5502047ebf704459
Author: Shad Storhaug <[email protected]>
Date: 2016-09-07T20:11:08Z
Refactored FST class to disallow the verbose and confusing FST<T>.Arc<T>
syntax, favoring FST.Arc<T>.
commit 8617aa9997568d9fc72743f68784b60f9d2ddbd2
Author: Shad Storhaug <[email protected]>
Date: 2016-09-07T17:06:47Z
Fixed infinite recursion issue and key not found bugs in the FSTTester
commit d807eeba7a8cdbb3efc54a00e12312ea0f11b308
Author: Shad Storhaug <[email protected]>
Date: 2016-09-07T17:46:08Z
Core.Util.Fst.TestFSTs: Fixed infinite recursion bug in TestRealTerms().
Use Environment.TickCount rather than DateTime.Now.Millisecond when doing time
sensitive testing.
commit 32e2105bba349544c3166d30f664ef7edd219a3a
Author: Shad Storhaug <[email protected]>
Date: 2016-09-07T19:19:29Z
TestFSTs: Added LongRunningTest and Ignore attributes for applicable tests.
commit ef889cebdeaa180d0bb232afd8e5ab3865cd41bc
Author: Shad Storhaug <[email protected]>
Date: 2016-09-07T22:23:58Z
Fixed issue with SortedSet not being emptied in Core.Util.Fst.Util, and
added thread safety, since SortedSet doesn't have the necessary atomic
operations.
commit b1203e6b4cb9551fe09999114890e74e77cb6937
Author: Shad Storhaug <[email protected]>
Date: 2016-09-10T10:53:32Z
Ported StressRamUsageEstimator & TestRamUsageEstimator + fixed bugs in
RamUsageEstimator
commit 878080dcd9d7aa5d705e8fce6d3d6cdad20dfeff
Author: Shad Storhaug <[email protected]>
Date: 2016-09-10T10:55:00Z
Added timeout to long running test (~45 sec) in
Core.Util.Packed.TestPackedInts
commit 0c2f5ae9a89eb29ce35835773e308235a5a91579
Author: Shad Storhaug <[email protected]>
Date: 2016-09-10T17:02:22Z
Ported Core.Util.TestIdentityHashSet + fixed bugs in
RamUsageEstimator.IdentityHashSet.
commit 3b18a74a95c21ee4174fcd87c16bea5fe05d6752
Author: Shad Storhaug <[email protected]>
Date: 2016-09-10T19:22:30Z
Ported Core.Util.TestWeakIdentityMap (partially)
commit e659c99328f5cfd7089166ec6ed30fd98294905e
Author: Shad Storhaug <[email protected]>
Date: 2016-09-10T19:23:03Z
Fixed String.Format bug in Core.Util.NamedThreadFactory
commit e9e4425adbf39d70153c4888929820b4468d8dda
Author: Shad Storhaug <[email protected]>
Date: 2016-09-10T19:43:25Z
Ported Core.TestDemo
commit 2c3dbc639d30c39807ffdcbf0edc1689bd64b19f
Author: Shad Storhaug <[email protected]>
Date: 2016-09-10T20:09:02Z
Ported Core.TestSearch
commit 0e77936c82232bbcea94dcc1f59e98fc7961fa6a
Author: Shad Storhaug <[email protected]>
Date: 2016-09-10T20:19:31Z
Ported Core.TestSearchForDuplicates
commit f4819a3e4902fd7c257f70068e511145cbc031e4
Author: Shad Storhaug <[email protected]>
Date: 2016-09-10T20:59:31Z
Ported Core.TestExternalCodes + fixed bugs that were preventing it from
running.
commit 4b4485bee1984f66c871418fc7266453c96e1095
Author: Shad Storhaug <[email protected]>
Date: 2016-09-10T21:08:30Z
Moved tests from namespace Lucene.Net.Document to Lucene.Net.Documents so
we don't have conflicts with the Document type and cleaned up headers.
commit c031b600cf3fe1bb44754a65384d20008dcdfc90
Author: Shad Storhaug <[email protected]>
Date: 2016-09-10T21:17:21Z
Ported Core.TestMergeSchedulerExternal
commit 202c06875743cdec1ba2d8903ee3337479f65354
Author: Shad Storhaug <[email protected]>
Date: 2016-09-10T22:28:54Z
Finished implementing ignored
Classification.SimpleNaiveBayesClassifierTest.TestNGramUsage()
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---