Lucene - Core
  1. Lucene - Core
  2. LUCENE-5389

Even more doc for construction of TokenStream components

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.7, 6.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      There are more useful things to tell would-be authors of tokenizers. Let's tell them.

        Activity

        Show
        Benson Margulies added a comment - https://github.com/apache/lucene-solr/pull/14
        Hide
        Benson Margulies added a comment -

        Robert MuirI think that this is ready to go . If you commit this and merge down to 4.x, I can then tackle work on this file for the new stuff.

        Show
        Benson Margulies added a comment - Robert Muir I think that this is ready to go . If you commit this and merge down to 4.x, I can then tackle work on this file for the new stuff.
        Hide
        Robert Muir added a comment -

        Thanks Benson! I'll take a look at this in a bit.

        Show
        Robert Muir added a comment - Thanks Benson! I'll take a look at this in a bit.
        Hide
        Robert Muir added a comment -

        OK, i took a look. I had to make a fix for documentation-lint to pass, basically it didnt like the multiline {@code} element you had for the code sample, because 'javadoc' would give an error that it couldnt find the closing brace. Maybe the {@override} was messing it up. In general i've never used multiline {@code} before... Anyway i just made it consistent with other code samples by doing this:

        <pre class="prettyprint">
            public class ForwardingTokenizer extends Tokenizer {
               private Tokenizer delegate;
               ...
               {@literal @Override}
               public void reset() {
                  super.reset();
                  delegate.setReader(this.input);
                  delegate.reset();
               }
            }
          </pre>
        

        The class="prettyprint" gives colored syntax highlighting in the javadocs, and the override is escaped with literal. At least these are the way the others are done.

        I'm committing this. Do you want to make a patch to trunk-only to update the 5.x docs with respect to LUCENE-5388? Stuff like "(A future release of Apache Lucene may remove the reader parameters from the Tokenizer constructors.)"

        Thanks!

        Show
        Robert Muir added a comment - OK, i took a look. I had to make a fix for documentation-lint to pass, basically it didnt like the multiline {@code} element you had for the code sample, because 'javadoc' would give an error that it couldnt find the closing brace. Maybe the {@override} was messing it up. In general i've never used multiline {@code} before... Anyway i just made it consistent with other code samples by doing this: <pre class= "prettyprint" > public class ForwardingTokenizer extends Tokenizer { private Tokenizer delegate; ... {@literal @Override} public void reset() { super .reset(); delegate.setReader( this .input); delegate.reset(); } } </pre> The class="prettyprint" gives colored syntax highlighting in the javadocs, and the override is escaped with literal. At least these are the way the others are done. I'm committing this. Do you want to make a patch to trunk-only to update the 5.x docs with respect to LUCENE-5388 ? Stuff like "(A future release of Apache Lucene may remove the reader parameters from the Tokenizer constructors.)" Thanks!
        Hide
        ASF subversion and git services added a comment -

        Commit 1557010 from Robert Muir in branch 'dev/trunk'
        [ https://svn.apache.org/r1557010 ]

        LUCENE-5389: Add more guidance in the analyis documentation package overview (closes #14)

        Show
        ASF subversion and git services added a comment - Commit 1557010 from Robert Muir in branch 'dev/trunk' [ https://svn.apache.org/r1557010 ] LUCENE-5389 : Add more guidance in the analyis documentation package overview (closes #14)
        Hide
        ASF subversion and git services added a comment -

        Commit 1557011 from Robert Muir in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1557011 ]

        LUCENE-5389: Add more guidance in the analyis documentation package overview (closes #14)

        Show
        ASF subversion and git services added a comment - Commit 1557011 from Robert Muir in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1557011 ] LUCENE-5389 : Add more guidance in the analyis documentation package overview (closes #14)
        Hide
        Benson Margulies added a comment -

        Sorry, I forgot to lint after accepting the suggestion about delegation.

        Yes, I'll start making various next-step patches.

        Show
        Benson Margulies added a comment - Sorry, I forgot to lint after accepting the suggestion about delegation. Yes, I'll start making various next-step patches.
        Hide
        Robert Muir added a comment -

        No problem, thank you!

        Show
        Robert Muir added a comment - No problem, thank you!

          People

          • Assignee:
            Unassigned
            Reporter:
            Benson Margulies
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development