{"record":{"id":"b1a5d17a42738536","repo":"stanfordnlp/CoreNLP","slug":"sentiment-analysis-is-not-implemented-for-french","errorCode":null,"errorMessage":"Sentiment analysis is not implemented for French","messagePattern":"Sentiment analysis is not implemented for French","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/simple/FrenchDocument.java","lineNumber":83,"sourceCode":"  protected FrenchDocument(Properties props, String text) {\n    super(props, text);\n  }\n\n\n  /**\n   * No lemma annotator for French -- set the lemma to be the word.\n   *\n   * @see Document#runLemma(Properties)\n   */\n  @Override\n  protected Document runLemma(Properties props) {\n    return mockLemma(props);\n  }\n\n\n  @Override\n  protected Document runSentiment(Properties props) {\n    throw new IllegalArgumentException(\"Sentiment analysis is not implemented for French\");\n  }\n\n  @Override\n  public Map<Integer, CorefChain> coref(Properties props) {\n    throw new IllegalArgumentException(\"Coreference is not implemented for French\");\n  }\n\n}\n","sourceCodeStart":65,"sourceCodeEnd":92,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/simple/FrenchDocument.java#L65-L92","documentation":"FrenchDocument.runSentiment() throws IllegalArgumentException because sentiment analysis is not implemented for French in the stanford.nlp.simple API. Calling Document.sentiment() on a French document always reaches this stub and fails by design.","triggerScenarios":"Calling sentiment() on a FrenchDocument, or a pipeline step whose prerequisites route into runSentiment on French text.","commonSituations":"Multilingual pipelines sentiment-scoring all documents; assuming French has parity with English sentiment support in CoreNLP's simple API.","solutions":["Skip sentiment for FrenchDocument instances (instanceof check before calling).","Use an English (or otherwise supported) document for sentiment analysis.","Integrate an external French sentiment model outside the CoreNLP simple API."],"exampleFix":"// before\nString s = doc.sentiment();\n// after\nif (!(doc instanceof FrenchDocument)) {\n  String s = doc.sentiment();\n}","handlingStrategy":"type-guard","validationCode":"if (doc instanceof edu.stanford.nlp.simple.FrenchDocument) skipSentiment = true;","typeGuard":"boolean supportsSentiment(Document doc) { return !(doc instanceof edu.stanford.nlp.simple.FrenchDocument); }","tryCatchPattern":"try {\n  doc.sentiment();\n} catch (IllegalArgumentException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"not implemented\")) {\n    log.warn(\"Sentiment unavailable for French, skipping\");\n  } else throw e;\n}","preventionTips":["Check FrenchDocument javadoc for unsupported operations before pipeline design.","Use external French sentiment models.","Use per-language capability configuration in multilingual pipelines."],"tags":["nlp","unsupported-language","sentiment","french"],"backgroundTag":"method-not-implemented","analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}