/** Run the classifier on a collection of text files. * Uses the plainTextReaderAndWriter to process them. * * @param textFiles A File Collection to process. * @throws IOException For any IO error */ public void classifyFilesAndWriteAnswers(Collection<File> textFiles) throws IOException { classifyFilesAndWriteAnswers(textFiles, plainTextReaderAndWriter(), false); }
/** * Load a text file, run the classifier on it, and then print the answers to * stdout (with timing to stderr). This uses the value of flags.plainTextDocumentReaderAndWriter * to determine how to read the textFile format. By default this gives * edu.stanford.nlp.sequences.PlainTextDocumentReaderAndWriter. * <i>Note:</i> This means that it works right for * a plain textFile (and not a tab-separated columns test file). * * @param textFile The file to test on. */ public void classifyAndWriteAnswers(String textFile) throws IOException { classifyAndWriteAnswers(textFile, plainTextReaderAndWriter(), false); }
public void classifyStdin() throws IOException { classifyStdin(plainTextReaderAndWriter()); }
/** * Classify the contents of a file. * * @param filename Contains the sentence(s) to be classified. * @return {@link List} of classified List of IN. */ public List<List<IN>> classifyFile(String filename) { ObjectBank<List<IN>> documents = makeObjectBankFromFile(filename, plainTextReaderAndWriter()); return classifyObjectBank(documents); }
/** * Classify the tokens in a String. Each sentence becomes a separate document. * * @param str A String with tokens in one or more sentences of text to be * classified. * @return {@link List} of classified sentences (each a List of something that * extends {@link CoreMap}). */ public List<List<IN>> classify(String str) { ObjectBank<List<IN>> documents = makeObjectBankFromString(str, plainTextReaderAndWriter()); return classifyObjectBank(documents); } /**
PlainTextDocumentReaderAndWriter.OutputStyle outFormat = PlainTextDocumentReaderAndWriter.OutputStyle.fromShortName(outputFormat); DocumentReaderAndWriter<IN> textDocumentReaderAndWriter = plainTextReaderAndWriter();
makeObjectBankFromString(sentences, plainTextReaderAndWriter());
/** Run the classifier on a collection of text files. * Uses the plainTextReaderAndWriter to process them. * * @param textFiles A File Collection to process. * @throws IOException For any IO error */ public void classifyFilesAndWriteAnswers(Collection<File> textFiles) throws IOException { classifyFilesAndWriteAnswers(textFiles, plainTextReaderAndWriter(), false); }
public void classifyStdin() throws IOException { classifyStdin(plainTextReaderAndWriter()); }
/** * Load a text file, run the classifier on it, and then print the answers to * stdout (with timing to stderr). This uses the value of flags.plainTextDocumentReaderAndWriter * to determine how to read the textFile format. By default this gives * edu.stanford.nlp.sequences.PlainTextDocumentReaderAndWriter. * <i>Note:</i> This means that it works right for * a plain textFile (and not a tab-separated columns test file). * * @param textFile The file to test on. */ public void classifyAndWriteAnswers(String textFile) throws IOException { classifyAndWriteAnswers(textFile, plainTextReaderAndWriter(), false); }
/** * Classify the contents of a file. * * @param filename Contains the sentence(s) to be classified. * @return {@link List} of classified List of IN. */ public List<List<IN>> classifyFile(String filename) { ObjectBank<List<IN>> documents = makeObjectBankFromFile(filename, plainTextReaderAndWriter()); return classifyObjectBank(documents); }
/** * Classify the tokens in a String. Each sentence becomes a separate document. * * @param str A String with tokens in one or more sentences of text to be * classified. * @return {@link List} of classified sentences (each a List of something that * extends {@link CoreMap}). */ public List<List<IN>> classify(String str) { ObjectBank<List<IN>> documents = makeObjectBankFromString(str, plainTextReaderAndWriter()); return classifyObjectBank(documents); } /**
PlainTextDocumentReaderAndWriter.OutputStyle outFormat = PlainTextDocumentReaderAndWriter.OutputStyle.fromShortName(outputFormat); DocumentReaderAndWriter<IN> textDocumentReaderAndWriter = plainTextReaderAndWriter();
makeObjectBankFromString(sentences, plainTextReaderAndWriter());