gov.nih.nlm.nls.metamap
Interface Result

All Known Implementing Classes:
ResultImpl

public interface Result

A container for the machine output representation of a MetaMap result.

  List resultList = api.processCitationsFromString(terms);

  for (Result result: resultList) {
    List<AcronymsAbbrevs> aaList = result.getAcronymsAbbrevs();
    System.out.println("Acronyms and Abbreviations:");
    if (aaList.size() > 0) {
      for (AcronymsAbbrevs e: aaList) {
        String acronymText = e.getAcronym();
        ...
      }
    }
  

    List<Negation> negList = result.getNegations();
    if (negList.size() > 0) {
      for (Negation e: negList) {
        System.out.println("type: " + e.getType());
      }
    }

    for (Utterance utterance: result.getUtteranceList()) {
      for (PCM pcm: utterance.getPCMList()) {
        String phraseText = pcm.getPhrase().getPhraseText()
        for (Ev ev: pcm.getCandidateList()) {
        int score = ev.getScore();
          ...
        }
        for (gov.nih.nlm.nls.metamap.Map map: pcm.getMappings)) {
          for (Ev mapEv: map.getEvList()) {
            int score = ev.getScore();
            ...
          }
        }
      }
    }
  

Created: Wed Apr 29 15:44:14 2009


Method Summary
 java.util.List<AcronymsAbbrevs> getAcronymsAbbrevs()
          Return a list of Acronym and Abbreviations objects.
 java.util.List<AcronymsAbbrevs> getAcronymsAbbrevsList()
          Return a list of Acronym and Abbreviations objects.
 java.lang.String getInputText()
          Get input text that produced this result.
 java.lang.String getMachineOutput()
          Return the raw string representation of MetaMap machine output.
 se.sics.prologbeans.PBTerm getMMOPBlist()
          Return a prolog beans list of terms representing machine output.
 java.util.List<Negation> getNegationList()
          Return a list of Negation objects.
 java.util.List<Negation> getNegations()
          Return a list of Negation objects.
 java.util.List<Utterance> getUtteranceList()
          Return a list of Utterance objects.
 void setInputText(java.lang.String theInputText)
          Assign inputText that produced this result.
 void traverse(java.io.PrintStream out)
          Print machine output to stream.
 

Method Detail

setInputText

void setInputText(java.lang.String theInputText)
Assign inputText that produced this result.

Parameters:
theInputText - the input text

getInputText

java.lang.String getInputText()
Get input text that produced this result.

Returns:
theInputText the input text

getMMOPBlist

se.sics.prologbeans.PBTerm getMMOPBlist()
Return a prolog beans list of terms representing machine output.

Returns:
prolog beans list (PBTerm) of machine output terms

getMachineOutput

java.lang.String getMachineOutput()
Return the raw string representation of MetaMap machine output.

Returns:
a String containing the result as MetaMap machine output.

traverse

void traverse(java.io.PrintStream out)
Print machine output to stream.

Parameters:
out - stream to send output.

getAcronymsAbbrevs

java.util.List<AcronymsAbbrevs> getAcronymsAbbrevs()
                                                   throws java.lang.Exception
Return a list of Acronym and Abbreviations objects.

Returns:
a list of AcronymsAbbrevs objects
Throws:
java.lang.Exception

getAcronymsAbbrevsList

java.util.List<AcronymsAbbrevs> getAcronymsAbbrevsList()
                                                       throws java.lang.Exception
Return a list of Acronym and Abbreviations objects.

Returns:
a list of AcronymsAbbrevs objects
Throws:
java.lang.Exception

getNegations

java.util.List<Negation> getNegations()
                                      throws java.lang.Exception
Return a list of Negation objects.

Returns:
a list of Negation objects
Throws:
java.lang.Exception

getNegationList

java.util.List<Negation> getNegationList()
                                         throws java.lang.Exception
Return a list of Negation objects.

Returns:
a list of Negation objects
Throws:
java.lang.Exception

getUtteranceList

java.util.List<Utterance> getUtteranceList()
                                           throws java.lang.Exception
Return a list of Utterance objects.

Returns:
a list of Utterance objects
Throws:
java.lang.Exception