lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [47/58] lucenenet git commit: QueryParser: Fixed documentation comments
Date Tue, 06 Dec 2016 15:12:22 GMT
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ced03f59/src/Lucene.Net.QueryParser/Surround/Parser/ParseException.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Surround/Parser/ParseException.cs b/src/Lucene.Net.QueryParser/Surround/Parser/ParseException.cs
index 6f7ed81..64e6113 100644
--- a/src/Lucene.Net.QueryParser/Surround/Parser/ParseException.cs
+++ b/src/Lucene.Net.QueryParser/Surround/Parser/ParseException.cs
@@ -35,20 +35,17 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
         /// <summary>
         /// This constructor is used by the method "GenerateParseException"
         /// in the generated parser.  Calling this constructor generates
-        /// a new object of this type with the fields "currentToken",
-        /// "expectedTokenSequences", and "tokenImage" set.
+        /// a new object of this type with the fields <paramref name="currentToken"/>,
+        /// <paramref name="expectedTokenSequences"/>, and <paramref name="tokenImage"/>
set.
         /// </summary>
-        /// <param name="currentTokenVal"></param>
-        /// <param name="expectedTokenSequencesVal"></param>
-        /// <param name="tokenImageVal"></param>
-        public ParseException(Token currentTokenVal,
-                        int[][] expectedTokenSequencesVal,
-                        string[] tokenImageVal)
-            : base(Initialize(currentTokenVal, expectedTokenSequencesVal, tokenImageVal))
+        public ParseException(Token currentToken,
+                        int[][] expectedTokenSequences,
+                        string[] tokenImage)
+            : base(Initialize(currentToken, expectedTokenSequences, tokenImage))
         {
-            currentToken = currentTokenVal;
-            expectedTokenSequences = expectedTokenSequencesVal;
-            tokenImage = tokenImageVal;
+            this.currentToken = currentToken;
+            this.expectedTokenSequences = expectedTokenSequences;
+            this.tokenImage = tokenImage;
         }
 
         /**
@@ -96,16 +93,12 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
 
 
         /// <summary>
-        /// It uses "currentToken" and "expectedTokenSequences" to generate a parse
+        /// It uses <paramref name="currentToken"/> and <paramref name="expectedTokenSequences"/>
to generate a parse
         /// error message and returns it.  If this object has been created
         /// due to a parse error, and you do not catch it (it gets thrown
         /// from the parser) the correct error message
         /// gets displayed.
         /// </summary>
-        /// <param name="currentToken"></param>
-        /// <param name="expectedTokenSequences"></param>
-        /// <param name="tokenImage"></param>
-        /// <returns></returns>
         private static string Initialize(Token currentToken,
             int[][] expectedTokenSequences,
             string[] tokenImage)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ced03f59/src/Lucene.Net.QueryParser/Surround/Parser/QueryParser.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Surround/Parser/QueryParser.cs b/src/Lucene.Net.QueryParser/Surround/Parser/QueryParser.cs
index bdab9ca..b1c2fe1 100644
--- a/src/Lucene.Net.QueryParser/Surround/Parser/QueryParser.cs
+++ b/src/Lucene.Net.QueryParser/Surround/Parser/QueryParser.cs
@@ -24,27 +24,32 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
 
     /// <summary>
     /// This class is generated by JavaCC.  The only method that clients should need
-    /// to call is {@link #parse parse()}.
+    /// to call is <see cref="Parse(string)"/>.
     ///
-
-    /// <p>This parser generates queries that make use of position information
-    ///   (Span queries). It provides positional operators (<code>w</code> and
-    ///   <code>n</code>) that accept a numeric distance, as well as boolean
-    ///   operators (<code>and</code>, <code>or</code>, and <code>not</code>,
-    ///   wildcards (<code>///</code> and <code>?</code>), quoting
(with
-    ///   <code>"</code>), and boosting (via <code>^</code>).</p>
-
-    ///  <p>The operators (W, N, AND, OR, NOT) can be expressed lower-cased or
-    ///   upper-cased, and the non-unary operators (everything but NOT) support
-    ///   both infix <code>(a AND b AND c)</code> and prefix <code>AND(a,
b,
-    ///   c)</code> notation. </p>
-
-    ///  <p>The W and N operators express a positional relationship among their
-    ///  operands.  N is ordered, and W is unordered.  The distance is 1 by
-    ///  default, meaning the operands are adjacent, or may be provided as a
-    ///  prefix from 2-99.  So, for example, 3W(a, b) means that terms a and b
-    ///  must appear within three positions of each other, or in other words, up
-    ///  to two terms may appear between a and b.  </p>
+    /// <para>
+    /// This parser generates queries that make use of position information
+    /// (Span queries). It provides positional operators (<c>w</c> and
+    /// <c>n</c>) that accept a numeric distance, as well as boolean
+    /// operators (<c>and</c>, <c>or</c>, and <c>not</c>,
+    /// wildcards (<c>///</c> and <c>?</c>), quoting (with
+    /// <c>"</c>), and boosting (via <c>^</c>).
+    /// </para>
+    ///
+    /// <para>
+    /// The operators (W, N, AND, OR, NOT) can be expressed lower-cased or
+    /// upper-cased, and the non-unary operators (everything but NOT) support
+    /// both infix <c>(a AND b AND c)</c> and prefix <c>AND(a, b,
+    /// c)</c> notation.
+    /// </para>
+    ///
+    /// <para>
+    /// The W and N operators express a positional relationship among their
+    /// operands.  N is ordered, and W is unordered.  The distance is 1 by
+    /// default, meaning the operands are adjacent, or may be provided as a
+    /// prefix from 2-99.  So, for example, 3W(a, b) means that terms a and b
+    /// must appear within three positions of each other, or in other words, up
+    /// to two terms may appear between a and b. 
+    /// </para>
     /// </summary>
     public class QueryParser
     {
@@ -586,11 +591,11 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
             return false;
         }
 
-        /** Generated Token Manager. */
+        /// <summary>Generated Token Manager.</summary>
         public QueryParserTokenManager token_source;
