{"record":{"id":"2ac6992c163ddd02","repo":"stanfordnlp/CoreNLP","slug":"unknown-entry-s-in-dictionary-mname","errorCode":null,"errorMessage":"Unknown entry \"${s}\" in dictionary \"${mName}\"!","messagePattern":"Unknown entry \"(.+?)\" in dictionary \"(.+?)\"!","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/ie/machinereading/common/StringDictionary.java","lineNumber":95,"sourceCode":"   * if it does not exist. If mCreate is true, the count of the entry is\n   * incremented for every get If no entry found throws an exception if\n   * shouldThrow == true\n   */\n  public int get(String s, boolean shouldThrow) {\n    IndexAndCount ic = mDict.get(s);\n    if (mCreate) {\n      if (ic == null) {\n        ic = new IndexAndCount(mDict.size(), 0);\n        mDict.put(s, ic);\n        mInverse.put(Integer.valueOf(ic.mIndex), s);\n      }\n      ic.mCount++;\n    }\n    if (ic != null)\n      return ic.mIndex;\n\n    if (shouldThrow) {\n      throw new RuntimeException(\"Unknown entry \\\"\" + s + \"\\\" in dictionary \\\"\" + mName + \"\\\"!\");\n    } else {\n      return -1;\n    }\n  }\n\n  public static final String NIL_VALUE = \"nil\";\n\n  /**\n   * Reverse mapping from integer key to string value\n   */\n  public String get(int idx) {\n    if (idx == -1)\n      return NIL_VALUE;\n\n    String s = mInverse.get(idx);\n    if (s == null)\n      throw new RuntimeException(\"Unknown index \\\"\" + idx + \"\\\" in dictionary \\\"\" + mName + \"\\\"!\");\n    return s;","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/ie/machinereading/common/StringDictionary.java#L77-L113","documentation":"RuntimeException from StringDictionary.get(String,boolean) when shouldThrow is true and the string s is not present in the named dictionary (mName). It is a lookup guard used by machine-reading components for known entity/role strings; unknown tokens are fatal when strict lookups are requested.","triggerScenarios":"Thrown at src/edu/stanford/nlp/ie/machinereading/common/StringDictionary.java:95 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Call get with shouldThrow=false to get -1 for unknown entries","Pre-populate the dictionary or enable mCreate so unknown strings are added","Check token normalization (case, whitespace) before lookup"],"exampleFix":null,"handlingStrategy":"fallback","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"}