Skip to content

Commit

Permalink
BREAKING: Factored out Character, ICharSequence, StringBuilderCharSeq…
Browse files Browse the repository at this point in the history
…uenceWrapper, StringBuilderExtensions, StringCharSequenceWrapper, and most StringExtensions methods in favor of J2N's implementation
  • Loading branch information
NightOwl888 committed Jan 23, 2020
1 parent 236ebea commit b733c4d
Show file tree
Hide file tree
Showing 223 changed files with 1,083 additions and 2,494 deletions.
34 changes: 17 additions & 17 deletions src/Lucene.Net.Analysis.Common/Analysis/Ar/ArabicLetterTokenizer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Lucene.Net.Analysis.Core;
using Lucene.Net.Support;
using J2N;
using Lucene.Net.Analysis.Core;
using Lucene.Net.Util;
using System;
using System.Globalization;
Expand All @@ -8,21 +8,21 @@
namespace Lucene.Net.Analysis.Ar
{
/*
* 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.
*/
* 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.
*/

/// <summary>
/// Tokenizer that breaks text into runs of letters and diacritics.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Lucene.Net.Analysis.Util;
using Lucene.Net.Support;
using J2N;
using Lucene.Net.Analysis.Util;
using Lucene.Net.Util;
using System;
using System.Collections.Generic;
Expand All @@ -10,21 +10,21 @@
namespace Lucene.Net.Analysis.CharFilters
{
/*
* 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.
*/
* 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.
*/

/// <summary>
/// A <see cref="CharFilter"/> that wraps another <see cref="TextReader"/> and attempts to strip out HTML constructs.
Expand Down Expand Up @@ -31393,8 +31393,8 @@ private int NextChar()
{
outputSegment = entitySegment;
outputSegment.Clear();
if (codePoint >= Character.MIN_SURROGATE
&& codePoint <= Character.MAX_SURROGATE)
if (codePoint >= Character.MinSurrogate
&& codePoint <= Character.MaxSurrogate)
{
outputSegment.UnsafeWrite(REPLACEMENT_CHARACTER);
}
Expand Down Expand Up @@ -31653,8 +31653,8 @@ string hexCharRef
{
outputSegment = entitySegment;
outputSegment.Clear();
if (codePoint >= Character.MIN_SURROGATE
&& codePoint <= Character.MAX_SURROGATE)
if (codePoint >= Character.MinSurrogate
&& codePoint <= Character.MaxSurrogate)
{
outputSegment.UnsafeWrite(REPLACEMENT_CHARACTER);
}
Expand Down
34 changes: 17 additions & 17 deletions src/Lucene.Net.Analysis.Common/Analysis/Cjk/CJKBigramFilter.cs
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
using Lucene.Net.Analysis.Standard;
using J2N;
using Lucene.Net.Analysis.Standard;
using Lucene.Net.Analysis.TokenAttributes;
using Lucene.Net.Support;
using Lucene.Net.Util;

namespace Lucene.Net.Analysis.Cjk
{
/*
* 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.
*/
* 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.
*/

// LUCENENET specific - converted constants from CJKBigramFilter
// into a flags enum.
Expand Down
34 changes: 17 additions & 17 deletions src/Lucene.Net.Analysis.Common/Analysis/Cjk/CJKTokenizer.cs
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
using Lucene.Net.Analysis.TokenAttributes;
using Lucene.Net.Support;
using J2N;
using Lucene.Net.Analysis.TokenAttributes;
using System;
using System.IO;
using System.Text.RegularExpressions;

namespace Lucene.Net.Analysis.Cjk
{
/*
* 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.
*/
* 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.
*/

/// <summary>
/// CJKTokenizer is designed for Chinese, Japanese, and Korean languages.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Lucene.Net.Analysis.TokenAttributes;
using J2N.Text;
using Lucene.Net.Analysis.TokenAttributes;
using Lucene.Net.Analysis.Util;
using Lucene.Net.Support;
using Lucene.Net.Util;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down Expand Up @@ -181,7 +181,7 @@ protected class CompoundToken
/// Construct the compound token based on a slice of the current <see cref="CompoundWordTokenFilterBase.m_termAtt"/>. </summary>
public CompoundToken(CompoundWordTokenFilterBase outerInstance, int offset, int length)
{
this.txt = outerInstance.m_termAtt.SubSequence(offset, offset + length);
this.txt = outerInstance.m_termAtt.Subsequence(offset, length); // LUCENENET: Corrected 2nd Subsequence parameter

// offsets of the original word
int startOff = outerInstance.m_offsetAtt.StartOffset;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Lucene.Net.Analysis.Util;
using Lucene.Net.Support;
using J2N;
using Lucene.Net.Analysis.Util;
using Lucene.Net.Util;
using System.IO;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Lucene.Net.Support;
using J2N;
using Lucene.Net.Util;
using System.IO;

Expand Down
34 changes: 17 additions & 17 deletions src/Lucene.Net.Analysis.Common/Analysis/El/GreekLowerCaseFilter.cs
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
using Lucene.Net.Analysis.TokenAttributes;
using J2N;
using Lucene.Net.Analysis.TokenAttributes;
using Lucene.Net.Analysis.Util;
using Lucene.Net.Support;
using Lucene.Net.Util;

namespace Lucene.Net.Analysis.El
{
/*
* 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.
*/
* 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.
*/

/// <summary>
/// Normalizes token text to lower case, removes some Greek diacritics,
Expand Down
4 changes: 2 additions & 2 deletions src/Lucene.Net.Analysis.Common/Analysis/En/KStemmer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Lucene.Net.Analysis.Util;
using Lucene.Net.Support;
using J2N.Text;
using Lucene.Net.Analysis.Util;
using Lucene.Net.Util;
using System;

Expand Down
34 changes: 17 additions & 17 deletions src/Lucene.Net.Analysis.Common/Analysis/Ga/IrishLowerCaseFilter.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
using Lucene.Net.Analysis.TokenAttributes;
using Lucene.Net.Support;
using J2N;
using Lucene.Net.Analysis.TokenAttributes;

namespace Lucene.Net.Analysis.Ga
{
/*
* 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.
*/
* 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.
*/

/// <summary>
/// Normalises token text to lower case, handling t-prothesis
Expand Down
32 changes: 17 additions & 15 deletions src/Lucene.Net.Analysis.Common/Analysis/Hunspell/Dictionary.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using J2N.Collections.Generic.Extensions;
using J2N.Text;
using Lucene.Net.Store;
using Lucene.Net.Support;
using Lucene.Net.Support.IO;
using Lucene.Net.Util;
using Lucene.Net.Util.Automaton;
using Lucene.Net.Util.Fst;
using J2N;
using System;
using System.Collections.Generic;
using System.Diagnostics;
Expand All @@ -17,21 +19,21 @@
namespace Lucene.Net.Analysis.Hunspell
{
/*
* 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.
*/
* 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.
*/

/// <summary>
/// In-memory structure for the dictionary (.dic) and affix (.aff)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Lucene.Net.Analysis.Util;
using Lucene.Net.Support;
using J2N.Text;
using Lucene.Net.Analysis.Util;
using Lucene.Net.Util;
using System;
using System.Collections.Generic;
Expand Down
4 changes: 2 additions & 2 deletions src/Lucene.Net.Analysis.Common/Analysis/In/IndicTokenizer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Lucene.Net.Analysis.Util;
using Lucene.Net.Support;
using J2N;
using Lucene.Net.Analysis.Util;
using Lucene.Net.Util;
using System;
using System.Globalization;
Expand Down

0 comments on commit b733c4d

Please sign in to comment.