|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.uchsc.ccp.knowtator.MentionUtil
public class MentionUtil
Constructor Summary | |
---|---|
MentionUtil(KnowtatorProjectUtil kpu)
Creates a new instance of MentionUtil |
Method Summary | |
---|---|
void |
addInverse(SimpleInstance annotationMention,
Slot mentionSlot,
SimpleInstance mentionSlotValueMention)
This method was written and contributed by Angus Roberts. |
void |
addSlotMention(SimpleInstance mention,
SimpleInstance slotMention)
This method adds a slotMention to a class or instance mention. |
void |
addValueToSlotMention(SimpleInstance slotMention,
Object slotValue)
This method adds a value to a slotMention. |
void |
adjustSlotMentionForCardinality(Cls cls,
Slot slot,
SimpleInstance mention)
|
SimpleInstance |
copyMention(SimpleInstance mention,
Map<SimpleInstance,SimpleInstance> copiesMap)
|
SimpleInstance |
createClassMention(Cls cls)
|
SimpleInstance |
createInstanceMention(SimpleInstance simpleInstance)
|
SimpleInstance |
createMention(Instance instance)
Creates a mention based on the passed in instance. |
SimpleInstance |
createSlotMention(Slot slot)
|
void |
deleteMention(SimpleInstance mention)
|
boolean |
equals(SimpleInstance mention1,
SimpleInstance mention2,
boolean compareAnnotationSpans)
|
Set<SimpleInstance> |
getAllConnectedMentions(SimpleInstance mention)
This method gathers all the mentions (e.g. |
List<SimpleInstance> |
getComplexSlotMentions(SimpleInstance mention)
This method gets the complex slot mentions of a class mention or instance mention. |
SimpleInstance |
getMentionAnnotation(SimpleInstance mention)
|
Cls |
getMentionCls(SimpleInstance mention)
If the mention is a "class mention" then the Cls corresponding to the mentioned class is returned. |
SimpleInstance |
getMentionedBy(SimpleInstance slotMention)
|
Frame |
getMentionFrame(SimpleInstance mention)
|
SimpleInstance |
getMentionInstance(SimpleInstance instanceMention)
|
List<Slot> |
getMentionSlots(SimpleInstance mention)
|
List<SimpleInstance> |
getRelatedMentions(SimpleInstance mention)
This method returns all class mentions or instance mentions related to the passed in mention via slot mentions. |
List<SimpleInstance> |
getRelatedMentions(SimpleInstance mention,
Slot slot)
This method returns all class mentions or instance mentions related to the passed in mention via slot mentions whose mentioned slot is the passed in slot. |
List<SimpleInstance> |
getSlotFillerCandidates(SimpleInstance mention,
Slot slot,
List<SimpleInstance> annotations)
|
SimpleInstance |
getSlotMention(SimpleInstance mention,
Slot mentionSlot)
gets a slot mention for the given slot of a class mention or instance mention. |
List<SimpleInstance> |
getSlotMentions(SimpleInstance mention)
This method gets the slot mentions of a class mention or instance mention. |
Slot |
getSlotMentionSlot(SimpleInstance mention)
|
List<Object> |
getSlotMentionValues(SimpleInstance slotMention)
|
boolean |
hasSlotMention(SimpleInstance mention,
Slot mentionSlot)
|
boolean |
hasSlotValue(SimpleInstance slotMention)
|
void |
initializeSlotMentions(SimpleInstance mention)
this method takes a mention and initializes slot mentions for slots that do not yet have a slotMention for the mention. |
boolean |
isBooleanSlotMention(SimpleInstance mention)
|
boolean |
isClassMention(SimpleInstance mention)
|
boolean |
isComplexSlotMention(SimpleInstance mention)
Determines whether an instance is a complex slot mention. |
boolean |
isFloatSlotMention(SimpleInstance mention)
|
boolean |
isInstanceMention(SimpleInstance mention)
|
boolean |
isIntegerSlotMention(SimpleInstance mention)
|
boolean |
isMention(SimpleInstance mention)
|
boolean |
isSimpleSlotMention(SimpleInstance mention)
|
boolean |
isSlotMention(SimpleInstance mention)
|
boolean |
isStringSlotMention(SimpleInstance mention)
|
void |
removeEmptySlotMentions(SimpleInstance mention)
|
void |
removeInverse(SimpleInstance annotationMention,
Slot mentionSlot,
SimpleInstance mentionSlotValueMention)
This method was written and contributed by Angus Roberts. |
void |
removeValueFromSlotMention(SimpleInstance slotMention,
Object slotValue)
|
void |
setAnnotationUtil(AnnotationUtil annotationUtil)
|
void |
setMentionAnnotations(SimpleInstance mention,
Collection<SimpleInstance> annotations)
|
void |
setMentionCls(SimpleInstance clsMention,
Cls mentionCls)
This method sets the cls that is mentioned by a class mention. |
void |
setMentionInstance(SimpleInstance instanceMention,
SimpleInstance mentionInstance)
This method sets the instance that is mentioned by an instance mention. |
void |
setMentionSlot(SimpleInstance slotMention,
Slot mentionSlot)
This method sets the slot that is mentioned by a slot mention. |
void |
setSlotMentionValues(SimpleInstance slotMention,
List<Object> values)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MentionUtil(KnowtatorProjectUtil kpu)
Method Detail |
---|
public void setAnnotationUtil(AnnotationUtil annotationUtil)
public boolean equals(SimpleInstance mention1, SimpleInstance mention2, boolean compareAnnotationSpans)
public SimpleInstance copyMention(SimpleInstance mention, Map<SimpleInstance,SimpleInstance> copiesMap)
mention
- copiesMap
-
public SimpleInstance createClassMention(Cls cls)
public SimpleInstance createInstanceMention(SimpleInstance simpleInstance)
public void addSlotMention(SimpleInstance mention, SimpleInstance slotMention)
addValueToSlotMention(SimpleInstance, Object)
public void addValueToSlotMention(SimpleInstance slotMention, Object slotValue)
slotMention
- must be an instance of a slot mentionslotValue
- can be a class mention, instance mention, or an Integer,
Float, String or Boolean.public void removeValueFromSlotMention(SimpleInstance slotMention, Object slotValue)
public SimpleInstance createSlotMention(Slot slot)
public SimpleInstance createMention(Instance instance)
instance
- should be Cls, SimpleInstance or Slot
public boolean isClassMention(SimpleInstance mention)
public boolean isInstanceMention(SimpleInstance mention)
public boolean isMention(SimpleInstance mention)
public boolean isSlotMention(SimpleInstance mention)
public boolean isBooleanSlotMention(SimpleInstance mention)
public boolean isFloatSlotMention(SimpleInstance mention)
public boolean isIntegerSlotMention(SimpleInstance mention)
public boolean isStringSlotMention(SimpleInstance mention)
public boolean isSimpleSlotMention(SimpleInstance mention)
public boolean isComplexSlotMention(SimpleInstance mention)
public Set<SimpleInstance> getAllConnectedMentions(SimpleInstance mention)
mention
- should be a Protege instance of mention.
public List<SimpleInstance> getRelatedMentions(SimpleInstance mention)
mention
- should be of type 'knowtator class mention' or 'knowtator
instance mention'.
public List<SimpleInstance> getRelatedMentions(SimpleInstance mention, Slot slot)
mention
- should be of type 'knowtator class mention' or 'knowtator
instance mention'.slot
- a slot corresponding to a knowtator_mention_slot of a
'knowtator complex slot mention'
public Frame getMentionFrame(SimpleInstance mention)
public Cls getMentionCls(SimpleInstance mention)
public void setMentionCls(SimpleInstance clsMention, Cls mentionCls)
clsMention
- the mention must be a class mention or this method does
nothingmentionCls
- the class that is mentioned by the instance mentionpublic void setMentionInstance(SimpleInstance instanceMention, SimpleInstance mentionInstance)
instanceMention
- the mention must be an instance mention or this method does
nothingmentionInstance
- the instance that is mentioned by the instance mentionpublic void setMentionSlot(SimpleInstance slotMention, Slot mentionSlot)
slotMention
- the mention must be a slot mention or this method does nothingmentionSlot
- the slot that is mentioned by the slot mentionpublic SimpleInstance getMentionInstance(SimpleInstance instanceMention)
public List<SimpleInstance> getSlotMentions(SimpleInstance mention)
mention
- must be a class mention or instance mention otherwise an empty
list will be returned
public List<SimpleInstance> getComplexSlotMentions(SimpleInstance mention)
mention
- should be a class mention or instance mention;
public List<Slot> getMentionSlots(SimpleInstance mention)
public SimpleInstance getSlotMention(SimpleInstance mention, Slot mentionSlot)
mention
- must be a class mention or instance mention otherwise null
will be returned.mentionSlot
- the "knowtator_mention_slot" of the slot mention.
public boolean hasSlotMention(SimpleInstance mention, Slot mentionSlot)
public boolean hasSlotValue(SimpleInstance slotMention)
public void initializeSlotMentions(SimpleInstance mention)
public void removeEmptySlotMentions(SimpleInstance mention)
public void deleteMention(SimpleInstance mention)
public SimpleInstance getMentionAnnotation(SimpleInstance mention)
public void setMentionAnnotations(SimpleInstance mention, Collection<SimpleInstance> annotations)
public Slot getSlotMentionSlot(SimpleInstance mention)
public List<Object> getSlotMentionValues(SimpleInstance slotMention)
public void setSlotMentionValues(SimpleInstance slotMention, List<Object> values)
public SimpleInstance getMentionedBy(SimpleInstance slotMention)
public void addInverse(SimpleInstance annotationMention, Slot mentionSlot, SimpleInstance mentionSlotValueMention)
annotationMention
- an annotation mention with a mention slotmentionSlot
- a slot, the inverse of which will be addedmentionSlotValueMention
- the value of that will be added to mentionSlotpublic void removeInverse(SimpleInstance annotationMention, Slot mentionSlot, SimpleInstance mentionSlotValueMention)
annotationMention
- an annotation mention with a mention slotmentionSlot
- a slot, the inverse of which will be removedmentionSlotValueMention
- the value of mentionSlotpublic List<SimpleInstance> getSlotFillerCandidates(SimpleInstance mention, Slot slot, List<SimpleInstance> annotations)
public void adjustSlotMentionForCardinality(Cls cls, Slot slot, SimpleInstance mention)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |