use of edu.illinois.cs.cogcomp.ner.IO.OutFile in project cogcomp-nlp by CogComp.
the class FileIOAnnotationJob method publishResults.
@Override
public void publishResults() {
String pub = getNERString();
OutFile of = new OutFile(outputfile);
try {
of.print(pub);
} finally {
of.close();
}
}
use of edu.illinois.cs.cogcomp.ner.IO.OutFile in project cogcomp-nlp by CogComp.
the class PlainTextWriter method write.
public static void write(Vector<LinkedVector> data, String outFile) {
OutFile out = new OutFile(outFile);
for (int i = 0; i < data.size(); i++) {
StringBuilder buf = new StringBuilder(2000);
for (int j = 0; j < data.elementAt(i).size(); j++) buf.append(((NEWord) data.elementAt(i).get(j)).form).append(" ");
out.println(buf.toString());
}
out.close();
}
use of edu.illinois.cs.cogcomp.ner.IO.OutFile in project cogcomp-nlp by CogComp.
the class PlainTextWriter method write.
public static void write(Data data, String outFile) {
OutFile out = new OutFile(outFile);
for (int did = 0; did < data.documents.size(); did++) {
for (int i = 0; i < data.documents.get(did).sentences.size(); i++) {
StringBuilder buf = new StringBuilder(2000);
for (int j = 0; j < data.documents.get(did).sentences.get(i).size(); j++) buf.append(((NEWord) data.documents.get(did).sentences.get(i).get(j)).form).append(" ");
out.println(buf.toString());
}
}
out.close();
}
use of edu.illinois.cs.cogcomp.ner.IO.OutFile in project cogcomp-nlp by CogComp.
the class FeatureMap method save.
public void save(String file) {
OutFile out = new OutFile(file);
out.println(String.valueOf(dim));
for (String w : wordToFid.keySet()) {
out.println(w);
out.println(String.valueOf(wordToFid.get(w)));
}
out.close();
}
Aggregations