public final class CoreferenceUtils extends java.lang.Object implements CorefConstants
Modifier and Type | Field and Description |
---|---|
static EdgeSet |
defaultEmptyEdgeSet |
static SpanSet |
defaultEmptySpanSet |
static CoreferenceData |
emptySentence |
static java.util.Comparator<Span> |
SPAN_SIZE_REVERSE_SORTER |
static java.util.Comparator<Span> |
SPAN_SIZE_SORTER |
BEGIN_INDEX_KEY, CLUSTER_ID_KEY, COREFERENCE_DOCUMENT_VIEW_ID, COREFERENCE_EXPLORER_VIEW_ID, COREFERENCE_MANAGER_VIEW_ID, COREFERENCE_PERSPECTIVE_ID, COREFERENCE_PLUGIN_ID, DOCUMENT_EXPLORER_SELECTION_CHANGED, DOCUMENT_INDEX_KEX, EDGE_TYPE, END_INDEX_KEY, ERROR_ANALYSIS_VIEW_ID, MENTION_HEAD_KEY, MENTION_SIZE_KEY, MENTION_TYPE, RANGE_KEY, SENTENCE_INDEX_KEX
DATA_GROUP_LABEL, DATA_GROUP_VALUE, DATA_HEAD_ROOT, DATA_LEFT_LABEL, DATA_LEFT_VALUE, DATA_NO_VALUE, DATA_RIGHT_LABEL, DATA_RIGHT_VALUE, DATA_ROOT_LABEL, DATA_UNDEFINED_DOUBLE_VALUE, DATA_UNDEFINED_FLOAT_VALUE, DATA_UNDEFINED_LABEL, DATA_UNDEFINED_VALUE, DATA_YES_VALUE, DEPREL_KEY, DIRECTION_KEY, DISTANCE_KEY, EDGE_KEY, ENTITY_KEY, FEATURES_KEY, FLAG_PROJECTIVE, FLAGS_KEY, FORM_KEY, FRAMESET_KEY, GENDER_KEY, HEAD_KEY, ID_KEY, INDEX_KEY, LEMMA_KEY, LENGTH_KEY, NUMBER_KEY, PARSE_KEY, POS_KEY, ROOT_KEY, SENSE_KEY, SIZE_KEY, SPEAKER_FEATURES_KEY, SPEAKER_KEY, TAG_KEY, TRANSITIVE_KEY
Modifier and Type | Method and Description |
---|---|
static void |
appendForms(java.lang.StringBuilder buffer,
CoreferenceData sentence,
Span span) |
static void |
appendProperties(java.lang.StringBuilder buffer,
java.lang.String key,
CoreferenceData sentence,
Span span) |
static java.util.Set<Span> |
collectSpans(java.util.Collection<Edge> edges) |
static java.util.Set<Span> |
collectSpans(EdgeSet edgeSet) |
static CorefComparison |
compare(EdgeSet edgeSet,
EdgeSet goldSet,
boolean filterSingletons) |
static boolean |
containsSpan(CoreferenceData data,
de.ims.icarus.util.Filter filter) |
static boolean |
containsSpan(CoreferenceData data,
Span span) |
static boolean |
containsSpan(DocumentData data,
de.ims.icarus.util.Filter filter) |
static boolean |
containsSpan(DocumentData data,
Span span) |
static javax.swing.JLabel |
createErrorInfoLabel() |
static java.lang.String |
createTooltip(CoreferenceData sentence,
java.util.List<Span> spans,
java.util.List<CorefErrorType> errorTypes) |
static EdgeSet |
defaultBuildEdgeSet(SpanSet spanSet)
Creates and returns an
EdgeSet by simply linking
all spans in the given SpanSet based on their
cluster-id in order of appearance. |
static java.awt.Color |
getClusterMarkupColor() |
static de.ims.icarus.util.data.ContentType |
getCoreferenceContentType() |
static de.ims.icarus.util.data.ContentType |
getCoreferenceDocumentAnnotationContentType() |
static de.ims.icarus.util.data.ContentType |
getCoreferenceDocumentContentType() |
static de.ims.icarus.util.data.ContentType |
getCoreferenceDocumentSetContentType() |
static java.lang.String[] |
getDefaultDocumentPropertyKeys() |
static java.lang.String[] |
getDefaultEdgePropertyKeys() |
static java.lang.String[] |
getDefaultSentencePropertyKeys() |
static java.lang.String[] |
getDefaultSpanPropertyKeys() |
static java.lang.String[] |
getDefaultWordPropertyKeys() |
static java.lang.String |
getDocumentHeader(DocumentData data) |
static de.ims.icarus.util.data.ContentType |
getEdgeContentType() |
static EdgeSet |
getEdgeSet(DocumentData document,
CoreferenceAllocation allocation) |
static de.ims.icarus.util.data.ContentType |
getEdgeSetContentType() |
static java.lang.String |
getEdgeTooltip(Edge edge,
CorefErrorType errorType) |
static java.awt.Color |
getErrorColor(CorefErrorType errorType) |
static java.lang.String |
getForms(CoreferenceData sentence,
Span span) |
static EdgeSet |
getGoldEdgeSet(DocumentData document,
CoreferenceAllocation allocation) |
static SpanSet |
getGoldSpanSet(DocumentData document,
CoreferenceAllocation allocation) |
static de.ims.icarus.util.data.ContentType |
getSpanContentType() |
static int |
getSpanLength(Span span,
DocumentData document) |
static SpanSet |
getSpanSet(DocumentData document,
CoreferenceAllocation allocation) |
static java.lang.String |
getSpanText(Span span,
DocumentData document) |
static java.lang.String |
getSpanTooltip(Span span,
CoreferenceData sentence,
CorefErrorType errorType) |
static void |
loadDocumentSet(de.ims.icarus.io.Reader<? extends DocumentData> reader,
de.ims.icarus.util.location.Location location,
de.ims.icarus.util.Options options,
DocumentSet target) |
static DocumentSet |
loadDocumentSet(de.ims.icarus.io.Reader<DocumentData> reader,
de.ims.icarus.util.location.Location location,
de.ims.icarus.util.Options options) |
static java.util.Collection<Edge> |
removeSingletons(java.util.Collection<Edge> edges) |
public static final CoreferenceData emptySentence
public static final SpanSet defaultEmptySpanSet
public static final EdgeSet defaultEmptyEdgeSet
public static final java.util.Comparator<Span> SPAN_SIZE_SORTER
public static final java.util.Comparator<Span> SPAN_SIZE_REVERSE_SORTER
public static java.awt.Color getErrorColor(CorefErrorType errorType)
public static java.awt.Color getClusterMarkupColor()
public static CorefComparison compare(EdgeSet edgeSet, EdgeSet goldSet, boolean filterSingletons)
public static de.ims.icarus.util.data.ContentType getCoreferenceContentType()
public static de.ims.icarus.util.data.ContentType getCoreferenceDocumentContentType()
public static de.ims.icarus.util.data.ContentType getCoreferenceDocumentAnnotationContentType()
public static de.ims.icarus.util.data.ContentType getEdgeSetContentType()
public static de.ims.icarus.util.data.ContentType getSpanContentType()
public static de.ims.icarus.util.data.ContentType getEdgeContentType()
public static de.ims.icarus.util.data.ContentType getCoreferenceDocumentSetContentType()
public static java.util.Collection<Edge> removeSingletons(java.util.Collection<Edge> edges)
public static int getSpanLength(Span span, DocumentData document)
public static java.lang.String getSpanText(Span span, DocumentData document)
public static boolean containsSpan(CoreferenceData data, Span span)
public static boolean containsSpan(DocumentData data, Span span)
public static boolean containsSpan(CoreferenceData data, de.ims.icarus.util.Filter filter)
public static boolean containsSpan(DocumentData data, de.ims.icarus.util.Filter filter)
public static java.lang.String getDocumentHeader(DocumentData data)
public static EdgeSet defaultBuildEdgeSet(SpanSet spanSet)
EdgeSet
by simply linking
all spans in the given SpanSet
based on their
cluster-id in order of appearance.public static SpanSet getSpanSet(DocumentData document, CoreferenceAllocation allocation)
public static EdgeSet getEdgeSet(DocumentData document, CoreferenceAllocation allocation)
public static SpanSet getGoldSpanSet(DocumentData document, CoreferenceAllocation allocation)
public static EdgeSet getGoldEdgeSet(DocumentData document, CoreferenceAllocation allocation)
public static DocumentSet loadDocumentSet(de.ims.icarus.io.Reader<DocumentData> reader, de.ims.icarus.util.location.Location location, de.ims.icarus.util.Options options) throws java.io.IOException, de.ims.icarus.util.location.UnsupportedLocationException, de.ims.icarus.util.UnsupportedFormatException
java.io.IOException
de.ims.icarus.util.location.UnsupportedLocationException
de.ims.icarus.util.UnsupportedFormatException
public static void loadDocumentSet(de.ims.icarus.io.Reader<? extends DocumentData> reader, de.ims.icarus.util.location.Location location, de.ims.icarus.util.Options options, DocumentSet target) throws java.io.IOException, de.ims.icarus.util.location.UnsupportedLocationException, de.ims.icarus.util.UnsupportedFormatException
java.io.IOException
de.ims.icarus.util.location.UnsupportedLocationException
de.ims.icarus.util.UnsupportedFormatException
public static void appendProperties(java.lang.StringBuilder buffer, java.lang.String key, CoreferenceData sentence, Span span)
public static void appendForms(java.lang.StringBuilder buffer, CoreferenceData sentence, Span span)
public static java.lang.String getForms(CoreferenceData sentence, Span span)
public static java.lang.String createTooltip(CoreferenceData sentence, java.util.List<Span> spans, java.util.List<CorefErrorType> errorTypes)
public static java.lang.String getSpanTooltip(Span span, CoreferenceData sentence, CorefErrorType errorType)
public static java.lang.String getEdgeTooltip(Edge edge, CorefErrorType errorType)
public static javax.swing.JLabel createErrorInfoLabel()
public static java.lang.String[] getDefaultSpanPropertyKeys()
public static java.lang.String[] getDefaultEdgePropertyKeys()
public static java.lang.String[] getDefaultWordPropertyKeys()
public static java.lang.String[] getDefaultSentencePropertyKeys()
public static java.lang.String[] getDefaultDocumentPropertyKeys()