static void checkLength(TextAnnotation textAnnotation, boolean throwExceptionOnSentenceLengthCheck, int maxParseSentenceLength) throws AnnotatorException { if (throwExceptionOnSentenceLengthCheck) { Constituent c = HandlerUtils.checkTextAnnotationRespectsSentenceLengthLimit(textAnnotation, maxParseSentenceLength); if (null != c) { String msg = HandlerUtils.getSentenceLengthError(textAnnotation.getId(), c.getSurfaceForm(), maxParseSentenceLength); logger.error(msg); throw new AnnotatorException(msg); } } }
CoreMap sentence = sentences.get(sentenceId); if (maxParseSentenceLength > 0 && sentence.size() > maxParseSentenceLength) { logger.warn(HandlerUtils.getSentenceLengthError(textAnnotation.getId(), sentence.toString(), maxParseSentenceLength)); } else {
CoreMap sentence = sentences.get(sentenceId); if (maxParseSentenceLength > 0 && sentence.size() > maxParseSentenceLength) { logger.warn(HandlerUtils.getSentenceLengthError(textAnnotation.getId(), sentence.toString(), maxParseSentenceLength)); } else {
static void checkLength(TextAnnotation textAnnotation, boolean throwExceptionOnSentenceLengthCheck, int maxParseSentenceLength) throws AnnotatorException { if (throwExceptionOnSentenceLengthCheck) { Constituent c = HandlerUtils.checkTextAnnotationRespectsSentenceLengthLimit(textAnnotation, maxParseSentenceLength); if (null != c) { String msg = HandlerUtils.getSentenceLengthError(textAnnotation.getId(), c.getSurfaceForm(), maxParseSentenceLength); logger.error(msg); throw new AnnotatorException(msg); } } }