public class DependencyPipe extends Object
| Modifier and Type | Field and Description |
|---|---|
Alphabet |
dataAlphabet |
boolean |
labeled |
int |
testint |
Alphabet |
typeAlphabet |
String[] |
types |
int[] |
typesInt |
| Constructor and Description |
|---|
DependencyPipe(ParserOptions options) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(String feat,
double val,
FeatureVector fv) |
void |
add(String feat,
FeatureVector fv) |
void |
addCoreFeatures(DependencyInstance instance,
int small,
int large,
boolean attR,
FeatureVector fv) |
protected void |
addExtendedFeatures(DependencyInstance instance,
FeatureVector fv) |
void |
addLabeledFeatures(DependencyInstance instance,
int word,
String type,
boolean attR,
boolean childFeatures,
FeatureVector fv) |
void |
close() |
void |
closeAlphabets() |
FeatureVector |
createFeatureVector(DependencyInstance instance) |
int[] |
createInstances(String file,
File featFileName,
boolean fileAccess) |
void |
fillFeatureVectors(DependencyInstance instance,
FeatureVector[][][] fvs,
double[][][] probs,
FeatureVector[][][][] nt_fvs,
double[][][][] nt_probs,
Parameters params) |
String |
getType(int typeIndex) |
void |
initInputFile(String file,
boolean fileAccess) |
void |
initOutputFile(String file) |
protected DependencyInstance |
nextInstance() |
String |
outputInstance(DependencyInstance instance,
boolean fileAccess) |
DependencyInstance |
readInstance(ObjectInputStream in,
int length,
FeatureVector[][][] fvs,
double[][][] probs,
FeatureVector[][][][] nt_fvs,
double[][][][] nt_probs,
Parameters params)
Read an instance from an input stream.
|
protected void |
writeExtendedFeatures(DependencyInstance instance,
ObjectOutputStream out)
Override this method if you have extra features that need to be written to disk.
|
protected void |
writeInstance(DependencyInstance instance,
ObjectOutputStream out)
Write an instance to an output stream for later reading.
|
public Alphabet dataAlphabet
public Alphabet typeAlphabet
public String[] types
public int[] typesInt
public boolean labeled
public int testint
public DependencyPipe(ParserOptions options) throws IOException
IOExceptionpublic void initInputFile(String file, boolean fileAccess) throws IOException
IOExceptionpublic void initOutputFile(String file) throws IOException
IOExceptionpublic String outputInstance(DependencyInstance instance, boolean fileAccess) throws IOException
IOExceptionpublic void close()
throws IOException
IOExceptionpublic String getType(int typeIndex)
protected final DependencyInstance nextInstance() throws IOException
IOExceptionpublic int[] createInstances(String file, File featFileName, boolean fileAccess) throws IOException
IOExceptionpublic void closeAlphabets()
public final void add(String feat, FeatureVector fv)
public final void add(String feat, double val, FeatureVector fv)
public FeatureVector createFeatureVector(DependencyInstance instance)
protected void addExtendedFeatures(DependencyInstance instance, FeatureVector fv)
public void addCoreFeatures(DependencyInstance instance, int small, int large, boolean attR, FeatureVector fv)
public void addLabeledFeatures(DependencyInstance instance, int word, String type, boolean attR, boolean childFeatures, FeatureVector fv)
public void fillFeatureVectors(DependencyInstance instance, FeatureVector[][][] fvs, double[][][] probs, FeatureVector[][][][] nt_fvs, double[][][][] nt_probs, Parameters params)
protected void writeInstance(DependencyInstance instance, ObjectOutputStream out)
protected void writeExtendedFeatures(DependencyInstance instance, ObjectOutputStream out) throws IOException
IOExceptionpublic DependencyInstance readInstance(ObjectInputStream in, int length, FeatureVector[][][] fvs, double[][][] probs, FeatureVector[][][][] nt_fvs, double[][][][] nt_probs, Parameters params) throws IOException
IOExceptionCopyright © 2016 JULIE Lab Jena, Germany. All rights reserved.