[
https://issues.apache.org/jira/browse/CTAKES-251?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Pei Chen resolved CTAKES-251.
-----------------------------
Resolution: Fixed
Fixed in trunk.
Adding the temp patch for the interim while there will be a new drug module(s)
coming soon...
> 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
> Assignee: Pei Chen
> Priority: Critical
> Fix For: 3.1.1
>
>
> 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)