net.java.sen.dictionary
クラス Token

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

public class Token
extends java.lang.Object

A single token from an analysed sentence

Thread Safety: Objects of this class are NOT thread safe and should not be accessed simultaneously by multiple threads.

CAUTION: Morphemes are implemented as lazy proxies onto a Dictionary, and care should be taken not to access the same Dictionary from multiple threads. Once any member of a Morpheme has been read, its link to the Dictionary is broken and this restriction is relaxed


コンストラクタの概要
Token()
          Creates a blank Token
Token(java.lang.String surface, int cost, int start, int length, Morpheme morpheme)
          Creates a Token with explicit parameters
Token(java.lang.String surface, Node node)
          Creates a Token from a Node
 
メソッドの概要
 int end()
          Gets the end of the character range of this Token within the underlying sentence
 boolean equals(java.lang.Object object)
           
 int getCost()
          Gets the Viterbi cost of this Token
 int getLength()
          Gets the length of the character range of this Token within the underlying sentence
 Morpheme getMorpheme()
          Gets the morpheme data for this Token
 int getStart()
          Gets the start of the character range of this Token within the underlying sentence
 java.lang.String getSurface()
          Gets the character range of this Token within the underlying sentence
 void setCost(int cost)
          Sets the Viterbi cost of this Token
 void setLength(int length)
          Sets the length of the character range of this Token within the underlying sentence
 void setStart(int start)
          Sets the start of the character range of this Token within the underlying sentence
 void setSurface(java.lang.String surface)
          Sets the character range of this Token within the underlying sentence
 java.lang.String toString()
          Returns the character range of this Token within the underlying sentence
 
クラス java.lang.Object から継承されたメソッド
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

Token

public Token(java.lang.String surface,
             Node node)
Creates a Token from a Node

パラメータ:
surface - The underlying sentence string
node - The Node to create from

Token

public Token(java.lang.String surface,
             int cost,
             int start,
             int length,
             Morpheme morpheme)
Creates a Token with explicit parameters

パラメータ:
surface - The character range within the underlying sentence
cost - The Viterbi cost
start - The start of the character range within the underlying sentence
length - The length of the character range within the underlying sentence
morpheme - The morpheme data

Token

public Token()
Creates a blank Token

メソッドの詳細

getStart

public int getStart()
Gets the start of the character range of this Token within the underlying sentence

戻り値:
The start of the character range of this Token within the underlying sentence

setStart

public void setStart(int start)
Sets the start of the character range of this Token within the underlying sentence

パラメータ:
start - The start of the character range of this Token within the underlying sentence

getLength

public int getLength()
Gets the length of the character range of this Token within the underlying sentence

戻り値:
The length of the character range of this Token within the underlying sentence

setLength

public void setLength(int length)
Sets the length of the character range of this Token within the underlying sentence

パラメータ:
length - The length of the character range of this Token within the underlying sentence

getSurface

public java.lang.String getSurface()
Gets the character range of this Token within the underlying sentence

戻り値:
The character range of this Token within the underlying sentence

setSurface

public void setSurface(java.lang.String surface)
Sets the character range of this Token within the underlying sentence

パラメータ:
surface - The character range of this Token within the underlying sentence

getCost

public int getCost()
Gets the Viterbi cost of this Token

戻り値:
The Viterbi cost of this Token

setCost

public void setCost(int cost)
Sets the Viterbi cost of this Token

パラメータ:
cost - The Viterbi cost of this Token

getMorpheme

public Morpheme getMorpheme()
Gets the morpheme data for this Token

戻り値:
The morpheme data for this Token

end

public int end()
Gets the end of the character range of this Token within the underlying sentence

戻り値:
The end of the character range of this Token within the underlying sentence

equals

public boolean equals(java.lang.Object object)
オーバーライド:
クラス java.lang.Object 内の equals

toString

public java.lang.String toString()
Returns the character range of this Token within the underlying sentence

オーバーライド:
クラス java.lang.Object 内の toString
戻り値:
The character range of this Token within the underlying sentence


Copyright ? 2008. All Rights Reserved.