-        /** Current token. */
+        /// <summary>Current token.</summary>
         public Token token;
-        /** Next token. */
+        /// <summary>Next token.</summary>
         public Token jj_nt;
         private int jj_ntk;
         private Token jj_scanpos, jj_lastpos;
@@ -611,10 +616,7 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
         private bool jj_rescan = false;
         private int jj_gc = 0;
 
-        /// <summary>
-        /// Constructor with user supplied CharStream.
-        /// </summary>
-        /// <param name="stream"></param>
+        /// <summary>Constructor with user supplied <see cref="ICharStream"/>.</summary>
         public QueryParser(ICharStream stream)
         {
             token_source = new QueryParserTokenManager(stream);
@@ -625,10 +627,7 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
             for (int i = 0; i < jj_2_rtns.Length; i++) jj_2_rtns[i] = new JJCalls();
         }
 
-        /// <summary>
-        /// Reinitialise.
-        /// </summary>
-        /// <param name="stream"></param>
+        /// <summary>Reinitialize.</summary>
         public virtual void ReInit(ICharStream stream)
         {
             token_source.ReInit(stream);
@@ -639,10 +638,7 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
             for (int i = 0; i < jj_2_rtns.Length; i++) jj_2_rtns[i] = new JJCalls();
         }
 
-        /// <summary>
-        /// Constructor with generated Token Manager.
-        /// </summary>
-        /// <param name="tm"></param>
+        /// <summary>Constructor with generated Token Manager.</summary>
         public QueryParser(QueryParserTokenManager tm)
         {
             token_source = tm;
@@ -653,10 +649,7 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
             for (int i = 0; i < jj_2_rtns.Length; i++) jj_2_rtns[i] = new JJCalls();
         }
 
-        /// <summary>
-        /// Reinitialise.
-        /// </summary>
-        /// <param name="tm"></param>
+        /// <summary>Reinitialize.</summary>
         public virtual void ReInit(QueryParserTokenManager tm)
         {
             token_source = tm;
@@ -728,10 +721,7 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
             return false;
         }
 
-        /// <summary>
-        /// Get the next Token.
-        /// </summary>
-        /// <returns></returns>
+        /// <summary>Get the next Token.</summary>
         public Token GetNextToken()
         {
             if (token.next != null) token = token.next;
@@ -741,11 +731,7 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
             return token;
         }
 
-        /// <summary>
-        /// Get the specific Token.
-        /// </summary>
-        /// <param name="index"></param>
-        /// <returns></returns>
+        /// <summary>Get the specific Token.</summary>
         public Token GetToken(int index)
         {
             Token t = token;
@@ -806,10 +792,7 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
             }
         }
 
