Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Interface IOffsetAttribute

    The start and end character offset of a Token.

    Inherited Members
    IAttribute.CopyTo(IAttribute)
    Namespace: Lucene.Net.Analysis.TokenAttributes
    Assembly: Lucene.Net.dll
    Syntax
    public interface IOffsetAttribute : IAttribute

    Properties

    EndOffset

    Returns this Token's ending offset, one greater than the position of the last character corresponding to this token in the source text. The length of the token in the source text is (

    EndOffset
    - StartOffset).
    Declaration
    int EndOffset { get; }
    Property Value
    Type Description
    int
    See Also
    SetOffset(int, int)

    StartOffset

    Returns this Token's starting offset, the position of the first character corresponding to this token in the source text.

    Note that the difference between EndOffset and StartOffset may not be equal to termText.Length, as the term text may have been altered by a stemmer or some other filter.
    Declaration
    int StartOffset { get; }
    Property Value
    Type Description
    int
    See Also
    SetOffset(int, int)

    Methods

    SetOffset(int, int)

    Set the starting and ending offset.

    Declaration
    void SetOffset(int startOffset, int endOffset)
    Parameters
    Type Name Description
    int startOffset
    int endOffset
    Exceptions
    Type Condition
    ArgumentException

    If startOffset or endOffset are negative, or if startOffset is greater than endOffset

    See Also
    StartOffset
    EndOffset
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.