|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.uottawa.balie.Token
public class Token
Tokens are the unit element of Balie.
A text is represneted as a list of consecutives tokens (called TokenList
).
Constructor Summary | |
---|---|
Token(java.lang.String pi_RawLiteral,
java.lang.String pi_CanonLiteral,
int pi_Type,
PunctLookup pi_PunctLookup,
AccentLookup pi_AccentLookup,
int pi_Position,
int pi_Sentence,
int pi_NumWhiteBefore,
int pi_NextStart,
int pi_NETagSetSize)
Creates a new token with all the required information. |
Method Summary | |
---|---|
java.lang.String |
Canon()
Gets the canonical version of the token. |
int |
EndPos()
|
NamedEntityType |
EntityType()
Get the entity type of this token see NamedEntityType for enumeration of types. |
void |
EntityType(NamedEntityType pi_Type)
Set the entity type see TokenConsts for enumeration of types. |
boolean |
equals(java.lang.Object pi_Obj)
|
TokenFeature |
Features()
Get features for this token |
void |
FlagAsAllCapSentence()
|
void |
FlagAsSentenceStart()
|
int |
hashCode()
|
void |
IncrementSentenceNumber()
Increments the sentence number of a token. |
boolean |
IsAllCapSentence()
|
boolean |
IsSentenceStart()
|
int |
Length()
Gets the lenght of a token in number fo chars. |
int |
NamedEntityAlias()
Get the alias group (integer ID) for this token |
void |
NamedEntityAlias(int pi_ID)
Set alias group ID for this token |
int |
NumWhiteBefore()
Get the number of white spaces that preceed this token in the text |
int |
PartOfSpeech()
Gets the part-of-speech of the token. |
long |
Position()
Gets the token position. |
java.lang.String |
Raw()
Gets the raw version of the token. |
int |
SentenceNumber()
Gets the sentence number. |
void |
setPosition(int numPosition)
Sets the token position. |
void |
setSentenceNumber(int numSentence)
Sets the sentence number. |
int |
StartPos()
|
java.lang.String |
toString()
A canonical string representation of this token. |
java.lang.StringBuffer |
ToXML()
Gets the XML representation of the token. |
int |
Type()
Gets the type of the token (word or punctuation). |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Token(java.lang.String pi_RawLiteral, java.lang.String pi_CanonLiteral, int pi_Type, PunctLookup pi_PunctLookup, AccentLookup pi_AccentLookup, int pi_Position, int pi_Sentence, int pi_NumWhiteBefore, int pi_NextStart, int pi_NETagSetSize)
pi_RawLiteral
- The word as it appears in the textpi_CanonLiteral
- The canonical version of the wordpi_Type
- The type (punctuation or word) see TokenConsts
for detailspi_PunctLookup
- The lookup table for punctuation typespi_Position
- The position of the token, in number of words from the text beginningpi_Sentence
- The sentence numberpi_NumWhiteBefore
- Number fo white chars prior to this tokenpi_NextStart
- Start position (in chars) of this token (including white)Method Detail |
---|
public java.lang.String Raw()
public java.lang.String Canon()
public int Type()
TokenConsts
for enumeration.
TokenConsts
public int PartOfSpeech()
TokenConsts
for enumeration of both.
TokenConsts
public boolean equals(java.lang.Object pi_Obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int NumWhiteBefore()
public NamedEntityType EntityType()
NamedEntityType
for enumeration of types.
TokenConsts
public void EntityType(NamedEntityType pi_Type)
TokenConsts
for enumeration of types.
pi_Type
- TokenConsts
public int NamedEntityAlias()
public void NamedEntityAlias(int pi_ID)
pi_ID
- alias group IDpublic int SentenceNumber()
public void setSentenceNumber(int numSentence)
numSentence
- the new sentence numberpublic void IncrementSentenceNumber()
public long Position()
public void setPosition(int numPosition)
numPosition
- the new token positionpublic int Length()
public java.lang.StringBuffer ToXML()
public int StartPos()
public int EndPos()
public void FlagAsSentenceStart()
public void FlagAsAllCapSentence()
public boolean IsSentenceStart()
public boolean IsAllCapSentence()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public TokenFeature Features()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |