Examples of MetaDataHit


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

         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<String>();
            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

   private int countUniqueCodes( final Collection<LookupHit> hitsAtOffset ) {
      final String CODE_MF = _properties.getProperty( CODE_MF_PRP_KEY );
      final Set<String> codes = new HashSet<String>();
      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<String>();
         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

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

        String text = jcas.getDocumentText().substring(
            lh.getStartOffset(),
            lh.getEndOffset());
        text = text.trim().toLowerCase();

        MetaDataHit mdh = lh.getDictMetaDataHit();
        String cuePhrase = mdh.getMetaFieldValue(AssertionCuePhraseConsumerImpl.CUE_PHRASE_FIELD_NAME);
        String cuePhraseFirstWord = mdh.getMetaFieldValue(AssertionCuePhraseConsumerImpl.CUE_PHRASE_FIRST_WORD_FIELD_NAME);
        String cuePhraseCategory = mdh.getMetaFieldValue(AssertionCuePhraseConsumerImpl.CUE_PHRASE_CATEGORY_FIELD_NAME);
        String cuePhraseFamily = mdh.getMetaFieldValue(AssertionCuePhraseConsumerImpl.CUE_PHRASE_FAMILY_FIELD_NAME);
        //String cuePhraseAssertionFamily = mdh.getMetaFieldValue(AssertionCuePhraseConsumerImpl.CUE_PHRASE_ASSERTION_FAMILY_FIELD_NAME);
       
//        String code = mdh.getMetaFieldValue(iv_props.getProperty(CODE_MF_PRP_KEY));
//
//        if (isValid("trade_name", text) || isValid("ingredient", text))
View Full Code Here

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 mdhDuplicateSet = (Set) iv_dupMap.get(offsetKey);
    if (mdhDuplicateSet != null)
    {
      Iterator itr = mdhDuplicateSet.iterator();
      while (itr.hasNext())
      {
        MetaDataHit otherMdh = (MetaDataHit) itr.next();
        if (mdh.equals(otherMdh))
        {
          // current LookupHit is a duplicate
          return true;
        }
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.