{"record":{"id":"55dae625aa92a355","repo":"stanfordnlp/CoreNLP","slug":"expected-a-property-name-model","errorCode":null,"errorMessage":"Expected a property \" + name + \".model","messagePattern":"Expected a property \" \\+ name \\+ \"\\.model","errorType":"validation","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/pipeline/ArabicSegmenterAnnotator.java","lineNumber":76,"sourceCode":"  public ArabicSegmenterAnnotator(String name, Properties props) {\n    String model = null;\n    // Keep only the properties that apply to this annotator\n    Properties modelProps = new Properties();\n    String desiredKey = name + '.';\n    for (String key : props.stringPropertyNames()) {\n      if (key.startsWith(desiredKey)) {\n        // skip past name and the subsequent \".\"\n        String modelKey = key.substring(desiredKey.length());\n        if (modelKey.equals(\"model\")) {\n          model = props.getProperty(key);\n        } else {\n          modelProps.setProperty(modelKey, props.getProperty(key));\n        }\n      }\n    }\n    this.VERBOSE = PropertiesUtils.getBool(props, name + \".verbose\", false);\n    if (model == null) {\n      throw new RuntimeException(\"Expected a property \" + name + \".model\");\n    }\n    loadModel(model, modelProps);\n\n    // TODO: unify with ChineseSegmenterAnnotator somehow?\n    // The issue here is the Chinese segmenter returns text chunks and\n    // the Arabic segmenter has a method which returns CoreLabels, so\n    // the project of unifying the two into one ur-SegmenterAnnotator\n    // is larger than simply ripping some code into a superclass and\n    // calling it a day\n\n    // If newlines are treated as sentence split, we need to retain them in tokenization for ssplit to make use of them\n    tokenizeNewline = (!props.getProperty(StanfordCoreNLP.NEWLINE_IS_SENTENCE_BREAK_PROPERTY, \"never\").equals(\"never\"))\n            || Boolean.valueOf(props.getProperty(StanfordCoreNLP.NEWLINE_SPLITTER_PROPERTY, \"false\"));\n\n    // record whether or not sentence splitting on two newlines ; if so, need to remove single newlines\n    sentenceSplitOnTwoNewlines =\n        props.getProperty(StanfordCoreNLP.NEWLINE_IS_SENTENCE_BREAK_PROPERTY, \"never\").equals(\"two\");\n  }","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/pipeline/ArabicSegmenterAnnotator.java#L58-L94","documentation":"ArabicSegmenterAnnotator requires a segmentation model file. After scanning the properties for '<name>.model' (e.g. arabic.model), if no model path was found it throws this RuntimeException before loadModel().","triggerScenarios":"Adding the 'arabicsegmenter' annotator to a pipeline without setting the '<prefix>.model' property, or setting a misspelled key the property scan doesn't recognize.","commonSituations":"Forgetting to download the Arabic segmentation model; using the wrong properties prefix; model property set under a name that doesn't match the annotator's configured name.","solutions":["Set the model property, e.g. props.setProperty(\"arabicsegmenter.model\", \"data/arabic-segmenter-atbtrain.ser.gz\")","Ensure the model file exists and is a valid serialized segmenter model","Confirm the property prefix matches the name the annotator was created with"],"exampleFix":"// before\nprops.setProperty(\"annotators\", \"arabicsegmenter\");\n// after\nprops.setProperty(\"annotators\", \"arabicsegmenter\");\nprops.setProperty(\"arabicsegmenter.model\", \"edu/stanford/nlp/models/arabic/segmentation/arabic-segmenter-atbtrain.ser.gz\");","handlingStrategy":"validation","validationCode":"if (props.getProperty(\"arabicsegmenter.model\") == null && props.getProperty(\"model\") == null) {\n  throw new IllegalArgumentException(\"arabicsegmenter requires a model property\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  new ArabicSegmenterAnnotator(name, props);\n} catch (RuntimeException e) {\n  if (e.getMessage().contains(\"Expected a property\")) {\n    // set the .model property and retry\n  } else throw e;\n}","preventionTips":["Include the stanford-arabic models jar or provide your own model path","Verify model file existence before pipeline creation","Keep property prefixes consistent with the annotator name"],"tags":["stanford-corenlp","missing-model","configuration","arabic-segmenter"],"backgroundTag":"missing-required-config-field","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"}