當前位置: 首頁>>代碼示例>>Java>>正文


Java Ev類代碼示例

本文整理匯總了Java中gov.nih.nlm.nls.metamap.Ev的典型用法代碼示例。如果您正苦於以下問題:Java Ev類的具體用法?Java Ev怎麽用?Java Ev使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Ev類屬於gov.nih.nlm.nls.metamap包,在下文中一共展示了Ev類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getClassification

import gov.nih.nlm.nls.metamap.Ev; //導入依賴的package包/類
public Map<Object, Object> getClassification(String term) throws Exception
{
	//String[] classfication = new String[3]; 
	Map<Object, Object> mp = new HashMap<Object, Object>();

	//Certain characters may cause MetaMap to throw an exception; 
	//filter terms before passing to mm.
	term = term.replaceAll("'", "");
	term = term.replaceAll("\"", "");

	List<Result> resultList = api.processCitationsFromString(term);
    //Result result = resultList.get(0);
	int i = 0;
    for(Result result:resultList){
	for (Utterance utterance: result.getUtteranceList()) 
	{	for (PCM pcm: utterance.getPCMList()) {
          /*for (Ev ev: pcm.getCandidatesInstance().getEvList()) {
	           System.out.println(" Candidate:");
	            System.out.println("  Score: " + ev.getScore());
	            System.out.println("  Concept Id: " + ev.getConceptId());
	            System.out.println("  Concept Name: " + ev.getConceptName());
	            System.out.println("  Preferred Name: " + ev.getPreferredName());
	            System.out.println("  Matched Words: " + ev.getMatchedWords());
	            System.out.println("  Semantic Types: " + ev.getSemanticTypes().get(0));
	            System.out.println("  MatchMap: " + ev.getMatchMap());
	            System.out.println("  MatchMap alt. repr.: " + ev.getMatchMapList());
	            System.out.println("  is Head?: " + ev.isHead());
	            System.out.println("  is Overmatch?: " + ev.isOvermatch());
	            System.out.println("  Sources: " + ev.getSources());
	            System.out.println("  Positional Info: " + ev.getPositionalInfo());
	          }*/
		
          for (Mapping map: pcm.getMappingList()) {
            for (Ev mapEv: map.getEvList()) {	  
           
            	mp.put(i++, mapEv.getConceptId());
            	mp.put(i++, mapEv.getMatchedWords());
            	mp.put(i++, mapEv.getPositionalInfo());
            	mp.put(i++, mapEv.getSemanticTypes().get(0)); //get only first SemType //.toString() for all if applicable [ SemType1, SemType2, etc.]
            	mp.put(i++, mapEv.getConceptName());
            	mp.put(i++, mapEv.getPreferredName());
            	// add further attributes here (and in run(gateDoc) --> gateMap.put(///))
            }
          }
    	}
	}
    }
return mp;
}
 
開發者ID:nikolamilosevic86,項目名稱:TableDisentangler,代碼行數:50,代碼來源:MetaMapping.java


注:本文中的gov.nih.nlm.nls.metamap.Ev類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。