Example usage for edu.stanford.nlp.ie.ner CMMClassifier classify

List of usage examples for edu.stanford.nlp.ie.ner CMMClassifier classify

Introduction

In this page you can find the example usage for edu.stanford.nlp.ie.ner CMMClassifier classify.

Prototype

@Override
public List<IN> classify(List<IN> document) 

Source Link

Document

Classify a List of CoreLabel s.

Usage

From source file:lv.lumii.morphotagger.MorphoPipe.java

License:Open Source License

/**
 * Outputs the tagged sentence according to the outputType set in this class
 * @param cmm - the tagger, needed to retrieve tagger features if they are requested
 * @param out - a stream to output the data
 * @param sentence - actual tokens to be output
 *//*  w  w w  .ja  va 2 s. c  o m*/
public static void outputSentence(CMMClassifier<CoreLabel> cmm, PrintStream out, List<CoreLabel> sentence) {
    if (outputSeparators)
        out.println("<s>");

    sentence = cmm.classify(sentence); // runs the actual morphotagging system
    switch (outputType) {
    case JSON:
        out.println(output_JSON(sentence));
        break;
    case CONLL_X:
        out.println(output_CONLL(sentence, cmm));
        break;
    case XML:
        try {
            output_XML(sentence, out);
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        break;
    case VISL_CG:
        out.println(output_VISL(sentence));
        break;
    case lemmatizedText:
        out.println(output_lemmatized(sentence, cmm));
        break;
    case RUSCORPORA:
        out.println(output_RUS(sentence));
        break;
    default:
        out.println(output_separated(sentence));
    }
    if (outputSeparators)
        out.println("</s>");
    out.flush();
}