public class Token extends Object
Modifier and Type | Field and Description |
---|---|
int |
colE
Ending column in the document.
|
int |
colS
Starting column in the document.
|
int |
lineE
Ending line in the document.
|
int |
lineS
Starting line in the document.
|
String |
name
Name of token.
|
short |
paragraph
Ordinal number of paragraph, in which the token occured.
|
int |
reloffset |
int |
sentence
Initialized by
PunctFilter
and ParagraphPunctFilter |
short |
sentenceInParagraph
Ordinal number of sentence whitin the paragraph, in which the token occured.
|
String |
text
Text that is represented by this token.
|
int |
weight |
Constructor and Description |
---|
Token(String aname,
String atext,
int ls,
int le,
int cs,
int ce)
Constructor for the Token object
|
Token(String aname,
String atext,
int ls,
int le,
int cs,
int ce,
int reloff)
Constructor for the Token object
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Description of the Method
|
TextUnitID |
getTextUnit(long uid,
int revision)
Returns the identificator of the text unit to which the token falls into.
|
int |
hashCode()
Description of the Method
|
Token |
newText(String name,
String text)
Clones this objects with a new name and text.
|
String |
toString()
Convert a Token to a String.Returns the string that represents a token of
a given name and text.
|
static String |
toString(String name,
String text)
Convert a Token to a String.Returns the string that represents a token of
a given name and text.
|
public String text
public String name
<WORD>
,
<NUM>
.public int lineS
public int lineE
public int colS
public int colE
public int weight
public int reloffset
public int sentence
PunctFilter
and ParagraphPunctFilter
public short paragraph
ParagraphPunctFilter
public short sentenceInParagraph
ParagraphPunctFilter
public Token(String aname, String atext, int ls, int le, int cs, int ce)
aname
- this object's nameatext
- the text associated with the tokenls
- the starting line in the documentle
- the ending line in the documentcs
- the starting column in the document.ce
- the ending column in the document.public Token(String aname, String atext, int ls, int le, int cs, int ce, int reloff)
aname
- this object's nameatext
- the text associated with the tokenls
- the starting line in the documentle
- the ending line in the documentcs
- the starting column in the documentce
- the ending column in the documentreloff
- the relative offset of this tokenpublic static String toString(String name, String text)
name
and text
variable values.name
- the nametext
- the textpublic int hashCode()
public boolean equals(Object obj)
public String toString()
name
and text
variable values.public Token newText(String name, String text)
name
- Description of the Parametertext
- Description of the Parameterpublic TextUnitID getTextUnit(long uid, int revision)
uid
- id of the document to which the token falls intorevision
- revision number of the document to which the token falls intoTextUnitID
child classes
- DocumentUnitID
,
ParagraphUnitID
or
SentenceUnitID
Constants.CHECK_DUPLICITY_LEVEL
Copyright © 2016 Egothor. All Rights Reserved.