Return-Path: X-Original-To: apmail-ctakes-commits-archive@www.apache.org Delivered-To: apmail-ctakes-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8E92310500 for ; Mon, 1 Jul 2013 17:28:33 +0000 (UTC) Received: (qmail 92124 invoked by uid 500); 1 Jul 2013 17:28:33 -0000 Delivered-To: apmail-ctakes-commits-archive@ctakes.apache.org Received: (qmail 92096 invoked by uid 500); 1 Jul 2013 17:28:33 -0000 Mailing-List: contact commits-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 commits@ctakes.apache.org Received: (qmail 92089 invoked by uid 99); 1 Jul 2013 17:28:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jul 2013 17:28:32 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jul 2013 17:28:29 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 3EC7F2388900; Mon, 1 Jul 2013 17:28:08 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1498581 - in /ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae: OrangeBookFilterConsumerImpl.java UmlsToSnomedConsumerImpl.java Date: Mon, 01 Jul 2013 17:28:08 -0000 To: commits@ctakes.apache.org From: james-masanz@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130701172808.3EC7F2388900@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: james-masanz Date: Mon Jul 1 17:28:07 2013 New Revision: 1498581 URL: http://svn.apache.org/r1498581 Log: CTAKES-190 - more related to MedicationMention being used instead of MedicationEventMention as of 3.1. (Will make several separate commits because of timeouts occurring while svn is temporarily routed through EU) Modified: ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/OrangeBookFilterConsumerImpl.java ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/UmlsToSnomedConsumerImpl.java Modified: ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/OrangeBookFilterConsumerImpl.java URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/OrangeBookFilterConsumerImpl.java?rev=1498581&r1=1498580&r2=1498581&view=diff ============================================================================== --- ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/OrangeBookFilterConsumerImpl.java (original) +++ ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/OrangeBookFilterConsumerImpl.java Mon Jul 1 17:28:07 2013 @@ -24,7 +24,7 @@ import org.apache.ctakes.dictionary.look import org.apache.ctakes.typesystem.type.constants.CONST; import org.apache.ctakes.typesystem.type.refsem.OntologyConcept; import org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation; -import org.apache.ctakes.typesystem.type.textsem.MedicationEventMention; +import org.apache.ctakes.typesystem.type.textsem.MedicationMention; import org.apache.log4j.Logger; import org.apache.lucene.index.Term; import org.apache.lucene.search.*; @@ -99,7 +99,7 @@ public class OrangeBookFilterConsumerImp validCodes.add( code ); } final FSArray ocArr = createOntologyConceptArr( jcas, validCodes ); - IdentifiedAnnotation neAnnot = new MedicationEventMention( jcas ); // medication NEs are EventMention + IdentifiedAnnotation neAnnot = new MedicationMention( jcas ); // medication NEs are EventMention neAnnot.setTypeID( CONST.NE_TYPE_ID_DRUG ); neAnnot.setBegin( neBegin ); neAnnot.setEnd( neEnd ); Modified: ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/UmlsToSnomedConsumerImpl.java URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/UmlsToSnomedConsumerImpl.java?rev=1498581&r1=1498580&r2=1498581&view=diff ============================================================================== --- ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/UmlsToSnomedConsumerImpl.java (original) +++ ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/UmlsToSnomedConsumerImpl.java Mon Jul 1 17:28:07 2013 @@ -98,100 +98,6 @@ public abstract class UmlsToSnomedConsum protected abstract Set getSnomedCodes( final String umlsCode ) throws SQLException, DictionaryException; -// /** -// * {@inheritDoc} -// */ -// @Override -// public void consumeHits( final JCas jcas, final Iterator lhItr ) throws AnalysisEngineProcessException { -// try { -// final String cuiPropKey = props.getProperty( CUI_MF_PRP_KEY ); -// final String tuiPropKey = props.getProperty( TUI_MF_PRP_KEY ); -// final Iterator hitsByOffsetItr = organizeByOffset( lhItr ); -// while ( hitsByOffsetItr.hasNext() ) { -// final Collection hitsAtOffsetCol = (Collection) hitsByOffsetItr.next(); -// -// // Iterate over the LookupHit objects and group Snomed codes by NE type -// // For each NE type for which there is a hit, get all the Snomed codes -// // that map to the given CUI. -// -// // Use key "cui,tui" to avoid duplicates at this offset -// final Set cuiTuiSet = new HashSet(); -// -// // key = type of named entity (java.lang.Integer) -// // val = set of UmlsConcept objects (java.util.Set) -// final Map> conceptMap = new HashMap>(); -// -// final Iterator lhAtOffsetItr = hitsAtOffsetCol.iterator(); -// int neBegin = -1; -// int neEnd = -1; -// while ( lhAtOffsetItr.hasNext() ) { -// final LookupHit lh = (LookupHit) lhAtOffsetItr.next(); -// neBegin = lh.getStartOffset(); -// neEnd = lh.getEndOffset(); -// -// final MetaDataHit mdh = lh.getDictMetaDataHit(); -// final String cui = mdh.getMetaFieldValue( cuiPropKey ); -// final String tui = mdh.getMetaFieldValue( tuiPropKey ); -// -// //String text = lh.getDictMetaDataHit().getMetaFieldValue("text"); -// if ( !_validTuiSet.contains( tui ) ) { -// continue; -// } -// final String cuiTuiKey = getUniqueKey( cui, tui ); -// if ( cuiTuiSet.contains( cuiTuiKey ) ) { -// continue; -// } -// cuiTuiSet.add( cuiTuiKey ); -// final Set snomedCodeSet = getSnomedCodes( cui ); -// if ( !snomedCodeSet.isEmpty() ) { -// final Integer neType = getNamedEntityType( tui ); -// Set conceptSet; -// if ( conceptMap.containsKey( neType ) ) { -// conceptSet = conceptMap.get( neType ); -// } else { -// conceptSet = new HashSet(); -// } -// final Collection conceptCol = createConceptCol( jcas, cui, tui, snomedCodeSet ); -// conceptSet.addAll( conceptCol ); -// conceptMap.put( neType, conceptSet ); -// } -// } -// -// final Collection conceptKeys = conceptMap.keySet(); -// for ( Integer conceptKey : conceptKeys ) { -// final Set conceptSet = conceptMap.get( conceptKey ); -// -// // Skip updating CAS if all Concepts for this type were filtered out -// // for this span. -// if ( !conceptSet.isEmpty() ) { -// FSArray conceptArr = new FSArray( jcas, conceptSet.size() ); -// int arrIdx = 0; -// for ( UmlsConcept umlsConcept : conceptSet ) { -// conceptArr.set( arrIdx, umlsConcept ); -// arrIdx++; -// } -// -// IdentifiedAnnotation neAnnot; -// if ( conceptKey == CONST.NE_TYPE_ID_DRUG ) { -// neAnnot = new MedicationEventMention( jcas ); -// } else { -// neAnnot = new EntityMention( jcas ); -// } -// neAnnot.setTypeID( conceptKey ); -// neAnnot.setBegin( neBegin ); -// neAnnot.setEnd( neEnd ); -// neAnnot.setDiscoveryTechnique( CONST.NE_DISCOVERY_TECH_DICT_LOOKUP ); -// neAnnot.setOntologyConceptArr( conceptArr ); -// neAnnot.addToIndexes(); -// } -// } -// } -// } catch ( Exception e ) { -// throw new AnalysisEngineProcessException( e ); -// } -// } - - /** * {@inheritDoc} */