public class Sentence extends AbstractTextAnnotation implements Serializable
Modifier and Type | Field and Description |
---|---|
protected static edu.illinois.cs.cogcomp.core.transformers.ITransformer<View,Double> |
defaultViewScoreSplitter |
protected Constituent |
sentenceConstituent |
protected TextAnnotation |
textAnnotation |
text, tokenCharacterOffsets, tokenizedText, tokens, views
Constructor and Description |
---|
Sentence(Constituent sentenceConstituent)
Create a sentence out of a sentenceConstituent.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
int |
getEndSpan() |
Constituent |
getSentenceConstituent() |
int |
getSentenceId() |
int |
getStartSpan() |
String |
getText()
Gets the raw text
|
String |
getToken(int position)
Get the token at position from this text
|
String |
getTokenizedText()
Gets the tokenized text.
|
String[] |
getTokens()
Gets the tokens in this text.
|
List<View> |
getTopKViews(String viewName)
Get all the values available for a given view, identified by
viewName |
View |
getView(String viewName)
Gets the highest scoring value for the view identified by
viewName . |
int |
hashCode() |
boolean |
hasView(String viewName)
Checks if this text annotation has a view identified by
viewName |
int |
size()
Get the number of tokens in this text.
|
String |
toString() |
addView, addView, getAvailableViews, getDetokenizedText, getTokenCharacterOffset, getTokensInSpan, select
protected TextAnnotation textAnnotation
protected Constituent sentenceConstituent
public Sentence(Constituent sentenceConstituent)
c
- public int getEndSpan()
public View getView(String viewName)
AbstractTextAnnotation
viewName
.getView
in class AbstractTextAnnotation
public boolean hasView(String viewName)
AbstractTextAnnotation
viewName
hasView
in class AbstractTextAnnotation
true
if the text annotation contains a view called
viewName
and false
otherwisepublic Constituent getSentenceConstituent()
public int getStartSpan()
public List<View> getTopKViews(String viewName)
AbstractTextAnnotation
viewName
getTopKViews
in class AbstractTextAnnotation
public String[] getTokens()
AbstractTextAnnotation
getTokens
in class AbstractTextAnnotation
public int size()
AbstractTextAnnotation
size
in class AbstractTextAnnotation
public String getText()
AbstractTextAnnotation
getText
in class AbstractTextAnnotation
public String getTokenizedText()
AbstractTextAnnotation
getTokenizedText
in class AbstractTextAnnotation
public String getToken(int position)
AbstractTextAnnotation
getToken
in class AbstractTextAnnotation
public int getSentenceId()
Copyright © 2015. All rights reserved.