Package edu.pitt.terminology.util

Examples of edu.pitt.terminology.util.PathHelper


    return abbreviations;
  }
 
  public PathHelper getPathHelper(){
    if(pathHelper == null)
      pathHelper = new PathHelper(getTerminology());
    return pathHelper;
  }
View Full Code Here


   * get path helper to determine the hiearchy between concepts
   * @return
   */
  public PathHelper getPathHelper() {
    if(pathHelper == null){
      pathHelper = new PathHelper(getTerminology());
    }
    return pathHelper;
  }
View Full Code Here

    printInfo(terminology);
   
    // doing ancestry index
    if(createAncestry){
      log("Creating Ancestry Cache for "+name+" ..,");
      PathHelper ph = new PathHelper(terminology);
      ph.createAncestryCache();
    }
   
   
    log("\n\nAll Done!");
  }
View Full Code Here

   * @param doc
   * @return
   */
  public List<ItemInstance> process(AnnotatedDocument doc) throws TerminologyException{
    List<ItemInstance> items = new ArrayList<ItemInstance>();
    PathHelper paths = getPathHelper();
    // first pass
    for(Concept c: doc.getConcepts()){
      if(paths.hasAncestor(c,getConcept())){
        ItemInstance item = new ItemInstance(this,c);
        item.process(doc);
        addInstance(paths, items, item);
      }else if(concept.getCodes() != null && !concept.getCodes().isEmpty() && c.getSources().length > 0){
        // what if there is a linkage code
        String code = concept.getCode(c.getSources()[0]);
        if(code != null){
          Concept cc = (code.equals(c.getSources()[0].getName()))?c.getTerminology().getRootConcepts()[0]:c.getTerminology().lookupConcept(code);
          if(cc != null){
            if(paths.hasAncestor(c,cc)){
              ItemInstance item = new ItemInstance(this,c);
              item.process(doc);
              addInstance(paths, items, item);
            }
          }
        }
      }
    }
   
    // second pass, if nothing was found and there is a more general feature available
    if(items.isEmpty() && feature != null){
      for(Concept c: doc.getConcepts()){
        if(paths.hasAncestor(c,getFeature().getConcept())){
          // process this template with feature concept
          ItemInstance item = new ItemInstance(this,c);
          item.process(doc);
         
          // process a feature template with feature concept
View Full Code Here

    add(status,BorderLayout.SOUTH);
  }
 
  private PathHelper getPathHelper(){
    if(pathHelper == null && terminology != null){
      pathHelper = new PathHelper(terminology);
    }
    return pathHelper;
  }
View Full Code Here

TOP

Related Classes of edu.pitt.terminology.util.PathHelper

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.