Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class OpenNLPSentenceBreakIterator

    A ICU4N.Text.BreakIterator that splits sentences using an OpenNLP sentence chunking model.

    Inheritance
    object
    BreakIterator
    OpenNLPSentenceBreakIterator
    Inherited Members
    BreakIterator.Done
    BreakIterator.WordNone
    BreakIterator.WordNoneLimit
    BreakIterator.WordNumber
    BreakIterator.WordNumberLimit
    BreakIterator.WordLetter
    BreakIterator.WordLetterLimit
    BreakIterator.WordKana
    BreakIterator.WordKanaLimit
    BreakIterator.WordIdeo
    BreakIterator.WordIdeoLimit
    BreakIterator.Clone()
    BreakIterator.IsBoundary(int)
    BreakIterator.GetRuleStatusVec(int[])
    BreakIterator.SetText(string)
    BreakIterator.SetText(ReadOnlyMemory<char>)
    BreakIterator.GetWordInstance()
    BreakIterator.GetWordInstance(CultureInfo)
    BreakIterator.GetWordInstance(UCultureInfo)
    BreakIterator.GetLineInstance()
    BreakIterator.GetLineInstance(CultureInfo)
    BreakIterator.GetLineInstance(UCultureInfo)
    BreakIterator.GetCharacterInstance()
    BreakIterator.GetCharacterInstance(CultureInfo)
    BreakIterator.GetCharacterInstance(UCultureInfo)
    BreakIterator.GetSentenceInstance()
    BreakIterator.GetSentenceInstance(CultureInfo)
    BreakIterator.GetSentenceInstance(UCultureInfo)
    BreakIterator.GetTitleInstance()
    BreakIterator.GetTitleInstance(CultureInfo)
    BreakIterator.GetTitleInstance(UCultureInfo)
    BreakIterator.RegisterInstance(BreakIterator, CultureInfo, int)
    BreakIterator.RegisterInstance(BreakIterator, UCultureInfo, int)
    BreakIterator.Unregister(object)
    BreakIterator.GetCultures(UCultureTypes)
    BreakIterator.GetUCultures(UCultureTypes)
    BreakIterator.RuleStatus
    BreakIterator.ActualCulture
    BreakIterator.ValidCulture
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Analysis.OpenNlp
    Assembly: Lucene.Net.Analysis.OpenNLP.dll
    Syntax
    public sealed class OpenNLPSentenceBreakIterator : BreakIterator

    Constructors

    OpenNLPSentenceBreakIterator(NLPSentenceDetectorOp)

    A ICU4N.Text.BreakIterator that splits sentences using an OpenNLP sentence chunking model.

    Declaration
    public OpenNLPSentenceBreakIterator(NLPSentenceDetectorOp sentenceOp)
    Parameters
    Type Name Description
    NLPSentenceDetectorOp sentenceOp

    Properties

    Current

    Gets the iterator's current position.

    Declaration
    public override int Current { get; }
    Property Value
    Type Description
    int
    Overrides
    ICU4N.Text.BreakIterator.Current

    Text

    Gets a ICU4N.Support.Text.CharacterIterator over the text being analyzed. For at least some subclasses of ICU4N.Text.BreakIterator, this is a reference to the actual iterator being used by the ICU4N.Text.BreakIterator, and therefore, this function's return value should be treated as const. No guarantees are made about the current position of this iterator when it is returned. If you need to move that position to examine the text, clone this function's return value first.

    Declaration
    public override CharacterIterator Text { get; }
    Property Value
    Type Description
    CharacterIterator

    A ICU4N.Support.Text.CharacterIterator over the text being analyzed.

    Overrides
    ICU4N.Text.BreakIterator.Text

    Methods

    First()

    Set the iterator to the first boundary position. This is always the beginning index of the text this iterator iterates over. For example, if the iterator iterates over a whole string, this function will always return 0.

    Declaration
    public override int First()
    Returns
    Type Description
    int

    The character offset of the beginning of the stretch of text being broken.

    Overrides
    ICU4N.Text.BreakIterator.First()

    Following(int)

    Sets the iterator's current iteration position to be the first boundary position following the specified position. (Whether the specified position is itself a boundary position or not doesn't matter-- this function always moves the iteration position to the first boundary after the specified position.) If the specified position is the past-the-end position, returns ICU4N.Text.BreakIterator.Done.

    Declaration
    public override int Following(int pos)
    Parameters
    Type Name Description
    int pos
    Returns
    Type Description
    int

    The position of the first boundary position following "offset" (whether or not "offset" itself is a boundary position), or ICU4N.Text.BreakIterator.Done if "offset" is the past-the-end offset.

    Overrides
    BreakIterator.Following(int)

    Last()

    Set the iterator to the last boundary position. This is always the "past-the-end" index of the text this iterator iterates over. For example, if the iterator iterates over a whole string (call it "text"), this function will always return text.Length.

    Declaration
    public override int Last()
    Returns
    Type Description
    int

    The character offset of the end of the stretch of text being broken.

    Overrides
    ICU4N.Text.BreakIterator.Last()

    Next()

    Advances the iterator forward one boundary. The current iteration position is updated to point to the next boundary position after the current position, and this is also the value that is returned. If the current position is equal to the value returned by ICU4N.Text.BreakIterator.Last(), or to ICU4N.Text.BreakIterator.Done, this function returns ICU4N.Text.BreakIterator.Done and sets the current position to ICU4N.Text.BreakIterator.Done.

    Declaration
    public override int Next()
    Returns
    Type Description
    int

    The position of the first boundary position following the iteration position.

    Overrides
    ICU4N.Text.BreakIterator.Next()

    Next(int)

    Move the iterator by the specified number of steps in the text. A positive number moves the iterator forward; a negative number moves the iterator backwards. If this causes the iterator to move off either end of the text, this function returns ICU4N.Text.BreakIterator.Done; otherwise, this function returns the position of the appropriate boundary. Calling this function is equivalent to calling ICU4N.Text.BreakIterator.Next() or ICU4N.Text.BreakIterator.Previous()n times.

    Declaration
    public override int Next(int n)
    Parameters
    Type Name Description
    int n

    The number of boundaries to advance over (if positive, moves forward; if negative, moves backwards).

    Returns
    Type Description
    int

    The position of the boundary n boundaries from the current iteration position, or ICU4N.Text.BreakIterator.Done if moving n boundaries causes the iterator to advance off either end of the text.

    Overrides
    BreakIterator.Next(int)

    Preceding(int)

    Sets the iterator's current iteration position to be the last boundary position preceding the specified position. (Whether the specified position is itself a boundary position or not doesn't matter-- this function always moves the iteration position to the last boundary before the specified position.) If the specified position is the starting position, returns ICU4N.Text.BreakIterator.Done.

    Declaration
    public override int Preceding(int pos)
    Parameters
    Type Name Description
    int pos
    Returns
    Type Description
    int

    The position of the last boundary position preceding "offset" (whether of not "offset" itself is a boundary position), or ICU4N.Text.BreakIterator.Done if "offset" is the starting offset of the iterator.

    Overrides
    BreakIterator.Preceding(int)

    Previous()

    Move the iterator backward one boundary. The current iteration position is updated to point to the last boundary position before the current position, and this is also the value that is returned. If the current position is equal to the value returned by ICU4N.Text.BreakIterator.First(), or to ICU4N.Text.BreakIterator.Done, this function returns ICU4N.Text.BreakIterator.Done and sets the current position to ICU4N.Text.BreakIterator.Done.

    Declaration
    public override int Previous()
    Returns
    Type Description
    int

    position of the last boundary position preceding the iteration position.

    Overrides
    ICU4N.Text.BreakIterator.Previous()

    SetText(CharacterIterator)

    Sets the iterator to analyze a new piece of text. The ICU4N.Text.BreakIterator is passed a ICU4N.Support.Text.CharacterIterator through which it will access the text itself. The current iteration position is reset to the ICU4N.Support.Text.CharacterIterator's start index. (The old iterator is dropped.)

    Declaration
    public override void SetText(CharacterIterator newText)
    Parameters
    Type Name Description
    CharacterIterator newText

    A ICU4N.Support.Text.CharacterIterator referring to the text to analyze with this BreakIterator (the iterator's current position is ignored, but its other state is significant).

    Overrides
    ICU4N.Text.BreakIterator.SetText(ICU4N.Support.Text.CharacterIterator)
    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.