{"record":{"id":"58f6595695973aba","repo":"stanfordnlp/CoreNLP","slug":"unknown-clique-clique","errorCode":null,"errorMessage":"Unknown clique: \" + clique","messagePattern":"Unknown clique: \" \\+ clique","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/ie/NERFeatureFactory.java","lineNumber":431,"sourceCode":"      featuresCpC(cInfo, loc, c);\n      featuresCnC(cInfo, loc - 1, c);\n    } else if (clique == cliqueCp2C) {\n      featuresCp2C(cInfo, loc, c);\n    } else if (clique == cliqueCp3C) {\n      featuresCp3C(cInfo, loc, c);\n    } else if (clique == cliqueCp4C) {\n      featuresCp4C(cInfo, loc, c);\n    } else if (clique == cliqueCp5C) {\n      featuresCp5C(cInfo, loc, c);\n    } else if (clique == cliqueCpCp2C) {\n      featuresCpCp2C(cInfo, loc, c);\n      featuresCpCnC(cInfo, loc - 1, c);\n    } else if (clique == cliqueCpCp2Cp3C) {\n      featuresCpCp2Cp3C(cInfo, loc, c);\n    } else if (clique == cliqueCpCp2Cp3Cp4C) {\n      featuresCpCp2Cp3Cp4C(cInfo, loc, c);\n    } else {\n      throw new IllegalArgumentException(\"Unknown clique: \" + clique);\n    }\n\n    // log.info(StringUtils.join(features,\"\\n\")+\"\\n\");\n    return features;\n  }\n\n  /**\n   * This class handles collecting features into a set, in a more memory efficient way.\n   *\n   * The benefits arise from handling the concatenation and suffix appending re-using a\n   * single buffer, rather than repeatedly concatenating strings.\n   *\n   * This class is <em>not thread safe</em>, but you are unlikely to want to parallelize\n   * at this low level anyway.\n   *\n   * @author Erich Schubert\n   */\n  protected static class FeatureCollector {","sourceCodeStart":413,"sourceCodeEnd":449,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/ie/NERFeatureFactory.java#L413-L449","documentation":"NERFeatureFactory.getCliqueFeatures dispatches on the requested clique (C, CpC, CpCp2C, etc.) and throws IllegalArgumentException when the clique identifier does not match any supported template. This guards the feature extraction against unknown clique constants passed in during training or inference.","triggerScenarios":"Passing a clique Clique/Factor value to getCliqueFeatures that is not one of the constants defined in NERFeatureFactory (e.g. a clique from a different feature factory or a custom clique), typically via a flags/clique config in SeqClassifierFlags.","commonSituations":"Mixing CRFFeatureFactory cliques with NERFeatureFactory, custom flag edits adding unsupported cliques, or upgrading models trained with cliques unsupported by this factory.","solutions":["Use only clique constants defined in NERFeatureFactory (cliqueC, cliqueCpC, cliqueCp2C, cliqueCpCp2C, cliqueCpCp2Cp3C, etc.).","Inspect the flags (featureFactory and clique settings) to ensure the selected factory supports the configured cliques.","If a custom clique is needed, extend NERFeatureFactory and add a branch plus the corresponding feature extraction method."],"exampleFix":"// before\nflags.featureFactory = new NERFeatureFactory();\ncliques.add(myCustomClique); // unknown clique\n// after\nflags.featureFactory = new NERFeatureFactory();\ncliques.add(Clique.valueOf(new String[]{\"C\",\"pC\"})); // supported clique","handlingStrategy":"validation","validationCode":"Set<Clique> allowed = NERFeatureFactory.cliques; // all cliques defined by NERFeatureFactory\nif (!allowed.contains(clique)) {\n  throw new IllegalArgumentException(\"Clique not supported by NERFeatureFactory: \" + clique);\n}","typeGuard":null,"tryCatchPattern":"try {\n  List<String> feats = featureFactory.getCliqueFeatures(p, pos, clique);\n} catch (IllegalArgumentException e) {\n  throw new IllegalStateException(\"Unsupported clique config for NER: \" + e.getMessage(), e);\n}","preventionTips":["Use only the clique constants exported by NERFeatureFactory.","Do not mix feature factory types (CRFFeatureFactory vs NERFeatureFactory cliques).","Verify flags.clique settings after CoreNLP upgrades; supported cliques can change."],"tags":["nlp","configuration","illegal-argument","java"],"backgroundTag":"invalid-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"}