{"record":{"id":"6eb95ea0d38c953e","repo":"stanfordnlp/CoreNLP","slug":"french-does-not-support-feature-type","errorCode":null,"errorMessage":"French does not support feature type: ","messagePattern":"French does not support feature type: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/international/french/FrenchMorphoFeatureSpecification.java","lineNumber":45,"sourceCode":"  private static Redwood.RedwoodChannels log = Redwood.channels(FrenchMorphoFeatureSpecification.class);\n\n  private static final long serialVersionUID = -58379347760106784L;\n\n  public static final String[] genVals = {\"M\",\"F\"};\n  public static final String[] numVals = {\"SG\",\"PL\"};\n  public static final String[] perVals = {\"1\",\"2\",\"3\"};\n\n\n  @Override\n  public List<String> getValues(MorphoFeatureType feat) {\n    if(feat == MorphoFeatureType.GEN)\n      return Arrays.asList(genVals);\n    else if(feat == MorphoFeatureType.NUM)\n      return Arrays.asList(numVals);\n    else if(feat == MorphoFeatureType.PER)\n      return Arrays.asList(perVals);\n    else\n      throw new IllegalArgumentException(\"French does not support feature type: \" + feat.toString());\n  }\n\n  @Override\n  public MorphoFeatures strToFeatures(String spec) {\n    MorphoFeatures feats = new MorphoFeatures();\n\n    //Usually this is the boundary symbol\n    if(spec == null || spec.equals(\"\"))\n      return feats;\n\n    boolean isOtherActive = isActive(MorphoFeatureType.OTHER);\n    \n    if(spec.startsWith(\"ADV\")) {\n      feats.setAltTag(\"ADV\");\n      if(spec.contains(\"int\")) {\n        if (isOtherActive) {\n          feats.addFeature(MorphoFeatureType.OTHER, \"advint\");\n        }","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/international/french/FrenchMorphoFeatureSpecification.java#L27-L63","documentation":"FrenchMorphoFeatureSpecification.getValues returns the possible value set for a morphological feature. French morphology support covers only a subset of features (gender, number, person, tense, POS etc.); requesting values for an unsupported MorphoFeatureType throws IllegalArgumentException('French does not support feature type: ...').","triggerScenarios":"Calling getValues(feat) with a MorphoFeatureType that the French specification did not register (e.g. CASE or other features supported for other languages like German/Arabic but not French), typically during morphological analysis or tag-building of the French treebank pipeline.","commonSituations":"Reusing a MorphoFeatureSpecification config (morph feature selection) from another language for French; requesting the full universal feature inventory from the French spec.","solutions":["Only request feature values for features the French spec supports (GEND, NUM, PER, TENSE, etc.)","Check feature support before calling: iterate only over the spec's enabled features","Use the language-appropriate MorphoFeatureSpecification subclass for the features you need","Extend FrenchMorphoFeatureSpecification with value arrays if the feature must be supported"],"exampleFix":"// before\nList<String> vals = spec.getValues(MorphoFeatureType.CASE); // throws for French\n// after\nMorphoFeatureType feat = MorphoFeatureType.CASE;\nif (feat == MorphoFeatureType.GEND || feat == MorphoFeatureType.NUM || feat == MorphoFeatureType.PER || feat == MorphoFeatureType.TENSE) {\n  List<String> vals = spec.getValues(feat);\n}","handlingStrategy":"validation","validationCode":"boolean frenchSupported = feat == MorphoFeatureType.GEND || feat == MorphoFeatureType.NUM\n  || feat == MorphoFeatureType.PER || feat == MorphoFeatureType.TENSE;\nif (!frenchSupported) throw new IllegalStateException(\"Feature not supported for French: \" + feat);","typeGuard":null,"tryCatchPattern":"try { spec.getValues(feat); } catch (IllegalArgumentException e) { /* fall back to language-specific spec */ }","preventionTips":["Use the French MorphoFeatureSpecification only with features registered for French","Do not copy morph feature configurations across languages"],"tags":["java","nlp","french","morphology","unsupported-feature"],"backgroundTag":"unsupported-config-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"}