stanfordnlp/CoreNLP · error · IllegalArgumentException

Unsupported output style " + outputStyle

Error message

Unsupported output style " + outputStyle

What it means

RuntimeException from MaxentTagger.outputTaggedSentence when the OutputStyle switch encounters an output style with no rendering branch; the requested tag-output format is not one of the supported styles (TSV, XML, INLINE_XML, SLASH_TAGS, etc.).

Solutions

  1. Set -outputFormat to a supported style (slashTags, xml, inlineXML, tsv)
  2. Use OutputStyle's enum values programmatically
  3. Check the config value's spelling
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/edu/stanford/nlp/tagger/maxent/MaxentTagger.java:1880 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of stanfordnlp/CoreNLP@1b7edd19c4 (2026-09-10). Data as JSON: /api/errors/1e9576ab4ddc7c0c. Report an issue: GitHub.

Appendix: source

Thrown at src/edu/stanford/nlp/tagger/maxent/MaxentTagger.java:1880

  public void outputTaggedSentence(List<? extends HasWord> sentence,
                                   boolean outputLemmas, OutputStyle outputStyle,
                                   boolean outputVerbosity, int numSentences,
                                   String separator, Writer writer) {
    try {
      switch (outputStyle) {
      case TSV:
        writer.write(getTsvWords(outputVerbosity, outputLemmas, sentence));
        break;
      case XML:
      case INLINE_XML:
        writeXMLSentence(writer, sentence, numSentences, outputLemmas);
        break;
      case SLASH_TAGS:
        writer.write(SentenceUtils.listToString(sentence, false, config.getTagSeparator()));
        writer.write(separator);
        break;
      default:
        throw new IllegalArgumentException("Unsupported output style " + outputStyle);
      }
    } catch (IOException e) {
      throw new RuntimeIOException(e);
    }
  }

  /**
   * Command-line tagger interface.
   * Can be used to train or test taggers, or to tag text, taking input from
   * stdin or a file.
   * See class documentation for usage.
   *
   * @param args Command-line arguments
   * @throws IOException If any file problems
   */
  public static void main(String[] args) throws Exception {
    TaggerConfig config = new TaggerConfig(args);

View on GitHub (pinned to 1b7edd19c4)