Search in sources :

Example 6 with OutFile

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();
    }
}
Also used : OutFile(edu.illinois.cs.cogcomp.ner.IO.OutFile)

Example 7 with OutFile

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();
}
Also used : OutFile(edu.illinois.cs.cogcomp.ner.IO.OutFile)

Example 8 with OutFile

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();
}
Also used : OutFile(edu.illinois.cs.cogcomp.ner.IO.OutFile)

Example 9 with OutFile

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();
}
Also used : OutFile(edu.illinois.cs.cogcomp.ner.IO.OutFile)

Aggregations

OutFile (edu.illinois.cs.cogcomp.ner.IO.OutFile)9 LinkedVector (edu.illinois.cs.cogcomp.lbjava.parse.LinkedVector)2 File (java.io.File)2 Vector (java.util.Vector)2 FeatureVector (edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector)1 IOException (java.io.IOException)1