public class DataSourceAccessor extends Object
SDocumentGraph object.| Modifier and Type | Class and Description |
|---|---|
static class |
DataSourceAccessor.TRAVERSION_TYPE
types of traversions, used by the several methods, used as id for
traversion
|
| Constructor and Description |
|---|
DataSourceAccessor() |
| Modifier and Type | Method and Description |
|---|---|
static List<SNode> |
getNodeBySequence(SDocumentGraph documentGraph,
DataSourceSequence DataSourceSequence)
Returns all
SNode objects which refer to the passed
DataSourceSequence object. |
static List<DataSourceSequence> |
getOverlappedDataSourceSequence(SDocumentGraph documentGraph,
List<SNode> nodes,
SALT_TYPE... relationTypes) |
static List<DataSourceSequence> |
getOverlappedDataSourceSequence(SDocumentGraph documentGraph,
SNode sNode,
SALT_TYPE... relationTypes) |
static List<SToken> |
getOverlappedSTokens(SDocumentGraph documentGraph,
SNode overlappingNode,
SALT_TYPE... relationTypes)
|
static List<SNode> |
getRootsByRelation(SDocumentGraph documentGraph,
SALT_TYPE... saltTypes)
|
static com.google.common.collect.Multimap<String,SNode> |
getRootsByRelationType(SDocumentGraph documentGraph,
Class<? extends SRelation> clazz)
for each relation R of type class
for each foregoing relation P (incoming relation of R'source)
check whether P is a parent of R (true, if they have the same class and the same type)
if R has no parents store R corresponding to it's type in returned table
|
static com.google.common.collect.Multimap<String,SNode> |
getRootsByRelationType(SDocumentGraph documentGraph,
SALT_TYPE sType)
Returns all nodes, which are roots for the given relation-class respects
to the given SType of the traversed relation.
|
static List<SToken> |
getSortedSTokenByText(SDocumentGraph documentGraph) |
static List<SToken> |
getSortedSTokenByText(SDocumentGraph documentGraph,
List<SToken> sTokens2sort) |
static List<SSpan> |
getSpanBySequence(SDocumentGraph documentGraph,
DataSourceSequence DataSourceSequence)
Returns all
SSpan objects which refer to the passed
DataSourceSequence object. |
static List<SStructure> |
getStructureBySequence(SDocumentGraph documentGraph,
DataSourceSequence DataSourceSequence)
Returns all
SStructure objects which refer to the passed
DataSourceSequence object. |
static List<SToken> |
getTokensBySequence(SDocumentGraph documentGraph,
DataSourceSequence DataSourceSequence)
Returns all
SToken objects which refer to the passed
DataSourceSequence object. |
static boolean |
isContinuousByText(SDocumentGraph documentGraph,
List<? extends SNode> subSNodList,
List<? extends SNode> fullSNodList)
First sorts the
given lists, than searches first occurance of first node in subSNodList
in fullSNodList.
|
static boolean |
isContinuousByText(SDocumentGraph documentGraph,
List<SNode> subSNodList) |
static void |
sortSTokenByText(SDocumentGraph documentGraph) |
public static List<SToken> getTokensBySequence(SDocumentGraph documentGraph, DataSourceSequence DataSourceSequence)
SToken objects which refer to the passed
DataSourceSequence object. The passed object determines the
borders of the sequence by the values sStart and sEnd
and the type of datasource by the instance sSequentialDS.public static List<SSpan> getSpanBySequence(SDocumentGraph documentGraph, DataSourceSequence DataSourceSequence)
SSpan objects which refer to the passed
DataSourceSequence object. The passed object determines the
borders of the sequence by the values sStart and sEnd
and the type of datasource by the instance sSequentialDS.public static List<SStructure> getStructureBySequence(SDocumentGraph documentGraph, DataSourceSequence DataSourceSequence)
SStructure objects which refer to the passed
DataSourceSequence object. The passed object determines the
borders of the sequence by the values sStart and sEnd
and the type of datasource by the instance sSequentialDS.DataSourceSequence - an object determing the sequence to which the returned
SStructure objects refer to.SStructure objects which refer or overlap the
passed sequencepublic static List<SNode> getNodeBySequence(SDocumentGraph documentGraph, DataSourceSequence DataSourceSequence)
SNode objects which refer to the passed
DataSourceSequence object. The passed object determines the
borders of the sequence by the values sStart and sEnd
and the type of datasource by the instance sSequentialDS.public static boolean isContinuousByText(SDocumentGraph documentGraph, List<? extends SNode> subSNodList, List<? extends SNode> fullSNodList)
public static boolean isContinuousByText(SDocumentGraph documentGraph, List<SNode> subSNodList)
public static void sortSTokenByText(SDocumentGraph documentGraph)
public static List<SToken> getSortedSTokenByText(SDocumentGraph documentGraph, List<SToken> sTokens2sort)
public static List<SToken> getSortedSTokenByText(SDocumentGraph documentGraph)
public static List<DataSourceSequence> getOverlappedDataSourceSequence(SDocumentGraph documentGraph, SNode sNode, SALT_TYPE... relationTypes)
public static List<DataSourceSequence> getOverlappedDataSourceSequence(SDocumentGraph documentGraph, List<SNode> nodes, SALT_TYPE... relationTypes)
public static List<SToken> getOverlappedSTokens(SDocumentGraph documentGraph, SNode overlappingNode, SALT_TYPE... relationTypes)
SToken which is (transitively)
overlapped by the given SNode by SRelation types which
have one of the types given in the overlappingRelationTypes list.overlappingNode - the node for which the overlapped SToken objects are
searchedoverlappingRelationTypes - the list of SALT_TYPEs which are used for traversion.
If, for example, all SToken are searched which are
overlapped by a SStructure, the
SALT_TYPE.SDOMINANCE_RELATION and
SALT_TYPE.SPANNING_RELATION should be contained in
this parameter.SToken which are overlapped by the
overlappingNode.public static List<SNode> getRootsByRelation(SDocumentGraph documentGraph, SALT_TYPE... saltTypes)
SNode objects which are roots for the given types of
SRelation. Means, that all SNodes will be returned as
roots, which have no incoming relations of the given type.
For instance imagine the following structure and assume that the passed
SALT_TYPEs are SALT_TYPE.SDOMINANCE_RELATION and
SALT_TYPE.SSPANNING_RELATION:
struct1
// ||
span1 || span2
/ \ || |
tok1 tok2 tok3 tok4
the nodes:
struct1 and span2 are returned, even if a pointing relation connects
struct1 and span2.
saltTypes - a set of types for which nodes have to be computed.SNodes which are rootspublic static com.google.common.collect.Multimap<String,SNode> getRootsByRelationType(SDocumentGraph documentGraph, SALT_TYPE sType)
clazz - class of Relation to be traversed for searching rootspublic static com.google.common.collect.Multimap<String,SNode> getRootsByRelationType(SDocumentGraph documentGraph, Class<? extends SRelation> clazz)
for each relation R of type class
for each foregoing relation P (incoming relation of R'source)
check whether P is a parent of R (true, if they have the same class and the same type)
if R has no parents store R corresponding to it's type in returned table
Copyright © 2009–2016 Humboldt-Universität zu Berlin, INRIA. All rights reserved.