@Override public Frame getScoringFrame(Trace trace) { Frame frame=super.getScoringFrame(trace); if (frame == null) { return null; } if (validateScoringFrame(frame) == null) { return null; // can happen if annotation says "endPoint=false" } else { return frame; } }
@Override protected OperationType validateScoringFrame(Frame frame) { OperationType type=super.validateScoringFrame(frame); if (type == null) { return null; } Operation op=frame.getOperation(); Boolean fromValue=op.get("from", Boolean.class); if ((fromValue == null) || (!fromValue.booleanValue())) { return null; } return type; }
@Override protected OperationType validateFrameOperation (Frame frame) { OperationType opType=super.validateFrameOperation(frame); if (opType == null) { return null; } // even if correct type, check if marked as endpoint Operation operation=frame.getOperation(); Boolean endPoint=operation.get(ENDPOINT_VALIDITY_PROP, Boolean.class); if ((endPoint == null) || (!endPoint.booleanValue())) { return null; } return opType; }
@Override protected EndPointAnalysis makeEndPoint(Frame annotatedFrame, int depth) { EndPointAnalysis result=super.makeEndPoint(annotatedFrame, depth); Operation operation=annotatedFrame.getOperation(); String annotatedName=operation.get(ENDPOINT_NAME_OVERRIDE_PROP, String.class); if (!StringUtil.isEmpty(annotatedName)) { result.setEndPoint(EndPointName.valueOf(annotatedName)); } Boolean useDepthScore=operation.get(DEPTH_SCORE_PROP, Boolean.class); if ((useDepthScore != null) && useDepthScore.booleanValue()) { result.setScore(EndPointAnalysis.depth2score(depth)); } return result; }
@Override public Frame getScoringFrame(Trace trace) { Frame frame=super.getScoringFrame(trace); if (frame == null) { return frame; } if (validateScoringFrame(frame) == null) { return null; } else { return frame; } }