public class Windows
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static Window |
windowForWordInPosition(int windowSize,
int wordPos,
java.util.List<java.lang.String> sentence)
Creates a sliding window from text
|
static java.util.List<Window> |
windows(java.io.InputStream words,
int windowSize)
Constructs a list of window of size windowSize.
|
static java.util.List<Window> |
windows(java.io.InputStream words,
TokenizerFactory tokenizerFactory,
int windowSize)
Constructs a list of window of size windowSize.
|
static java.util.List<Window> |
windows(java.util.List<java.lang.String> words,
int windowSize)
Constructs a list of window of size windowSize
|
static java.util.List<Window> |
windows(java.lang.String words)
Constructs a list of window of size windowSize.
|
static java.util.List<Window> |
windows(java.lang.String words,
int windowSize)
Constructs a list of window of size windowSize.
|
static java.util.List<Window> |
windows(java.lang.String words,
TokenizerFactory tokenizerFactory)
Constructs a list of window of size windowSize.
|
static java.util.List<Window> |
windows(java.lang.String words,
TokenizerFactory tokenizerFactory,
int windowSize,
WordVectors vectors)
Constructs a list of window of size windowSize.
|
public static java.util.List<Window> windows(java.io.InputStream words, int windowSize)
words
- the words to tokenize and construct windows fromwindowSize
- the window size to generatepublic static java.util.List<Window> windows(java.io.InputStream words, TokenizerFactory tokenizerFactory, int windowSize)
words
- the words to tokenize and construct windows fromtokenizerFactory
- tokenizer factory to usewindowSize
- the window size to generatepublic static java.util.List<Window> windows(java.lang.String words, int windowSize)
words
- the words to tokenize and construct windows fromwindowSize
- the window size to generatepublic static java.util.List<Window> windows(java.lang.String words, @NonNull TokenizerFactory tokenizerFactory, int windowSize, WordVectors vectors)
words
- the words to tokenize and construct windows fromtokenizerFactory
- tokenizer factory to usewindowSize
- the window size to generatepublic static java.util.List<Window> windows(java.lang.String words)
words
- the words to tokenize and construct windows frompublic static java.util.List<Window> windows(java.lang.String words, TokenizerFactory tokenizerFactory)
words
- the words to tokenize and construct windows fromtokenizerFactory
- tokenizer factory to usepublic static Window windowForWordInPosition(int windowSize, int wordPos, java.util.List<java.lang.String> sentence)
windowSize
- the window size to usewordPos
- the position of the word to centersentence
- the sentence to createComplex a window forpublic static java.util.List<Window> windows(java.util.List<java.lang.String> words, int windowSize)
words
- the words to construct windows from