12.07.2015 Views

View - ResearchGate

View - ResearchGate

View - ResearchGate

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

166 Osborne et al.public class MMTxGeneRIF extends MMTxAPILite{private static ArrayList _genediseasemaps=new ArrayList(); //Our datastructureprivate static GeneRIF _currentRIF = null;public MMTxGeneRIF(String[] args) { super.init(args); }public MMTxGeneRIF(){};public void processMappings(Sentence pSentence) throws Exception {Vector phrases = pSentence.getPhrases();for(Iterator g=phrases.iterator();g.hasNext();){Phrase aPhrase = (Phrase) g.next();if(aPhrase.getOriginalString().indexOf(“Undesired phrase here”))continue;ArrayList topMappings=aPhrase.getBestFinalMappings();if(topMappings !=null ) {for(Iterator q=topMappings.iterator();q.hasNext();){FinalMapping topMapping = (FinalMapping)q.next();ArrayList cuis = topMapping.getCandidates();for(Iterator l = cuis.iterator(); l.hasNext();){Candidate c = (Candidate)l.next();System.out.println(c.getCUI()+”|”+aPhrase.getOriginalString()+“|”+c.getCandidateScore());} } } } } }The other program (MapClient.java) is responsible only for parsing theinput data and calling the MMTxGeneRIF process document function. Userswill have to find or write their own parser for whatever data they areinputting.MapClient.javaimport edu.northwestern.bcore.dotools.SetupSingleton;import edu.northwestern.bcore.dotools.UMLSFileTools;import java.util.*;public class MapClient {public static void main(String[] args){MMTxGeneRIF myMMTx = null;try {myMMTx= new MMTxGeneRIF();Hashtable inputphrases = parseFile(args[0]);//Write out our document to processfor(Iterator it = inputphrases.keySet().iterator();it.hasNext();){

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!