-        /// <summary>
-        /// Generate ParseException.
-        /// </summary>
-        /// <returns></returns>
+        /// <summary>Generate ParseException.</summary>
         public virtual ParseException GenerateParseException()
         {
             jj_expentries.Clear();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ced03f59/src/Lucene.Net.QueryParser/Surround/Parser/QueryParserTokenManager.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Surround/Parser/QueryParserTokenManager.cs b/src/Lucene.Net.QueryParser/Surround/Parser/QueryParserTokenManager.cs
index 36774f9..b83813b 100644
--- a/src/Lucene.Net.QueryParser/Surround/Parser/QueryParserTokenManager.cs
+++ b/src/Lucene.Net.QueryParser/Surround/Parser/QueryParserTokenManager.cs
@@ -26,18 +26,10 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
     /// </summary>
     public class QueryParserTokenManager //: QueryParserConstants
     {
-        private void InitBlock()
-        {
-            StreamWriter temp_writer;
-            temp_writer = new StreamWriter(Console.OpenStandardOutput(), Console.Out.Encoding);
-            temp_writer.AutoFlush = true;
-            debugStream = temp_writer;
-        }
-
         /// <summary>Debug output. </summary>
-        public StreamWriter debugStream;
+        public TextWriter debugStream;
         /// <summary>Set debug output. </summary>
-        public virtual void SetDebugStream(StreamWriter ds)
+        public virtual void SetDebugStream(TextWriter ds)
         {
             debugStream = ds;
         }
@@ -546,18 +538,19 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
         //    "\50", "\51", "\54", "\72", "\136", null, null, null, null, null, null 
         //};
 
+        /// <summary>Token literal values.</summary>
         public static readonly string[] jjstrLiteralImages = {
             "", null, null, null, null, null, null, null, null, null, null, null, null, 
             "\x0028" /*"\50"*/, "\x0029" /*"\51"*/, "\x002C" /*"\54"*/, "\x003A" /*"\72"*/,
"\x005E" /*"\136"*/, null, null, null, null, null, null 
         };
 
-        /** Lexer state names. */
+        /// <summary>Lexer state names.</summary>
         public static readonly string[] lexStateNames = {
            "Boost",
            "DEFAULT"
         };
 
-        /** Lex State array. */
+        /// <summary>Lex State array.</summary>
         public static readonly int[] jjnewLexState = {
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1,
-1, -1, -1, 1, 
         };
@@ -572,21 +565,20 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
         private readonly int[] jjstateSet = new int[76];
         protected internal char curChar;
 
-        /** Constructor. */
+        /// <summary>Constructor.</summary>
         public QueryParserTokenManager(ICharStream stream)
         {
-            InitBlock();
             input_stream = stream;
         }
 
-        /** Constructor. */
+        /// <summary>Constructor.</summary>
         public QueryParserTokenManager(ICharStream stream, int lexState)
             : this(stream)
         {
             SwitchTo(lexState);
         }
 
-        /** Reinitialise parser. */
+        /// <summary>Reinitialize parser.</summary>
         public void ReInit(ICharStream stream)
         {
             jjmatchedPos = jjnewStateCnt = 0;
@@ -602,14 +594,14 @@ namespace Lucene.Net.QueryParsers.Surround.Parser
                 jjrounds[i] = 0x80000000;
         }
 
-        /** Reinitialise parser. */
+        /// <summary>Reinitialize parser.</summary>
         public void ReInit(ICharStream stream, int lexState)
         {
             ReInit(stream);
             SwitchTo(lexState);
         }
 
-        /** Switch to specified lex state. */
+        /// <summary>Switch to specified lex state.</summary>
         public void SwitchTo(int lexState)
         {
             if (lexState >= 2 || lexState < 0)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ced03f59/src/Lucene.Net.QueryParser/Surround/Query/BasicQueryFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Surround/Query/BasicQueryFactory.cs b/src/Lucene.Net.QueryParser/Surround/Query/BasicQueryFactory.cs
index 523066d..e60e252 100644
--- a/src/Lucene.Net.QueryParser/Surround/Query/BasicQueryFactory.cs
+++ b/src/Lucene.Net.QueryParser/Surround/Query/BasicQueryFactory.cs
@@ -97,8 +97,6 @@ namespace Lucene.Net.QueryParsers.Surround.Query
         /// Two BasicQueryFactory's are equal when they generate
         /// the same types of basic queries, or both cannot generate queries anymore.
         /// </summary>
-        /// <param name="obj"></param>
-        /// <returns></returns>
         public override bool Equals(object obj)
         {
             if (!(obj is BasicQueryFactory))

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ced03f59/src/Lucene.Net.QueryParser/Surround/Query/DistanceSubQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Surround/Query/DistanceSubQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/DistanceSubQuery.cs
index c7357ee..9d79a78 100644
--- a/src/Lucene.Net.QueryParser/Surround/Query/DistanceSubQuery.cs
+++ b/src/Lucene.Net.QueryParser/Surround/Query/DistanceSubQuery.cs
@@ -24,9 +24,9 @@
     public interface IDistanceSubQuery
     {
         /// <summary>
-        /// When distanceSubQueryNotAllowed() returns non null, the reason why the subquery
+        /// When <see cref="DistanceSubQueryNotAllowed()"/> returns non null, the reason
why the subquery
         /// is not allowed as a distance subquery is returned.
-        /// <br>When distanceSubQueryNotAllowed() returns null addSpanNearQueries()
can be used
+        /// <para/>When <see cref="DistanceSubQueryNotAllowed()"/> returns null
<see cref="AddSpanQueries(SpanNearClauseFactory)"/> can be used
         /// in the creation of the span near clause for the subquery.
         /// </summary>
         string DistanceSubQueryNotAllowed();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ced03f59/src/Lucene.Net.QueryParser/Surround/Query/RewriteQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Surround/Query/RewriteQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/RewriteQuery.cs
index 89b8459..7c0ade0 100644
--- a/src/Lucene.Net.QueryParser/Surround/Query/RewriteQuery.cs
+++ b/src/Lucene.Net.QueryParser/Surround/Query/RewriteQuery.cs
@@ -76,7 +76,7 @@ namespace Lucene.Net.QueryParsers.Surround.Query
         /// <summary>
         /// Not supported by this query.
         /// </summary>
-        /// <exception cref="NotSupportedException">throws NotSupportedException always:
clone is not supported.</exception>
+        /// <exception cref="NotSupportedException">throws <see cref="NotSupportedException"/>
always: clone is not supported.</exception>
         public override object Clone()
         {
             throw new NotSupportedException();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ced03f59/src/Lucene.Net.QueryParser/Surround/Query/SimpleTerm.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Surround/Query/SimpleTerm.cs b/src/Lucene.Net.QueryParser/Surround/Query/SimpleTerm.cs
index ece27fe..8657092 100644
--- a/src/Lucene.Net.QueryParser/Surround/Query/SimpleTerm.cs
+++ b/src/Lucene.Net.QueryParser/Surround/Query/SimpleTerm.cs
@@ -74,7 +74,7 @@ namespace Lucene.Net.QueryParsers.Surround.Query
 
         /// <summary>
         /// Callback to visit each matching term during "rewrite"
-        /// in <see cref="M:VisitMatchingTerm(Term)"/>
+        /// in <see cref="VisitMatchingTerm(Term)"/>
         /// </summary>
         public interface IMatchingTermVisitor
         {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ced03f59/src/Lucene.Net.QueryParser/Surround/Query/SpanNearClauseFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Surround/Query/SpanNearClauseFactory.cs b/src/Lucene.Net.QueryParser/Surround/Query/SpanNearClauseFactory.cs
index 64ac626..7fba250 100644
--- a/src/Lucene.Net.QueryParser/Surround/Query/SpanNearClauseFactory.cs
+++ b/src/Lucene.Net.QueryParser/Surround/Query/SpanNearClauseFactory.cs
@@ -25,27 +25,29 @@ namespace Lucene.Net.QueryParsers.Surround.Query
 
     /// <summary>
     /// SpanNearClauseFactory:
-    /// 
+    /// <para/>
     /// Operations:
     /// 
-    /// - create for a field name and an indexreader.
+    /// <list type="bullet">
+    ///     <item>create for a field name and an indexreader.</item>
+    /// 
+    ///     <item>add a weighted Term - this should add a corresponding SpanTermQuery,
or increase the weight of an existing one.</item>
     /// 
-    /// - add a weighted Term
-    /// this should add a corresponding SpanTermQuery, or
-    /// increase the weight of an existing one.
-    /// - add a weighted subquery SpanNearQuery
+    ///     <item>add a weighted subquery SpanNearQuery</item>
     /// 
-    /// - create a clause for SpanNearQuery from the things added above.
+    ///     <item>create a clause for SpanNearQuery from the things added above.</item>
+    /// </list>
+    /// <para/>
     /// For this, create an array of SpanQuery's from the added ones.
     /// The clause normally is a SpanOrQuery over the added subquery SpanNearQuery
     /// the SpanTermQuery's for the added Term's
-    /// 
+    /// <para/>
     /// When  it is necessary to suppress double subqueries as much as possible:
     /// GetHashCode() and Equals() on unweighted SpanQuery are needed (possibly via GetTerms(),
     /// the terms are individually hashable).
     /// Idem SpanNearQuery: hash on the subqueries and the slop.
     /// Evt. merge SpanNearQuery's by adding the weights of the corresponding subqueries.
-    /// 
+    /// <para/>
     /// To be determined:
     /// Are SpanQuery weights handled correctly during search by Lucene?
     /// Should the resulting SpanOrQuery be sorted?

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ced03f59/src/Lucene.Net.QueryParser/Surround/Query/SrndQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Surround/Query/SrndQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/SrndQuery.cs
index 93930c3..198231f 100644
--- a/src/Lucene.Net.QueryParser/Surround/Query/SrndQuery.cs
+++ b/src/Lucene.Net.QueryParser/Surround/Query/SrndQuery.cs
@@ -71,10 +71,9 @@ namespace Lucene.Net.QueryParsers.Surround.Query
         public abstract Search.Query MakeLuceneQueryFieldNoBoost(string fieldName, BasicQueryFactory
qf);
 
         /// <summary>
-        /// This method is used by <see cref="M:GetHashCode()"/> and <see cref="M:Equals(Object)"/>,
+        /// This method is used by <see cref="GetHashCode()"/> and <see cref="Equals(Object)"/>,
         /// see LUCENE-2945.
         /// </summary>
-        /// <returns></returns>
         public abstract override string ToString();
 
         public virtual bool IsFieldsSubQueryAcceptable { get { return true; } }
@@ -97,9 +96,9 @@ namespace Lucene.Net.QueryParsers.Surround.Query
         }
 
         /// <summary>
-        /// For subclasses of <see cref="SrndQuery"/> within the package
-        /// {@link org.apache.lucene.queryparser.surround.query}
-        /// it is not necessary to override this method, <see cref="M:ToString()"/>
+        /// For subclasses of <see cref="SrndQuery"/> within the namespace
+        /// <see cref="Lucene.Net.QueryParsers.Surround.Query"/>
+        /// it is not necessary to override this method, <see cref="ToString()"/>
         /// </summary>
         public override int GetHashCode()
         {
@@ -107,13 +106,10 @@ namespace Lucene.Net.QueryParsers.Surround.Query
         }
 
         /// <summary>
-        /// For subclasses of <see cref="SrndQuery"/> within the package
-        /// {@link org.apache.lucene.queryparser.surround.query}
-        /// it is not necessary to override this method,
-        /// @see #toString()
+        /// For subclasses of <see cref="SrndQuery"/> within the namespace
+        /// <see cref="Lucene.Net.QueryParsers.Surround.Query"/>
+        /// it is not necessary to override this method, <see cref="ToString()"/>
         /// </summary>
-        /// <param name="obj"></param>
-        /// <returns></returns>
         public override bool Equals(object obj)
         {
             if (obj == null)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ced03f59/src/Lucene.Net.QueryParser/Surround/Query/SrndTruncQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Surround/Query/SrndTruncQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/SrndTruncQuery.cs
index 8c47b37..9453565 100644
--- a/src/Lucene.Net.QueryParser/Surround/Query/SrndTruncQuery.cs
+++ b/src/Lucene.Net.QueryParser/Surround/Query/SrndTruncQuery.cs
@@ -23,6 +23,9 @@ namespace Lucene.Net.QueryParsers.Surround.Query
      * limitations under the License.
      */
 
+    /// <summary>
+    /// Query that matches wildcards
+    /// </summary>
     public class SrndTruncQuery : SimpleTerm
     {
         public SrndTruncQuery(string truncated, char unlimited, char mask)


Mime
View raw message