mirror of https://github.com/apache/lucene.git
LUCENE-1760: TokenStream API javadoc improvements
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@797714 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
be66120dff
commit
e4b34462ee
|
@ -150,9 +150,13 @@ public final class TeeSinkTokenFilter extends TokenFilter {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: Missing Docs
|
* A filter that decides which {@link AttributeSource} states to store in the sink.
|
||||||
*/
|
*/
|
||||||
public static interface SinkFilter {
|
public static interface SinkFilter {
|
||||||
|
/**
|
||||||
|
* Returns true, iff the current state of the passed-in {@link AttributeSource} shall be stored
|
||||||
|
* in the sink.
|
||||||
|
*/
|
||||||
boolean accept(AttributeSource source);
|
boolean accept(AttributeSource source);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -235,7 +235,7 @@ public class Token extends AttributeImpl
|
||||||
* @param text term text
|
* @param text term text
|
||||||
* @param start start offset
|
* @param start start offset
|
||||||
* @param end end offset
|
* @param end end offset
|
||||||
* @deprecated
|
* @deprecated Use {@link #Token(char[], int, int, int, int)} instead.
|
||||||
*/
|
*/
|
||||||
public Token(String text, int start, int end) {
|
public Token(String text, int start, int end) {
|
||||||
termText = text;
|
termText = text;
|
||||||
|
@ -251,7 +251,7 @@ public class Token extends AttributeImpl
|
||||||
* @param start start offset
|
* @param start start offset
|
||||||
* @param end end offset
|
* @param end end offset
|
||||||
* @param typ token type
|
* @param typ token type
|
||||||
* @deprecated
|
* @deprecated Use {@link #Token(char[], int, int, int, int)} and {@link #setType(String)} instead.
|
||||||
*/
|
*/
|
||||||
public Token(String text, int start, int end, String typ) {
|
public Token(String text, int start, int end, String typ) {
|
||||||
termText = text;
|
termText = text;
|
||||||
|
@ -269,7 +269,7 @@ public class Token extends AttributeImpl
|
||||||
* @param start
|
* @param start
|
||||||
* @param end
|
* @param end
|
||||||
* @param flags token type bits
|
* @param flags token type bits
|
||||||
* @deprecated
|
* @deprecated Use {@link #Token(char[], int, int, int, int)} and {@link #setFlags(int)} instead.
|
||||||
*/
|
*/
|
||||||
public Token(String text, int start, int end, int flags) {
|
public Token(String text, int start, int end, int flags) {
|
||||||
termText = text;
|
termText = text;
|
||||||
|
|
|
@ -26,10 +26,6 @@ import java.io.IOException;
|
||||||
{@link #incrementToken()} if the new TokenStream API is used
|
{@link #incrementToken()} if the new TokenStream API is used
|
||||||
and {@link #next(Token)} or {@link #next()} if the old
|
and {@link #next(Token)} or {@link #next()} if the old
|
||||||
TokenStream API is used.
|
TokenStream API is used.
|
||||||
* <p><font color="#FF0000">
|
|
||||||
* WARNING: The status of the new TokenStream, AttributeSource and Attributes is experimental.
|
|
||||||
* The APIs introduced in these classes with Lucene 2.9 might change in the future.
|
|
||||||
* We will make our best efforts to keep the APIs backwards-compatible.</font>
|
|
||||||
<p>
|
<p>
|
||||||
See {@link TokenStream}
|
See {@link TokenStream}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -68,11 +68,7 @@ import org.apache.lucene.util.AttributeSource;
|
||||||
{@link TeeSinkTokenFilter}). For this usecase
|
{@link TeeSinkTokenFilter}). For this usecase
|
||||||
{@link AttributeSource#captureState} and {@link AttributeSource#restoreState} can be used.
|
{@link AttributeSource#captureState} and {@link AttributeSource#restoreState} can be used.
|
||||||
* <p><font color="#FF0000">
|
* <p><font color="#FF0000">
|
||||||
* WARNING: The status of the new TokenStream, AttributeSource and Attributes is experimental.
|
*/
|
||||||
* The APIs introduced in these classes with Lucene 2.9 might change in the future.
|
|
||||||
* We will make our best efforts to keep the APIs backwards-compatible.</font>
|
|
||||||
*/
|
|
||||||
|
|
||||||
public abstract class TokenStream extends AttributeSource {
|
public abstract class TokenStream extends AttributeSource {
|
||||||
|
|
||||||
/** @deprecated Remove this when old API is removed! */
|
/** @deprecated Remove this when old API is removed! */
|
||||||
|
|
|
@ -30,10 +30,6 @@ import java.io.IOException;
|
||||||
<p>
|
<p>
|
||||||
NOTE: subclasses overriding {@link #next(Token)} must
|
NOTE: subclasses overriding {@link #next(Token)} must
|
||||||
call {@link Token#clear()}.
|
call {@link Token#clear()}.
|
||||||
* <p><font color="#FF0000">
|
|
||||||
* WARNING: The status of the new TokenStream, AttributeSource and Attributes is experimental.
|
|
||||||
* The APIs introduced in these classes with Lucene 2.9 might change in the future.
|
|
||||||
* We will make our best efforts to keep the APIs backwards-compatible.</font>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public abstract class Tokenizer extends TokenStream {
|
public abstract class Tokenizer extends TokenStream {
|
||||||
|
|
|
@ -466,7 +466,7 @@ This should be the usual behavior. However, there is also an expert-API that all
|
||||||
and returns an actual instance. You can implement your own factory if you need to change the default behavior. <br/><br/>
|
and returns an actual instance. You can implement your own factory if you need to change the default behavior. <br/><br/>
|
||||||
|
|
||||||
Now here is the actual class that implements our new Attribute. Notice that the class has to extend
|
Now here is the actual class that implements our new Attribute. Notice that the class has to extend
|
||||||
{@link org.apache.lucene.util.AttributeSource.AttributeImpl}:
|
{@link org.apache.lucene.util.AttributeImpl}:
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
public final class PartOfSpeechAttributeImpl extends AttributeImpl
|
public final class PartOfSpeechAttributeImpl extends AttributeImpl
|
||||||
|
|
|
@ -22,12 +22,6 @@ import org.apache.lucene.util.Attribute;
|
||||||
/**
|
/**
|
||||||
* This attribute can be used to pass different flags down the tokenizer chain,
|
* This attribute can be used to pass different flags down the tokenizer chain,
|
||||||
* e. g. from one TokenFilter to another one.
|
* e. g. from one TokenFilter to another one.
|
||||||
*
|
|
||||||
* <p><font color="#FF0000">
|
|
||||||
* WARNING: The status of the new TokenStream, AttributeSource and Attributes is experimental.
|
|
||||||
* The APIs introduced in these classes with Lucene 2.9 might change in the future.
|
|
||||||
* We will make our best efforts to keep the APIs backwards-compatible.</font>
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
public interface FlagsAttribute extends Attribute {
|
public interface FlagsAttribute extends Attribute {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -24,12 +24,6 @@ import org.apache.lucene.util.AttributeImpl;
|
||||||
/**
|
/**
|
||||||
* This attribute can be used to pass different flags down the tokenizer chain,
|
* This attribute can be used to pass different flags down the tokenizer chain,
|
||||||
* e. g. from one TokenFilter to another one.
|
* e. g. from one TokenFilter to another one.
|
||||||
*
|
|
||||||
* <p><font color="#FF0000">
|
|
||||||
* WARNING: The status of the new TokenStream, AttributeSource and Attributes is experimental.
|
|
||||||
* The APIs introduced in these classes with Lucene 2.9 might change in the future.
|
|
||||||
* We will make our best efforts to keep the APIs backwards-compatible.</font>
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
public class FlagsAttributeImpl extends AttributeImpl implements FlagsAttribute, Cloneable, Serializable {
|
public class FlagsAttributeImpl extends AttributeImpl implements FlagsAttribute, Cloneable, Serializable {
|
||||||
private int flags = 0;
|
private int flags = 0;
|
||||||
|
|
|
@ -21,11 +21,6 @@ import org.apache.lucene.util.Attribute;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The start and end character offset of a Token.
|
* The start and end character offset of a Token.
|
||||||
*
|
|
||||||
* <p><font color="#FF0000">
|
|
||||||
* WARNING: The status of the new TokenStream, AttributeSource and Attributes is experimental.
|
|
||||||
* The APIs introduced in these classes with Lucene 2.9 might change in the future.
|
|
||||||
* We will make our best efforts to keep the APIs backwards-compatible.</font>
|
|
||||||
*/
|
*/
|
||||||
public interface OffsetAttribute extends Attribute {
|
public interface OffsetAttribute extends Attribute {
|
||||||
/** Returns this Token's starting offset, the position of the first character
|
/** Returns this Token's starting offset, the position of the first character
|
||||||
|
|
|
@ -23,11 +23,6 @@ import org.apache.lucene.util.AttributeImpl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The start and end character offset of a Token.
|
* The start and end character offset of a Token.
|
||||||
*
|
|
||||||
* <p><font color="#FF0000">
|
|
||||||
* WARNING: The status of the new TokenStream, AttributeSource and Attributes is experimental.
|
|
||||||
* The APIs introduced in these classes with Lucene 2.9 might change in the future.
|
|
||||||
* We will make our best efforts to keep the APIs backwards-compatible.</font>
|
|
||||||
*/
|
*/
|
||||||
public class OffsetAttributeImpl extends AttributeImpl implements OffsetAttribute, Cloneable, Serializable {
|
public class OffsetAttributeImpl extends AttributeImpl implements OffsetAttribute, Cloneable, Serializable {
|
||||||
private int startOffset;
|
private int startOffset;
|
||||||
|
|
|
@ -22,11 +22,6 @@ import org.apache.lucene.util.Attribute;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The payload of a Token. See also {@link Payload}.
|
* The payload of a Token. See also {@link Payload}.
|
||||||
*
|
|
||||||
* <p><font color="#FF0000">
|
|
||||||
* WARNING: The status of the new TokenStream, AttributeSource and Attributes is experimental.
|
|
||||||
* The APIs introduced in these classes with Lucene 2.9 might change in the future.
|
|
||||||
* We will make our best efforts to keep the APIs backwards-compatible.</font>
|
|
||||||
*/
|
*/
|
||||||
public interface PayloadAttribute extends Attribute {
|
public interface PayloadAttribute extends Attribute {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -24,11 +24,6 @@ import org.apache.lucene.util.AttributeImpl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The payload of a Token. See also {@link Payload}.
|
* The payload of a Token. See also {@link Payload}.
|
||||||
*
|
|
||||||
* <p><font color="#FF0000">
|
|
||||||
* WARNING: The status of the new TokenStream, AttributeSource and Attributes is experimental.
|
|
||||||
* The APIs introduced in these classes with Lucene 2.9 might change in the future.
|
|
||||||
* We will make our best efforts to keep the APIs backwards-compatible.</font>
|
|
||||||
*/
|
*/
|
||||||
public class PayloadAttributeImpl extends AttributeImpl implements PayloadAttribute, Cloneable, Serializable {
|
public class PayloadAttributeImpl extends AttributeImpl implements PayloadAttribute, Cloneable, Serializable {
|
||||||
private Payload payload;
|
private Payload payload;
|
||||||
|
|
|
@ -43,11 +43,6 @@ import org.apache.lucene.util.Attribute;
|
||||||
*
|
*
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* <p><font color="#FF0000">
|
|
||||||
* WARNING: The status of the new TokenStream, AttributeSource and Attributes is experimental.
|
|
||||||
* The APIs introduced in these classes with Lucene 2.9 might change in the future.
|
|
||||||
* We will make our best efforts to keep the APIs backwards-compatible.</font>
|
|
||||||
*
|
|
||||||
* @see org.apache.lucene.index.TermPositions
|
* @see org.apache.lucene.index.TermPositions
|
||||||
*/
|
*/
|
||||||
public interface PositionIncrementAttribute extends Attribute {
|
public interface PositionIncrementAttribute extends Attribute {
|
||||||
|
|
|
@ -45,13 +45,6 @@ import org.apache.lucene.util.AttributeImpl;
|
||||||
* occur with no intervening stop words.
|
* occur with no intervening stop words.
|
||||||
*
|
*
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
|
||||||
* <p><font color="#FF0000">
|
|
||||||
* WARNING: The status of the new TokenStream, AttributeSource and Attributes is experimental.
|
|
||||||
* The APIs introduced in these classes with Lucene 2.9 might change in the future.
|
|
||||||
* We will make our best efforts to keep the APIs backwards-compatible.</font>
|
|
||||||
*
|
|
||||||
* @see org.apache.lucene.index.TermPositions
|
|
||||||
*/
|
*/
|
||||||
public class PositionIncrementAttributeImpl extends AttributeImpl implements PositionIncrementAttribute, Cloneable, Serializable {
|
public class PositionIncrementAttributeImpl extends AttributeImpl implements PositionIncrementAttribute, Cloneable, Serializable {
|
||||||
private int positionIncrement = 1;
|
private int positionIncrement = 1;
|
||||||
|
|
|
@ -21,11 +21,6 @@ import org.apache.lucene.util.Attribute;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The term text of a Token.
|
* The term text of a Token.
|
||||||
*
|
|
||||||
* <p><font color="#FF0000">
|
|
||||||
* WARNING: The status of the new TokenStream, AttributeSource and Attributes is experimental.
|
|
||||||
* The APIs introduced in these classes with Lucene 2.9 might change in the future.
|
|
||||||
* We will make our best efforts to keep the APIs backwards-compatible.</font>
|
|
||||||
*/
|
*/
|
||||||
public interface TermAttribute extends Attribute {
|
public interface TermAttribute extends Attribute {
|
||||||
/** Returns the Token's term text.
|
/** Returns the Token's term text.
|
||||||
|
|
|
@ -24,11 +24,6 @@ import org.apache.lucene.util.AttributeImpl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The term text of a Token.
|
* The term text of a Token.
|
||||||
*
|
|
||||||
* <p><font color="#FF0000">
|
|
||||||
* WARNING: The status of the new TokenStream, AttributeSource and Attributes is experimental.
|
|
||||||
* The APIs introduced in these classes with Lucene 2.9 might change in the future.
|
|
||||||
* We will make our best efforts to keep the APIs backwards-compatible.</font>
|
|
||||||
*/
|
*/
|
||||||
public class TermAttributeImpl extends AttributeImpl implements TermAttribute, Cloneable, Serializable {
|
public class TermAttributeImpl extends AttributeImpl implements TermAttribute, Cloneable, Serializable {
|
||||||
private static int MIN_BUFFER_SIZE = 10;
|
private static int MIN_BUFFER_SIZE = 10;
|
||||||
|
|
|
@ -21,11 +21,6 @@ import org.apache.lucene.util.Attribute;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Token's lexical type. The Default value is "word".
|
* A Token's lexical type. The Default value is "word".
|
||||||
*
|
|
||||||
* <p><font color="#FF0000">
|
|
||||||
* WARNING: The status of the new TokenStream, AttributeSource and Attributes is experimental.
|
|
||||||
* The APIs introduced in these classes with Lucene 2.9 might change in the future.
|
|
||||||
* We will make our best efforts to keep the APIs backwards-compatible.</font>
|
|
||||||
*/
|
*/
|
||||||
public interface TypeAttribute extends Attribute {
|
public interface TypeAttribute extends Attribute {
|
||||||
/** Returns this Token's lexical type. Defaults to "word". */
|
/** Returns this Token's lexical type. Defaults to "word". */
|
||||||
|
|
|
@ -23,11 +23,6 @@ import org.apache.lucene.util.AttributeImpl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Token's lexical type. The Default value is "word".
|
* A Token's lexical type. The Default value is "word".
|
||||||
*
|
|
||||||
* <p><font color="#FF0000">
|
|
||||||
* WARNING: The status of the new TokenStream, AttributeSource and Attributes is experimental.
|
|
||||||
* The APIs introduced in these classes with Lucene 2.9 might change in the future.
|
|
||||||
* We will make our best efforts to keep the APIs backwards-compatible.</font>
|
|
||||||
*/
|
*/
|
||||||
public class TypeAttributeImpl extends AttributeImpl implements TypeAttribute, Cloneable, Serializable {
|
public class TypeAttributeImpl extends AttributeImpl implements TypeAttribute, Cloneable, Serializable {
|
||||||
private String type;
|
private String type;
|
||||||
|
|
|
@ -19,11 +19,6 @@ package org.apache.lucene.util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base interface for attributes.
|
* Base interface for attributes.
|
||||||
*
|
|
||||||
* <p><font color="#FF0000">
|
|
||||||
* WARNING: The status of the new TokenStream, AttributeSource and Attributes is experimental.
|
|
||||||
* The APIs introduced in these classes with Lucene 2.9 might change in the future.
|
|
||||||
* We will make our best efforts to keep the APIs backwards-compatible.</font>
|
|
||||||
*/
|
*/
|
||||||
public interface Attribute {
|
public interface Attribute {
|
||||||
public void clear();
|
public void clear();
|
||||||
|
|
|
@ -26,10 +26,6 @@ import java.lang.reflect.Field;
|
||||||
* <p>
|
* <p>
|
||||||
* Attributes are used to add data in a dynamic, yet type-safe way to a source
|
* Attributes are used to add data in a dynamic, yet type-safe way to a source
|
||||||
* of usually streamed objects, e. g. a {@link org.apache.lucene.analysis.TokenStream}.
|
* of usually streamed objects, e. g. a {@link org.apache.lucene.analysis.TokenStream}.
|
||||||
* <p><font color="#FF0000">
|
|
||||||
* WARNING: The status of the new TokenStream, AttributeSource and Attributes is experimental.
|
|
||||||
* The APIs introduced in these classes with Lucene 2.9 might change in the future.
|
|
||||||
* We will make our best efforts to keep the APIs backwards-compatible.</font>
|
|
||||||
*/
|
*/
|
||||||
public abstract class AttributeImpl implements Cloneable, Serializable {
|
public abstract class AttributeImpl implements Cloneable, Serializable {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -35,11 +35,6 @@ import org.apache.lucene.analysis.TokenStream; // for javadocs
|
||||||
* the {@link #addAttribute(Class)}, which then checks if an instance of
|
* the {@link #addAttribute(Class)}, which then checks if an instance of
|
||||||
* that type is already present. If yes, it returns the instance, otherwise
|
* that type is already present. If yes, it returns the instance, otherwise
|
||||||
* it creates a new instance and returns it.
|
* it creates a new instance and returns it.
|
||||||
*
|
|
||||||
* <p><font color="#FF0000">
|
|
||||||
* WARNING: The status of the new TokenStream, AttributeSource and Attributes is experimental.
|
|
||||||
* The APIs introduced in these classes with Lucene 2.9 might change in the future.
|
|
||||||
* We will make our best efforts to keep the APIs backwards-compatible.</font>
|
|
||||||
*/
|
*/
|
||||||
public class AttributeSource {
|
public class AttributeSource {
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue