{"record":{"id":"4eb13ae0f6604697","repo":"stanfordnlp/CoreNLP","slug":"please-specify-coref-algorithm-class","errorCode":null,"errorMessage":"Please specify coref.algorithm.class","messagePattern":"Please specify coref\\.algorithm\\.class","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/coref/CorefAlgorithm.java","lineNumber":42,"sourceCode":"\n  static CorefAlgorithm fromProps(Properties props, Dictionaries dictionaries) {\n    CorefAlgorithmType algorithm = CorefProperties.algorithm(props);\n    if (algorithm == CorefAlgorithmType.CLUSTERING) {\n      return new ClusteringCorefAlgorithm(props, dictionaries);\n    } else if (algorithm == CorefAlgorithmType.STATISTICAL) {\n      return new StatisticalCorefAlgorithm(props, dictionaries);\n    } else if (algorithm == CorefAlgorithmType.NEURAL) {\n      return new NeuralCorefAlgorithm(props, dictionaries);\n    } else if (algorithm == CorefAlgorithmType.FASTNEURAL) {\n      return new FastNeuralCorefAlgorithm(props, dictionaries);\n    } else if (algorithm == CorefAlgorithmType.CUSTOM) {\n      String classname = PropertiesUtils.getString(props, \"coref.algorithm.class\", null);\n      try {\n        if (classname != null) {\n          Class clazz = Class.forName(classname);\n          return (CorefAlgorithm) clazz.getConstructor(Properties.class, Dictionaries.class).newInstance(props, dictionaries);\n        } else {\n          throw new RuntimeException(\"Please specify coref.algorithm.class\");\n        }\n      } catch (Exception e) {\n        throw new RuntimeException(\"Error creating custom coref system\", e);\n      }\n    } else {\n      try {\n        return new HybridCorefSystem(props, dictionaries);\n      } catch (Exception e) {\n        throw new RuntimeException(\"Error creating hybrid coref system\", e);\n      }\n    }\n  }\n\n}\n","sourceCodeStart":24,"sourceCodeEnd":57,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/coref/CorefAlgorithm.java#L24-L57","documentation":"CorefAlgorithm.fromProps dispatches on coref.algorithm (clustering/statistical/neural/fastneural); this error fires when the property coref.algorithm.class is missing and no built-in algorithm type matches, so the factory cannot instantiate a coreference algorithm.","triggerScenarios":"Thrown at src/edu/stanford/nlp/coref/CorefAlgorithm.java:42 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set -coref.algorithm.class to a CorefAlgorithm implementation class name","Or choose a built-in algorithm (statistical, neural, fastneural, clustering) via coref.algorithm"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}