net.java.sen.dictionary
クラス Sentence

java.lang.Object
  上位を拡張 net.java.sen.dictionary.Sentence

public class Sentence
extends java.lang.Object

A Sentence represents a character array to be morphologically analysed. It supports breaking ignore spans, which prevent certain characters from being considered for tokenisation, and reading constraints which restrict the returned morphemes at a certain position to those with the given reading.


コンストラクタの概要
Sentence(char[] characters)
          Creates a sentence with the given characters
Sentence(java.lang.String text)
          Creates a sentence with the given string
 
メソッドの概要
 char[] getCharacters()
          Returns the underlying characters of this Sentence
 Reading getReadingConstraint(int position)
          Gets the reading constraint at the given position, if any
 SentenceIterator iterator()
          Returns a SentenceIterator that obeys the defined breaking ignore spans, reading constraints, and skips space characters
 void removeReadingConstraint(int position)
          Removes the reading constraint at the given position, if any
 void setBreakingIgnoreSpan(int position, short length)
          Sets a breaking ignore span.
 void setReadingConstraint(Reading constraint)
          Sets a reading constraint on the Sentence starting at position; any existing constraints that overlap the new constraint will be removed.
 SentenceIterator unconstrainedIterator(int position)
          Returns a SentenceIterator that obeys the defined breaking ignore spans, skips space characters, but ignores reading constraints
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

Sentence

public Sentence(char[] characters)
Creates a sentence with the given characters

パラメータ:
characters - The sentence's characters

Sentence

public Sentence(java.lang.String text)
Creates a sentence with the given string

パラメータ:
text - The string containing the sentence's characters
メソッドの詳細

setBreakingIgnoreSpan

public void setBreakingIgnoreSpan(int position,
                                  short length)
Sets a breaking ignore span. length characters starting at position will be ignored during iteration; no iterated subsequence of characters will cross the ignored span.

パラメータ:
position - The position of the ignore span to set
length - The length of the ignore span to set

setReadingConstraint

public void setReadingConstraint(Reading constraint)
Sets a reading constraint on the Sentence starting at position; any existing constraints that overlap the new constraint will be removed.

パラメータ:
constraint - The constraint to set

getReadingConstraint

public Reading getReadingConstraint(int position)
Gets the reading constraint at the given position, if any

パラメータ:
position - The position to get the constraint at
戻り値:
The constraint if present, or null

removeReadingConstraint

public void removeReadingConstraint(int position)
Removes the reading constraint at the given position, if any

パラメータ:
position - The position to remove the constraint from

iterator

public SentenceIterator iterator()
Returns a SentenceIterator that obeys the defined breaking ignore spans, reading constraints, and skips space characters

戻り値:
The iterator

unconstrainedIterator

public SentenceIterator unconstrainedIterator(int position)
Returns a SentenceIterator that obeys the defined breaking ignore spans, skips space characters, but ignores reading constraints

パラメータ:
position - The position to start iterating from
戻り値:
The iterator

getCharacters

public char[] getCharacters()
Returns the underlying characters of this Sentence

戻り値:
The underlying characters


Copyright ? 2008. All Rights Reserved.