Package edu.pitt.dbmi.nlp.noble.terminology

Examples of edu.pitt.dbmi.nlp.noble.terminology.Concept


    return pathHelper;
  }
 
  protected void doViewRelationships(String code) {
    try {
      Concept c = terminology.lookupConcept(code);
      if(c != null){
        StringBuffer str = new StringBuffer();
        // narrower concepts
        str.append("<h3>Direct Children of <font color=green>"+c.getName()+" ("+c.getCode()+")</font></h3>");
        str.append("<ul>");
        for(Concept a: c.getChildrenConcepts()){
          String h = "<a href=\""+a.getCode()+"\">"+a.getCode()+"</a>";
          str.append("<li><b>"+a.getName()+"</b> ("+h+") "+Arrays.toString(a.getSemanticTypes())+"</li>");
        }
        str.append("</ul>");
        str.append("<h3>Direct Parents of <font color=green>"+c.getName()+" ("+c.getCode()+")</font></h3>");
        for(Concept a: c.getParentConcepts()){
          String h = "<a href=\""+a.getCode()+"\">"+a.getCode()+"</a>";
          str.append("<li><b>"+a.getName()+"</b> ("+h+") "+Arrays.toString(a.getSemanticTypes())+"</li>");
        }
        str.append("</ul>");
        // ancestry
        str.append("<h3>All Ancestors of <font color=green>"+c.getName()+" ("+c.getCode()+") </font></h3>");
        Map<Concept,Integer> ancestors = getPathHelper().getAncestors(c);
        if(ancestors != null && !ancestors.isEmpty()){
          for(Concept a: ancestors.keySet()){
            try {
              a.initialize();
View Full Code Here


    }
  }
 
  private Concept[] doLookup(String text) throws Exception{
    if(isCode(text)){
      Concept c = terminology.lookupConcept(text);
      return c != null? new Concept []{c}:new Concept [0];
    }
    return terminology.search(text);
  }
View Full Code Here

TOP

Related Classes of edu.pitt.dbmi.nlp.noble.terminology.Concept

Copyright © 2018 www.massapicom. 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.