edu.uchsc.ccp.knowtator
Class BrowserTextUtil

java.lang.Object
  extended by edu.uchsc.ccp.knowtator.BrowserTextUtil

public class BrowserTextUtil
extends Object

Author:
Philip V. Ogren

Field Summary
static String ANNOTATION_TEXT
           
 
Constructor Summary
BrowserTextUtil(AnnotationUtil annotationUtil, MentionUtil mentionUtil, KnowtatorProjectUtil kpu)
          Creates a new instance of BrowserText
 
Method Summary
 Comparator<SimpleInstance> comparator()
           
 String getBrowserText(SimpleInstance instance)
          The BrowserSlotPattern in the Protege code does not work very well with annotations and their mentions.
 String getBrowserText(SimpleInstance instance, int maxLength)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANNOTATION_TEXT

public static final String ANNOTATION_TEXT
See Also:
Constant Field Values
Constructor Detail

BrowserTextUtil

public BrowserTextUtil(AnnotationUtil annotationUtil,
                       MentionUtil mentionUtil,
                       KnowtatorProjectUtil kpu)
Creates a new instance of BrowserText

Method Detail

getBrowserText

public String getBrowserText(SimpleInstance instance,
                             int maxLength)

getBrowserText

public String getBrowserText(SimpleInstance instance)
The BrowserSlotPattern in the Protege code does not work very well with annotations and their mentions. This code generates browser text that tries to capture the BrowserSlotPatterns of the Instances and Clses that are being mentioned/annotated. If an annotation is passed in, then the instance.getBrowserText() will be returned if there is any. This will typically be the text found in knowtator_annotation_text. If there is no text returned, then text corresponding to the annotated mention will be returned via a recursive call (see next paragraph). If a mention is passed in, then a browser text corresponding to the BrowserSlotPattern of the mentioned cls will be constructed. Much of this code was copied and modified from edu.stanford.smi.protege.model.BrowserSlotPattern.java


comparator

public Comparator<SimpleInstance> comparator()