public class Window
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
Window(java.util.Collection<java.lang.String> words,
int begin,
int end)
Creates a window with a context of size 3
|
Window(java.util.Collection<java.lang.String> words,
int windowSize,
int begin,
int end)
Initialize a window with the given size
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
asTokens() |
int |
getBegin() |
int |
getEnd() |
java.lang.String |
getFocusWord() |
java.lang.String |
getLabel() |
int |
getMedian() |
int |
getWindowSize() |
java.lang.String |
getWord(int i) |
java.util.List<java.lang.String> |
getWords() |
boolean |
isBeginLabel() |
boolean |
isEndLabel() |
void |
setBegin(int begin) |
void |
setEnd(int end) |
void |
setLabel(java.lang.String label) |
void |
setWords(java.util.List<java.lang.String> words) |
java.lang.String |
toString() |
public Window(java.util.Collection<java.lang.String> words, int begin, int end)
words
- a collection of strings of size 3public Window(java.util.Collection<java.lang.String> words, int windowSize, int begin, int end)
words
- the words to usewindowSize
- the size of the windowbegin
- the begin index for the windowend
- the end index for the windowpublic java.lang.String asTokens()
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.List<java.lang.String> getWords()
public void setWords(java.util.List<java.lang.String> words)
public java.lang.String getWord(int i)
public java.lang.String getFocusWord()
public boolean isBeginLabel()
public boolean isEndLabel()
public java.lang.String getLabel()
public int getWindowSize()
public int getMedian()
public void setLabel(java.lang.String label)
public int getBegin()
public void setBegin(int begin)
public int getEnd()
public void setEnd(int end)