public final class NAFUtils extends Object
Modifier and Type | Field and Description |
---|---|
static com.google.common.collect.Ordering<Opinion> |
OPINION_COMPARATOR |
static String |
PREMON_ARGUMENT_SEPARATOR |
static String |
PREMON_FNPREFIX |
static String |
PREMON_NAMESPACE |
static String |
PREMON_NBPREFIX |
static String |
PREMON_PBPREFIX |
static String |
PREMON_RESOURCE_FRAMENET |
static String |
PREMON_RESOURCE_NOMBANK |
static String |
PREMON_RESOURCE_PROPBANK |
static String |
PREMON_RESOURCE_VERBNET |
static String |
PREMON_VNPREFIX |
static String |
RESOURCE_BBN |
static String |
RESOURCE_ENTITY_COREF |
static String |
RESOURCE_ENTITY_REF |
static String |
RESOURCE_FRAMENET |
static String |
RESOURCE_NOMBANK |
static String |
RESOURCE_PREDICATE_COREF |
static String |
RESOURCE_PREDICATE_REF |
static String |
RESOURCE_PROPBANK |
static String |
RESOURCE_SUMO |
static String |
RESOURCE_TIMEX_COREF |
static String |
RESOURCE_TIMEX_REF |
static String |
RESOURCE_VALUE |
static String |
RESOURCE_VERBNET |
static String |
RESOURCE_WN_SST |
static String |
RESOURCE_WN_SYNSET |
static String |
RESOURCE_YAGO |
Constructor and Description |
---|
NAFUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
addRef(Object annotation,
ExternalRef ref) |
static org.eclipse.rdf4j.model.IRI |
createPreMOnSemanticClassIRIfor(String model,
String predicate) |
static org.eclipse.rdf4j.model.IRI |
createPreMOnSemanticRoleIRIfor(String model,
String predicate,
String role) |
static String |
extendedPos(KAFDocument document,
Term term) |
static Integer |
extractArgNum(String role) |
static Term |
extractHead(KAFDocument document,
Span<Term> span) |
static Set<Term> |
extractHeads(KAFDocument document,
Iterable<Term> ancestors,
Iterable<Term> span,
Predicate<Term> predicate) |
static String |
extractLemma(String rolesetOrRole) |
static Integer |
extractSense(String rolesetOrRole) |
static List<Term> |
filterTerms(Iterable<Term> terms) |
static int |
getBegin(Term term) |
static int |
getEnd(Term term) |
static int |
getLength(Term term) |
static Span<Term> |
getNominalSpan(KAFDocument document,
Term term,
boolean includeCoord,
boolean includeModifiers) |
static ExternalRef |
getRef(Object annotation,
String resource,
String reference) |
static List<ExternalRef> |
getRefs(Object annotation,
String resource,
String reference) |
static String |
getRoleset(Predicate predicate) |
static Set<Term> |
getTermsByDepAncestor(KAFDocument document,
Term head,
boolean consecutive) |
static String |
getText(Iterable<Term> terms) |
static boolean |
hasHead(KAFDocument document,
Object annotation,
Term head) |
static Boolean |
isActiveForm(KAFDocument document,
Term term) |
static Predicate<Term> |
matchExtendedPos(KAFDocument document,
String... posPrefixes) |
static List<Span<Term>> |
mergeSpans(KAFDocument document,
Iterable<Span<Term>> spans,
boolean canAddTerms) |
static void |
normalize(KAFDocument document) |
static Span<Term> |
normalizeSpan(KAFDocument document,
Span<Term> span) |
static eu.fbk.utils.core.Range |
rangeFor(Iterable<Term> terms) |
static eu.fbk.utils.core.Range |
rangeFor(Term term) |
static List<eu.fbk.utils.core.Range> |
rangesFor(KAFDocument document,
Iterable<Term> terms) |
static KAFDocument |
readDocument(Path path) |
static void |
removeRefs(Object annotation,
String resource,
String reference) |
static void |
setRef(Object annotation,
ExternalRef ref) |
static List<Span<Term>> |
splitSpan(KAFDocument document,
Span<Term> span,
Iterable<Term> heads) |
static List<Span<Term>> |
splitSpans(KAFDocument document,
Iterable<Span<Term>> spans) |
static Term |
srlToSyntacticHead(KAFDocument document,
Term term) |
static Term |
syntacticToSRLHead(KAFDocument document,
Term term) |
static List<eu.fbk.utils.core.Range> |
termRangesFor(KAFDocument document,
Iterable<Term> terms) |
static String |
toString(Object annotation) |
static Span<Term> |
trimSpan(Span<Term> span,
int sentenceID) |
static void |
writeDocument(KAFDocument document,
Path location) |
public static final String RESOURCE_PROPBANK
public static final String RESOURCE_NOMBANK
public static final String RESOURCE_VERBNET
public static final String RESOURCE_FRAMENET
public static final String RESOURCE_BBN
public static final String RESOURCE_WN_SYNSET
public static final String RESOURCE_WN_SST
public static final String RESOURCE_SUMO
public static final String RESOURCE_ENTITY_REF
public static final String RESOURCE_ENTITY_COREF
public static final String RESOURCE_PREDICATE_REF
public static final String RESOURCE_PREDICATE_COREF
public static final String RESOURCE_TIMEX_REF
public static final String RESOURCE_TIMEX_COREF
public static final String RESOURCE_VALUE
public static final String RESOURCE_YAGO
public static final String PREMON_NAMESPACE
public static final String PREMON_FNPREFIX
public static final String PREMON_VNPREFIX
public static final String PREMON_PBPREFIX
public static final String PREMON_NBPREFIX
public static final String PREMON_ARGUMENT_SEPARATOR
public static final String PREMON_RESOURCE_PROPBANK
public static final String PREMON_RESOURCE_NOMBANK
public static final String PREMON_RESOURCE_VERBNET
public static final String PREMON_RESOURCE_FRAMENET
public static final com.google.common.collect.Ordering<Opinion> OPINION_COMPARATOR
public static void normalize(KAFDocument document)
@Nullable public static Term extractHead(KAFDocument document, @Nullable Span<Term> span)
public static Set<Term> extractHeads(KAFDocument document, @Nullable Iterable<Term> ancestors, @Nullable Iterable<Term> span, @Nullable Predicate<Term> predicate)
public static boolean hasHead(KAFDocument document, Object annotation, Term head)
public static Span<Term> getNominalSpan(KAFDocument document, Term term, boolean includeCoord, boolean includeModifiers)
public static int getBegin(Term term)
public static int getEnd(Term term)
public static int getLength(Term term)
@Nullable public static ExternalRef getRef(@Nullable Object annotation, @Nullable String resource, @Nullable String reference)
public static List<ExternalRef> getRefs(Object annotation, @Nullable String resource, @Nullable String reference)
public static void removeRefs(Object annotation, @Nullable String resource, @Nullable String reference)
public static void addRef(Object annotation, ExternalRef ref)
public static void setRef(Object annotation, ExternalRef ref)
public static List<eu.fbk.utils.core.Range> termRangesFor(KAFDocument document, Iterable<Term> terms)
public static List<eu.fbk.utils.core.Range> rangesFor(KAFDocument document, Iterable<Term> terms)
public static eu.fbk.utils.core.Range rangeFor(Term term)
public static Span<Term> normalizeSpan(KAFDocument document, @Nullable Span<Term> span)
public static List<Span<Term>> mergeSpans(KAFDocument document, Iterable<Span<Term>> spans, boolean canAddTerms)
public static final List<Span<Term>> splitSpans(KAFDocument document, Iterable<Span<Term>> spans)
public static final List<Span<Term>> splitSpan(KAFDocument document, Span<Term> span, Iterable<Term> heads)
public static KAFDocument readDocument(@Nullable Path path) throws IOException
IOException
public static void writeDocument(KAFDocument document, @Nullable Path location) throws IOException
IOException
public static Term syntacticToSRLHead(KAFDocument document, Term term)
public static Term srlToSyntacticHead(KAFDocument document, Term term)
public static String extendedPos(KAFDocument document, Term term)
public static Boolean isActiveForm(KAFDocument document, Term term)
public static Predicate<Term> matchExtendedPos(KAFDocument document, String... posPrefixes)
public static Set<Term> getTermsByDepAncestor(KAFDocument document, Term head, boolean consecutive)
public static org.eclipse.rdf4j.model.IRI createPreMOnSemanticClassIRIfor(String model, String predicate)
Copyright © 2016–2020 FBK. All rights reserved.