public class SelPrefDependencyContextGenerator extends Object implements DependencyContextGenerator
DependencyContextGenerator
that marks each co-occurrence with
ordering information.Modifier and Type | Field and Description |
---|---|
static String |
EMPTY_STRING |
Constructor and Description |
---|
SelPrefDependencyContextGenerator(StructuredVectorSpace svs)
Constructs a new
SelPrefDependencyContextGenerator . |
Modifier and Type | Method and Description |
---|---|
SparseDoubleVector |
generateContext(DependencyTreeNode[] tree,
int focusIndex)
Returns a
SparseDoubleVector that represents the context composed
of the set of prevWords before the focus word and the set of
nextWords after the focus word. |
int |
getVectorLength()
Returns the maximum number of dimensions used to represent any given
context.
|
void |
setReadOnly(boolean readOnly)
A No-op
|
public static final String EMPTY_STRING
public SelPrefDependencyContextGenerator(StructuredVectorSpace svs)
SelPrefDependencyContextGenerator
.public SparseDoubleVector generateContext(DependencyTreeNode[] tree, int focusIndex)
SparseDoubleVector
that represents the context composed
of the set of prevWords
before the focus word and the set of
nextWords
after the focus word. Since sparse vectors are
returned, if a second order vector is generated, it is recommended that
the vector also be sparsed or have very few dimensions.generateContext
in interface DependencyContextGenerator
public void setReadOnly(boolean readOnly)
setReadOnly
in interface DependencyContextGenerator
public int getVectorLength()
getVectorLength
in interface DependencyContextGenerator
Copyright © 2012. All Rights Reserved.