{"record":{"id":"997f86418402ad70","repo":"stanfordnlp/CoreNLP","slug":"this-getclass-getname-case-is-presently-u","errorCode":null,"errorMessage":"this.getClass().getName() + \": Case is presently unsupported!\"","messagePattern":"this\\.getClass\\(\\)\\.getName\\(\\) \\+ \": Case is presently unsupported!\"","errorType":"exception","errorClass":"java.lang.RuntimeException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/international/arabic/ArabicMorphoFeatureSpecification.java","lineNumber":54,"sourceCode":"\n  // Standard feature tuple (e.g., \"3MS\", \"1P\", etc.)\n  private static final Pattern pFeatureTuple = Pattern.compile(\"(\\\\d\\\\p{Upper}\\\\p{Upper}?)\");\n\n  // Demonstrative pronouns do not have number\n  private static final Pattern pDemPronounFeatures = Pattern.compile(\"DEM_PRON(.+)\");\n\n  //Verbal patterns\n  private static final Pattern pVerbMood = Pattern.compile(\"MOOD|SUBJ\");\n  private static final Pattern pMood = Pattern.compile(\"_MOOD:([ISJ])\");\n  private static final Pattern pVerbTenseMarker = Pattern.compile(\"IV|PV|CV\");\n  private static final Pattern pNounNoMorph = Pattern.compile(\"PROP|QUANT\");\n\n  @Override\n  public List<String> getValues(MorphoFeatureType feat) {\n    if(feat == MorphoFeatureType.DEF)\n      return Arrays.asList(defVals);\n    else if(feat == MorphoFeatureType.CASE) {\n      throw new RuntimeException(this.getClass().getName() + \": Case is presently unsupported!\");\n//      return Arrays.asList(caseVals);\n    } else 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 if(feat == MorphoFeatureType.POSS)\n      return Arrays.asList(possVals);\n    else if(feat == MorphoFeatureType.VOICE)\n      return Arrays.asList(voiceVals);\n    else if(feat == MorphoFeatureType.MOOD)\n      return Arrays.asList(moodVals);\n    else if(feat == MorphoFeatureType.TENSE)\n      return Arrays.asList(tenseVals);\n    else\n      throw new IllegalArgumentException(\"Arabic does not support feature type: \" + feat.toString());\n  }","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/international/arabic/ArabicMorphoFeatureSpecification.java#L36-L72","documentation":"ArabicMorphoFeatureSpecification.getValues throws this RuntimeException when asked for the values of MorphoFeatureType.CASE, because the Arabic morphological analyzer does not model case as a feature. The class defines value arrays for DEF, GEN, NUM, PER, VOICE, MOOD, and TENSE but deliberately leaves CASE unsupported rather than returning an empty list.","triggerScenarios":"Calling getValues(MorphoFeatureType.CASE) on an ArabicMorphoFeatureSpecification instance, typically when iterating all MorphoFeatureType values or running the morphological analyzer pipeline configured with Arabic features that includes CASE.","commonSituations":"Code written generically over languages (shared across English/Arabic pipelines) that requests every feature type including CASE; enabling case morphological analysis in Arabic tagging options where the Arabic specification cannot supply the value inventory.","solutions":["Do not request MorphoFeatureType.CASE when using the Arabic feature specification; filter it out of your feature loop.","Guard with feat != MorphoFeatureType.CASE before calling getValues.","If case analysis is required, use a language specification that supports it (e.g. the generic/English one) instead of the Arabic one.","As a last resort, patch the class to return the (commented-out) caseVals list, accepting it is not linguistically grounded for Arabic."],"exampleFix":"// before\nfor (MorphoFeatureType feat : MorphoFeatureType.values()) {\n  List<String> vals = spec.getValues(feat);\n  ...\n}\n// after\nfor (MorphoFeatureType feat : MorphoFeatureType.values()) {\n  if (feat == MorphoFeatureType.CASE) continue;\n  List<String> vals = spec.getValues(feat);\n  ...\n}","handlingStrategy":"type-guard","validationCode":"// java: skip unsupported features before querying\nstatic boolean isSupported(MorphoFeatureSpecification spec, MorphoFeatureType feat) {\n  return !(spec instanceof ArabicMorphoFeatureSpecification) || feat != MorphoFeatureType.CASE;\n}","typeGuard":"// java\nif (feat == MorphoFeatureType.CASE && spec instanceof ArabicMorphoFeatureSpecification) {\n  return Collections.emptyList(); // CASE unsupported for Arabic\n}\nList<String> vals = spec.getValues(feat);","tryCatchPattern":"try {\n  vals = spec.getValues(feat);\n} catch (RuntimeException e) {\n  if (e.getMessage() != null && e.getMessage().endsWith(\"Case is presently unsupported!\")) {\n    vals = Collections.emptyList();\n  } else throw e;\n}","preventionTips":["Never iterate all MorphoFeatureType values for Arabic without filtering CASE.","Maintain a per-language supported-features map in pipeline code.","Read the Arabic specification docs before enabling morphological features generically."],"tags":["java","nlp","arabic","unsupported-feature"],"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"}