Lucene.Net.Analysis.Th refactor: member accessibility and documentation comments
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/69bd8518 Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/69bd8518 Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/69bd8518 Branch: refs/heads/api-work Commit: 69bd85188bbdeaa2dbbaef5b0dd0161ef2ca0e72 Parents: 0f3d7fb Author: Shad Storhaug <[email protected]> Authored: Sat Feb 4 14:19:21 2017 +0700 Committer: Shad Storhaug <[email protected]> Committed: Sat Feb 4 14:19:21 2017 +0700 ---------------------------------------------------------------------- .../Analysis/Th/ThaiAnalyzer.cs | 22 +++++++---------- .../Analysis/Th/ThaiTokenizer.cs | 25 +++++++++++--------- .../Analysis/Th/ThaiTokenizerFactory.cs | 6 ++--- .../Analysis/Th/ThaiWordFilter.cs | 17 +++++++------ .../Analysis/Th/ThaiWordFilterFactory.cs | 6 ++--- 5 files changed, 39 insertions(+), 37 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/69bd8518/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiAnalyzer.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiAnalyzer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiAnalyzer.cs index f143f90..440e4b1 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiAnalyzer.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiAnalyzer.cs @@ -25,20 +25,16 @@ namespace Lucene.Net.Analysis.Th */ /// <summary> - /// <see cref="Analyzer"/> for Thai language. It uses <see cref="java.text.BreakIterator"/> to break words. - /// <para> - /// <a name="version"/> - /// </para> + /// <see cref="Analyzer"/> for Thai language. It uses <see cref="Support.BreakIterator"/> to break words. /// <para>You must specify the required <see cref="LuceneVersion"/> - /// compatibility when creating ThaiAnalyzer: - /// <ul> - /// <li> As of 3.6, a set of Thai stopwords is used by default - /// </ul> + /// compatibility when creating <see cref="ThaiAnalyzer"/>: + /// <list type="bullet"> + /// <item> As of 3.6, a set of Thai stopwords is used by default</item> + /// </list> /// </para> /// </summary> public sealed class ThaiAnalyzer : StopwordAnalyzerBase { - /// <summary> /// File containing default Thai stopwords. </summary> public const string DEFAULT_STOPWORD_FILE = "stopwords.txt"; @@ -60,7 +56,7 @@ namespace Lucene.Net.Analysis.Th } /// <summary> - /// Atomically loads the DEFAULT_STOP_SET in a lazy fashion once the outer class + /// Atomically loads the <see cref="DEFAULT_STOP_SET"/> in a lazy fashion once the outer class /// accesses the static final set the first time.; /// </summary> private class DefaultSetHolder @@ -88,7 +84,7 @@ namespace Lucene.Net.Analysis.Th /// </summary> /// <param name="matchVersion"> lucene compatibility version </param> public ThaiAnalyzer(LuceneVersion matchVersion) - : this(matchVersion, + : this(matchVersion, #pragma warning disable 612, 618 matchVersion.OnOrAfter(LuceneVersion.LUCENE_36) ? #pragma warning restore 612, 618 @@ -102,14 +98,14 @@ namespace Lucene.Net.Analysis.Th /// <param name="matchVersion"> lucene compatibility version </param> /// <param name="stopwords"> a stopword set </param> public ThaiAnalyzer(LuceneVersion matchVersion, CharArraySet stopwords) - : base(matchVersion, stopwords) + : base(matchVersion, stopwords) { } /// <summary> /// Creates /// <see cref="Analyzer.TokenStreamComponents"/> - /// used to tokenize all the text in the provided <see cref="Reader"/>. + /// used to tokenize all the text in the provided <see cref="TextReader"/>. /// </summary> /// <returns> <see cref="Analyzer.TokenStreamComponents"/> /// built from a <see cref="StandardTokenizer"/> filtered with http://git-wip-us.apache.org/repos/asf/lucenenet/blob/69bd8518/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiTokenizer.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiTokenizer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiTokenizer.cs index 21287f2..2608fba 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiTokenizer.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiTokenizer.cs @@ -27,14 +27,17 @@ namespace Lucene.Net.Analysis.Th * See the License for the specific language governing permissions and * limitations under the License. */ + + // LUCENENET NOTE: Removing this notice from the doc comment because it is not relevant for our purposes. + + // <para>WARNING: this tokenizer may not be supported by all JREs. + // It is known to work with Sun/Oracle and Harmony JREs. + // If your application needs to be fully portable, consider using ICUTokenizer instead, + // which uses an ICU Thai BreakIterator that will always be available. + // </para> /// <summary> /// Tokenizer that use <see cref="BreakIterator"/> to tokenize Thai text. - /// <para>WARNING: this tokenizer may not be supported by all JREs. - /// It is known to work with Sun/Oracle and Harmony JREs. - /// If your application needs to be fully portable, consider using ICUTokenizer instead, - /// which uses an ICU Thai BreakIterator that will always be available. - /// </para> /// </summary> public class ThaiTokenizer : SegmentingTokenizerBase { @@ -54,23 +57,23 @@ namespace Lucene.Net.Analysis.Th private readonly ThaiWordBreaker wordBreaker; private readonly CharArrayIterator wrapper = CharArrayIterator.NewWordInstance(); - internal int sentenceStart; - internal int sentenceEnd; + private int sentenceStart; + private int sentenceEnd; private readonly ICharTermAttribute termAtt; private readonly IOffsetAttribute offsetAtt; /// <summary> - /// Creates a new ThaiTokenizer </summary> + /// Creates a new <see cref="ThaiTokenizer"/> </summary> public ThaiTokenizer(TextReader reader) - : this(AttributeFactory.DEFAULT_ATTRIBUTE_FACTORY, reader) + : this(AttributeFactory.DEFAULT_ATTRIBUTE_FACTORY, reader) { } /// <summary> - /// Creates a new ThaiTokenizer, supplying the AttributeFactory </summary> + /// Creates a new <see cref="ThaiTokenizer"/>, supplying the <see cref="Lucene.Net.Util.AttributeSource.AttributeFactory"/> </summary> public ThaiTokenizer(AttributeFactory factory, TextReader reader) - : base(factory, reader, new IcuBreakIterator(Icu.BreakIterator.UBreakIteratorType.SENTENCE, new CultureInfo("th"))) + : base(factory, reader, new IcuBreakIterator(Icu.BreakIterator.UBreakIteratorType.SENTENCE, new CultureInfo("th"))) { if (!DBBI_AVAILABLE) { http://git-wip-us.apache.org/repos/asf/lucenenet/blob/69bd8518/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiTokenizerFactory.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiTokenizerFactory.cs b/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiTokenizerFactory.cs index 67a1388..99a9839 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiTokenizerFactory.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiTokenizerFactory.cs @@ -33,10 +33,10 @@ namespace Lucene.Net.Analysis.Th /// </summary> public class ThaiTokenizerFactory : TokenizerFactory { - /// <summary> - /// Creates a new ThaiTokenizerFactory </summary> - public ThaiTokenizerFactory(IDictionary<string, string> args) : base(args) + /// Creates a new <see cref="ThaiTokenizerFactory"/> </summary> + public ThaiTokenizerFactory(IDictionary<string, string> args) + : base(args) { if (args.Count > 0) { http://git-wip-us.apache.org/repos/asf/lucenenet/blob/69bd8518/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiWordFilter.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiWordFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiWordFilter.cs index 8387639..3da11a2 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiWordFilter.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiWordFilter.cs @@ -27,19 +27,22 @@ namespace Lucene.Net.Analysis.Th * limitations under the License. */ + // LUCENENET NOTE: Removing this notice from the doc comment because it is not relevant for our purposes. + + //<para>WARNING: this filter may not be supported by all JREs. + // It is known to work with Sun/Oracle and Harmony JREs. + // If your application needs to be fully portable, consider using ICUTokenizer instead, + // which uses an ICU Thai BreakIterator that will always be available. + // </para> + /// <summary> - /// <see cref="TokenFilter"/> that use <see cref="java.text.BreakIterator"/> to break each + /// <see cref="TokenFilter"/> that use <see cref="Support.BreakIterator"/> to break each /// Token that is Thai into separate Token(s) for each Thai word. /// <para>Please note: Since matchVersion 3.1 on, this filter no longer lowercases non-thai text. /// <see cref="ThaiAnalyzer"/> will insert a <see cref="LowerCaseFilter"/> before this filter /// so the behaviour of the Analyzer does not change. With version 3.1, the filter handles /// position increments correctly. /// </para> - /// <para>WARNING: this filter may not be supported by all JREs. - /// It is known to work with Sun/Oracle and Harmony JREs. - /// If your application needs to be fully portable, consider using ICUTokenizer instead, - /// which uses an ICU Thai BreakIterator that will always be available. - /// </para> /// </summary> /// @deprecated Use <see cref="ThaiTokenizer"/> instead. [Obsolete("Use ThaiTokenizer instead.")] @@ -66,7 +69,7 @@ namespace Lucene.Net.Analysis.Th private bool hasIllegalOffsets = false; // only if the length changed before this filter /// <summary> - /// Creates a new ThaiWordFilter with the specified match version. </summary> + /// Creates a new <see cref="ThaiWordFilter"/> with the specified match version. </summary> public ThaiWordFilter(LuceneVersion matchVersion, TokenStream input) : base(matchVersion.OnOrAfter(LuceneVersion.LUCENE_31) ? input : new LowerCaseFilter(matchVersion, input)) { http://git-wip-us.apache.org/repos/asf/lucenenet/blob/69bd8518/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiWordFilterFactory.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiWordFilterFactory.cs b/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiWordFilterFactory.cs index 6b289f9..d0300be 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiWordFilterFactory.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Th/ThaiWordFilterFactory.cs @@ -29,14 +29,14 @@ namespace Lucene.Net.Analysis.Th /// <tokenizer class="solr.StandardTokenizerFactory"/> /// <filter class="solr.ThaiWordFilterFactory"/> /// </analyzer> - /// </fieldType></code> </summary> + /// </fieldType></code> + /// </summary> /// @deprecated Use <see cref="ThaiTokenizerFactory"/> instead [Obsolete("Use ThaiTokenizerFactory instead")] public class ThaiWordFilterFactory : TokenFilterFactory { - /// <summary> - /// Creates a new ThaiWordFilterFactory </summary> + /// Creates a new <see cref="ThaiWordFilterFactory"/> </summary> public ThaiWordFilterFactory(IDictionary<string, string> args) : base(args) { AssureMatchVersion();
