@Override
protected void validateArtifactMap() throws InvalidFormatException {
super.validateArtifactMap();
if (!(artifactMap.get(BUILD_MODEL_ENTRY_NAME) instanceof AbstractModel)) {
throw new InvalidFormatException("Missing the build model!");
}
ParserType modelType = getParserType();
if (modelType != null) {
if (ParserType.CHUNKING.equals(modelType)) {
if (artifactMap.get(ATTACH_MODEL_ENTRY_NAME) != null)
throw new InvalidFormatException("attachModel must be null for chunking parser!");
}
else if (ParserType.TREEINSERT.equals(modelType)) {
if (!(artifactMap.get(ATTACH_MODEL_ENTRY_NAME) instanceof AbstractModel))
throw new InvalidFormatException("attachModel must not be null!");
}
else {
throw new InvalidFormatException("Unkown ParserType!");
}
}
else {
throw new InvalidFormatException("Missing the parser type property!");
}
if (!(artifactMap.get(CHECK_MODEL_ENTRY_NAME) instanceof AbstractModel)) {
throw new InvalidFormatException("Missing the check model!");
}
if (!(artifactMap.get(PARSER_TAGGER_MODEL_ENTRY_NAME) instanceof POSModel)) {
throw new InvalidFormatException("Missing the tagger model!");
}
if (!(artifactMap.get(CHUNKER_TAGGER_MODEL_ENTRY_NAME) instanceof ChunkerModel)) {
throw new InvalidFormatException("Missing the chunker model!");
}
if (!(artifactMap.get(HEAD_RULES_MODEL_ENTRY_NAME) instanceof HeadRules)) {
throw new InvalidFormatException("Missing the head rules!");
}
}