public class SyntaxToken
extends java.lang.Object
implements java.io.Serializable
Represents a work in the input text that was recognized and assigned a part of speech. There is one syntax token record for each word in the source text.
Constructor and Description |
---|
SyntaxToken() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.Integer |
getBeginOffset()
The zero-based offset from the beginning of the source text to the first
character in the word.
|
java.lang.Integer |
getEndOffset()
The zero-based offset from the beginning of the source text to the last
character in the word.
|
PartOfSpeechTag |
getPartOfSpeech()
Provides the part of speech label and the confidence level that Amazon
Comprehend has that the part of speech was correctly identified.
|
java.lang.String |
getText()
The word that was recognized in the source text.
|
java.lang.Integer |
getTokenId()
A unique identifier for a token.
|
int |
hashCode() |
void |
setBeginOffset(java.lang.Integer beginOffset)
The zero-based offset from the beginning of the source text to the first
character in the word.
|
void |
setEndOffset(java.lang.Integer endOffset)
The zero-based offset from the beginning of the source text to the last
character in the word.
|
void |
setPartOfSpeech(PartOfSpeechTag partOfSpeech)
Provides the part of speech label and the confidence level that Amazon
Comprehend has that the part of speech was correctly identified.
|
void |
setText(java.lang.String text)
The word that was recognized in the source text.
|
void |
setTokenId(java.lang.Integer tokenId)
A unique identifier for a token.
|
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
SyntaxToken |
withBeginOffset(java.lang.Integer beginOffset)
The zero-based offset from the beginning of the source text to the first
character in the word.
|
SyntaxToken |
withEndOffset(java.lang.Integer endOffset)
The zero-based offset from the beginning of the source text to the last
character in the word.
|
SyntaxToken |
withPartOfSpeech(PartOfSpeechTag partOfSpeech)
Provides the part of speech label and the confidence level that Amazon
Comprehend has that the part of speech was correctly identified.
|
SyntaxToken |
withText(java.lang.String text)
The word that was recognized in the source text.
|
SyntaxToken |
withTokenId(java.lang.Integer tokenId)
A unique identifier for a token.
|
public java.lang.Integer getTokenId()
A unique identifier for a token.
A unique identifier for a token.
public void setTokenId(java.lang.Integer tokenId)
A unique identifier for a token.
tokenId
- A unique identifier for a token.
public SyntaxToken withTokenId(java.lang.Integer tokenId)
A unique identifier for a token.
Returns a reference to this object so that method calls can be chained together.
tokenId
- A unique identifier for a token.
public java.lang.String getText()
The word that was recognized in the source text.
Constraints:
Length: 1 -
The word that was recognized in the source text.
public void setText(java.lang.String text)
The word that was recognized in the source text.
Constraints:
Length: 1 -
text
- The word that was recognized in the source text.
public SyntaxToken withText(java.lang.String text)
The word that was recognized in the source text.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 -
text
- The word that was recognized in the source text.
public java.lang.Integer getBeginOffset()
The zero-based offset from the beginning of the source text to the first character in the word.
The zero-based offset from the beginning of the source text to the first character in the word.
public void setBeginOffset(java.lang.Integer beginOffset)
The zero-based offset from the beginning of the source text to the first character in the word.
beginOffset
- The zero-based offset from the beginning of the source text to the first character in the word.
public SyntaxToken withBeginOffset(java.lang.Integer beginOffset)
The zero-based offset from the beginning of the source text to the first character in the word.
Returns a reference to this object so that method calls can be chained together.
beginOffset
- The zero-based offset from the beginning of the source text to the first character in the word.
public java.lang.Integer getEndOffset()
The zero-based offset from the beginning of the source text to the last character in the word.
The zero-based offset from the beginning of the source text to the last character in the word.
public void setEndOffset(java.lang.Integer endOffset)
The zero-based offset from the beginning of the source text to the last character in the word.
endOffset
- The zero-based offset from the beginning of the source text to the last character in the word.
public SyntaxToken withEndOffset(java.lang.Integer endOffset)
The zero-based offset from the beginning of the source text to the last character in the word.
Returns a reference to this object so that method calls can be chained together.
endOffset
- The zero-based offset from the beginning of the source text to the last character in the word.
public PartOfSpeechTag getPartOfSpeech()
Provides the part of speech label and the confidence level that Amazon Comprehend has that the part of speech was correctly identified. For more information, see how-syntax.
Provides the part of speech label and the confidence level that Amazon Comprehend has that the part of speech was correctly identified. For more information, see how-syntax.
public void setPartOfSpeech(PartOfSpeechTag partOfSpeech)
Provides the part of speech label and the confidence level that Amazon Comprehend has that the part of speech was correctly identified. For more information, see how-syntax.
partOfSpeech
- Provides the part of speech label and the confidence level that Amazon Comprehend has that the part of speech was correctly identified. For more information, see how-syntax.
public SyntaxToken withPartOfSpeech(PartOfSpeechTag partOfSpeech)
Provides the part of speech label and the confidence level that Amazon Comprehend has that the part of speech was correctly identified. For more information, see how-syntax.
Returns a reference to this object so that method calls can be chained together.
partOfSpeech
- Provides the part of speech label and the confidence level that Amazon Comprehend has that the part of speech was correctly identified. For more information, see how-syntax.
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.