{"record":{"id":"42433fb79a9939b9","repo":"stanfordnlp/CoreNLP","slug":"unsupported-language-42433f","errorCode":null,"errorMessage":"unsupported language","messagePattern":"unsupported language","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/coref/hybrid/HybridCorefProperties.java","lineNumber":133,"sourceCode":"\n  public static boolean doScore(Properties props) {\n    return PropertiesUtils.getBool(props, SCORE_PROP, false);\n  }\n  public static boolean checkTime(Properties props) {\n    return PropertiesUtils.getBool(props, TIMER_PROP, false);\n  }\n  public static boolean checkMemory(Properties props) {\n    return PropertiesUtils.getBool(props, MEMORY_PROP, false);\n  }\n\n  public static int getThreadCounts(Properties props) {\n    return PropertiesUtils.getInt(props, THREADS_PROP, Runtime.getRuntime().availableProcessors());\n  }\n  public static Locale getLanguage(Properties props) {\n    String lang = PropertiesUtils.getString(props, LANG_PROP, \"en\");\n    if(lang.equalsIgnoreCase(\"en\") || lang.equalsIgnoreCase(\"english\")) return Locale.ENGLISH;\n    else if(lang.equalsIgnoreCase(\"zh\") || lang.equalsIgnoreCase(\"chinese\")) return Locale.CHINESE;\n    else throw new RuntimeException(\"unsupported language\");\n  }\n  public static boolean printMDLog(Properties props) {\n    return PropertiesUtils.getBool(props, PRINT_MDLOG_PROP, false);\n  }\n  public static boolean doPostProcessing(Properties props) {\n    return PropertiesUtils.getBool(props, POSTPROCESSING_PROP, false);\n  }\n\n  /** if true, use conll auto files, else use conll gold files */\n  public static boolean useCoNLLAuto(Properties props) {\n    return PropertiesUtils.getBool(props, CONLL_AUTO_PROP, true);\n  }\n\n  public static String getPathModel(Properties props, String sievename) {\n    return props.getProperty(PATH_SERIALIZED_PROP) + File.separator +\n        props.getProperty(PATH_MODEL_PROP.replace(\"SIEVENAME\", sievename), \"MISSING_MODEL_FOR_\"+sievename);\n  }\n  public static boolean debug(Properties props) {","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/coref/hybrid/HybridCorefProperties.java#L115-L151","documentation":"HybridCorefProperties.getLanguage maps the coref language property to a java.util.Locale but only recognizes \"en\"/\"english\" and \"zh\"/\"chinese\". Any other value causes a RuntimeException(\"unsupported language\"), since the hybrid coref system only ships models for these two languages.","triggerScenarios":"Setting the coref language property (e.g. -coref.language or the LANG_PROP key) to a value other than en/english/zh/chinese, such as \"es\", \"french\", or \"de\", then running the hybrid coref pipeline.","commonSituations":"Copying a pipeline config from a multi-language Stanford CoreNLP setup and assuming hybrid coref supports the same language list; typos like \"EN-US\" or \"eng\"; switching a project to a language whose models were never released.","solutions":["Set the language property to \"en\" or \"zh\" (case-insensitive), the only supported values","If another language is needed, use a different coref implementation or train your own models and extend getLanguage","Check for typos/extra locale suffixes — use exactly \"en\", \"english\", \"zh\", or \"chinese\"","Remove the language override so the default \"en\" is used"],"exampleFix":"// before\nprops.setProperty(\"coref.language\", \"french\");\n// after\nprops.setProperty(\"coref.language\", \"en\"); // or \"zh\"","handlingStrategy":"validation","validationCode":"String lang = props.getProperty(\"coref.language\", \"en\").toLowerCase();\nif (!lang.equals(\"en\") && !lang.equals(\"english\") && !lang.equals(\"zh\") && !lang.equals(\"chinese\")) throw new IllegalStateException(\"coref.language must be en or zh, got: \" + lang);","typeGuard":null,"tryCatchPattern":"try { Locale l = HybridCorefProperties.getLanguage(props); } catch (RuntimeException e) { props.setProperty(\"coref.language\", \"en\"); // fall back or rethrow with message }","preventionTips":["Only set coref.language to en or zh","Normalize/trim language config values","Don't reuse multilingual configs across coref implementations","Document supported languages in your pipeline config schema"],"tags":["java","configuration","i18n","unsupported-value"],"backgroundTag":"unsupported-enum-value","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"}