Return-Path: X-Original-To: apmail-ctakes-notifications-archive@www.apache.org Delivered-To: apmail-ctakes-notifications-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5A94B1057F for ; Tue, 22 Oct 2013 20:57:16 +0000 (UTC) Received: (qmail 30842 invoked by uid 500); 22 Oct 2013 20:56:52 -0000 Delivered-To: apmail-ctakes-notifications-archive@ctakes.apache.org Received: (qmail 30782 invoked by uid 500); 22 Oct 2013 20:56:50 -0000 Mailing-List: contact notifications-help@ctakes.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ctakes.apache.org Delivered-To: mailing list notifications@ctakes.apache.org Received: (qmail 30706 invoked by uid 99); 22 Oct 2013 20:56:45 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Oct 2013 20:56:45 +0000 Date: Tue, 22 Oct 2013 20:56:45 +0000 (UTC) From: "Bruce Tietjen (JIRA)" To: notifications@ctakes.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (CTAKES-251) Infinite recursion in DrugMentionAnnotator.java MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Bruce Tietjen created CTAKES-251: ------------------------------------ Summary: Infinite recursion in DrugMentionAnnotator.java Key: CTAKES-251 URL: https://issues.apache.org/jira/browse/CTAKES-251 Project: cTAKES Issue Type: Bug Components: ctakes-drug-ner Affects Versions: 3.0-incubating, 3.1, 3.2, 3.1.1 Reporter: Bruce Tietjen Priority: Critical Test document text (minimal text necessary to trigger the bug): aspirin decreased from 2:00 PM. NOTE: My testing indicates that the proposed fix should also fix example 1> in Jira 246. Call path: generageDrugMentionsAndAnnotations statusChangePhraseGenerator (infinite recursion starts here) generateAdditionalNER generateDrugMentionsAndAnnotations statusChangePhraseGenerator generateAdditionalNER ... I believe the problem occurs in generateAdditionalNER() at ~line 2213 with getAdjustedWindowSpan() returning -1. This causes the call to generateDrugMentionsAndAnnotations() to process the whole document again rather than the remaining portion of the text. Source code snippet: } else if (drugChangeStatus.getChangeStatus().compareTo( DrugChangeStatusToken.DECREASEFROM) == 0) { if (noPriorMention) {//Look for lowest value on right side beginChunk = getAdjustedWindowSpan(jcas, beginChunk, endSpan, true)[0]; } String [] changeStatusArray = new String [] {DrugChangeStatusToken.DECREASE, new Integer (drugChangeStatus.getBegin()).toString(), new Integer(drugChangeStatus.getEnd()).toString()}; generateDrugMentionsAndAnnotations(jcas, buildNewNER, beginChunk, endSpan, tokenDrugNER, changeStatusArray, count, globalNER); A simple fix might be to add the two lines: if (noPriorMention) {//Look for lowest value on right side beginChunk = getAdjustedWindowSpan(jcas, beginChunk, endSpan, true)[0]; --> if (beginChunk == -1) --> beginChunk = drugChangeStatus.getEnd(); } Changing the logic inside getAdjustedWindowSpan() might be a more correct and complete fix, but requires a much more detailed knowledge of the code. -- This message was sent by Atlassian JIRA (v6.1#6144)