Examples of MetaDataHit


Examples of org.apache.ctakes.dictionary.lookup.MetaDataHit

   * @param lh
   * @return
   */
  private boolean isDuplicate(LookupHit lh)
  {
    MetaDataHit mdh = lh.getDictMetaDataHit();

    // iterate over MetaDataHits that have already been seen
    String offsetKey = getOffsetKey(lh);
    Set<MetaDataHit> mdhDuplicateSet = iv_dupMap.get(offsetKey);
    if (mdhDuplicateSet != null)
    {
      Iterator<MetaDataHit> itr = mdhDuplicateSet.iterator();
      while (itr.hasNext())
      {
        MetaDataHit otherMdh = itr.next();
        if (mdh.equals(otherMdh))
        {
          // current LookupHit is a duplicate
          return true;
        }
View Full Code Here

Examples of org.apache.ctakes.dictionary.lookup.MetaDataHit

    *
    * @param lookupHit
    * @return
    */
   private boolean isDuplicate( final LookupHit lookupHit ) {
      final MetaDataHit metaDataHit = lookupHit.getDictMetaDataHit();
      // iterate over MetaDataHits that have already been seen
      final LookupHitKey lookupHitKey = new LookupHitKey( lookupHit );
      Set<MetaDataHit> mdhDuplicateSet = _duplicateDataMap.get(lookupHitKey);
      if (mdhDuplicateSet != null && mdhDuplicateSet.contains( metaDataHit ) ) {
         // current LookupHit is a duplicate
View Full Code Here

Examples of org.apache.ctakes.dictionary.lookup.MetaDataHit

            if ((mdhCol != null) && (mdhCol.size() > 0))
            {
                Iterator<MetaDataHit> mdhMatchItr = mdhCol.iterator();
                while (mdhMatchItr.hasNext())
                {
                    MetaDataHit mdh = mdhMatchItr.next();
                    LookupHit lh = new LookupHit(mdh, lt.getStartOffset(), lt
                            .getEndOffset());
                    lhList.add(lh);
                }
            }
View Full Code Here

Examples of org.apache.ctakes.dictionary.lookup.MetaDataHit

                  "You may want to consider setting a higher value, since there may be more entries not being returned in the event greater than "
                        + iv_maxHits + " exist." );
         }
         for ( ScoreDoc scoreDoc : hits ) {
            final Document luceneDoc = iv_searcher.doc( scoreDoc.doc );
            final MetaDataHit mdh = new LuceneDocumentMetaDataHitImpl( luceneDoc );
            metaDataHitSet.add( mdh );
         }
         return metaDataHitSet;
      } catch ( IOException ioe ) {
         // thrown by IndexSearcher.search(), IndexSearcher.doc()
View Full Code Here

Examples of org.apache.ctakes.dictionary.lookup.MetaDataHit

      if ( strTableRows.length == 0 ) {
         return Collections.emptySet();
      }
      final Set<MetaDataHit> metaDataHitSet = new HashSet<>();
      for ( StringTableRow tableRow : strTableRows ) {
         final MetaDataHit metaDataHit = new StringTableRowMetaDataHitImpl( tableRow );
         metaDataHitSet.add( metaDataHit );
      }
      return metaDataHitSet;
   }
View Full Code Here

Examples of org.apache.ctakes.dictionary.lookup.MetaDataHit

            final Map<Integer,Set<UmlsConcept>> conceptMap = new HashMap<>();
            // 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.
            for ( LookupHit lookupHit : entry.getValue() ) {
               final MetaDataHit mdh = lookupHit.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 );
View Full Code Here

Examples of org.apache.ctakes.dictionary.lookup.MetaDataHit

         final String text = jcas.getDocumentText().substring( neBegin, neEnd ).trim().toLowerCase();
         final boolean isValid = isValid( "trade_name", text ) || isValid( "ingredient", text );
         if ( isValid ) {
            final Set<String> validCodes = new HashSet<>();
            for ( LookupHit lookupHit : entry.getValue() ) {
               final MetaDataHit mdh = lookupHit.getDictMetaDataHit();
               final String code = mdh.getMetaFieldValue( CODE_MF );
               validCodes.add( code );
            }
            final FSArray ocArr = createOntologyConceptArr( jcas, validCodes );
            IdentifiedAnnotation neAnnot = new MedicationMention( jcas ); // medication NEs are EventMention
            neAnnot.setTypeID( CONST.NE_TYPE_ID_DRUG );
View Full Code Here

Examples of org.apache.ctakes.dictionary.lookup.MetaDataHit

            while ( metaFieldNameItr.hasNext() ) {
               final String metaFieldName = metaFieldNameItr.next();
               final String metaFieldValue = rs.getString( metaFieldName );
               nameValMap.put( metaFieldName, metaFieldValue );
            }
            final MetaDataHit mdh = new GenericMetaDataHitImpl( nameValMap );
            metaDataHitSet.add( mdh );
         }
         return metaDataHitSet;
      } catch ( SQLException e ) {
         throw new DictionaryException( e );
View Full Code Here

Examples of org.apache.ctakes.dictionary.lookup.MetaDataHit

   private int countUniqueCodes( final Collection<LookupHit> hitsAtOffset ) {
      final String CODE_MF = _properties.getProperty( CODE_MF_PRP_KEY );
      final Set<String> codes = new HashSet<>();
      for ( LookupHit lookupHit : hitsAtOffset ) {
         final MetaDataHit mdh = lookupHit.getDictMetaDataHit();
         final String code = mdh.getMetaFieldValue( CODE_MF );
         codes.add( code );
      }
      return codes.size();
   }
View Full Code Here

Examples of org.apache.ctakes.dictionary.lookup.MetaDataHit

         // a corresponding JCas OntologyConcept object that will
         // be placed in a FSArray
         int ocArrIdx = 0;
         final Set<String> codes = new HashSet<>();
         for ( LookupHit lookupHit : entry.getValue() ) {
            final MetaDataHit mdh = lookupHit.getDictMetaDataHit();
            final String code = mdh.getMetaFieldValue( CODE_MF );
            if ( !codes.contains( code ) ) {
               // create only first entry in the array for a code
               final OntologyConcept oc = new OntologyConcept( jcas );
               oc.setCode( code );
               oc.setCodingScheme( CODING_SCHEME );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.