public class AlignmentSpecification extends IndexingScheme
Constructor and Description |
---|
AlignmentSpecification(NodeSpecification nodeSpecification)
Initializes an alignment specification from a given node specification.
|
AlignmentSpecification(NodeSpecification nodeSpecification,
String[] keywords,
Comparator[] comparators) |
AlignmentSpecification(NodeSpecification nodeSpecification,
String[] keywords,
Comparator[] comparators,
double[] weighting) |
AlignmentSpecification(Sequence sequence)
Initializes an alignment specification using the node specification
inside.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Comparator |
getComparator(int index)
Returns the Comparator that is currently set for the given keyword.
|
Comparator |
getComparator(String keyword)
Returns the Comparator that is currently set for the given keyword.
|
NodeSpecification |
getNodeSpecification() |
int |
getOriginalIndex(int index)
This is semantically equivalent to
getNodeSpecification().getKeywordIndex(getKeyword(index)) but this is
preprocessed here for better performance.
|
double[] |
getWeighting()
Returns the current keyword weighting.
|
int |
hashCode() |
static boolean |
isValidWeighting(double[] weighting)
This checks whether the given weighting is a valid one.
|
void |
setComparator(int index,
Comparator comparator)
Sets the comparator for a given keyword.
|
void |
setComparator(String keyword,
Comparator comparator)
Sets the comparator for a given keyword.
|
void |
setWeighting(double[] weighting)
This sets the current weighting of keywords.
|
String |
toString() |
getKeyword, getKeywordIndex, getKeywords, hasKeyword, size
public AlignmentSpecification(NodeSpecification nodeSpecification)
nodeSpecification
- The node specification that is the basis for all
sequences that will be aligned.public AlignmentSpecification(Sequence sequence)
sequence
- a sequence that has a representative NodeSpecification
for all Sequences that are going to be aligned.public AlignmentSpecification(NodeSpecification nodeSpecification, String[] keywords, Comparator[] comparators)
nodeSpecification
- The node specification that is the basis of all
sequences for this alignment.keywords
- The keywords that shall be used in this alignment. This
has to be a subset of the keywords in the node specification.comparators
- the comparators that shall be used for the keywords.
Please note that these have to match the types of the keywords.public AlignmentSpecification(NodeSpecification nodeSpecification, String[] keywords, Comparator[] comparators, double[] weighting)
nodeSpecification
- The node specification that is the basis of all
sequences for this alignment.keywords
- The keywords that shall be used in this alignment. This
has to be a subset of the keywords in the node specification.comparators
- the comparators that shall be used for the keywords.
Please note that these have to match the types of the keywords.weighting
- the weights that highlight the importance of certain
keywords/features. These have to be double values between 0 and 1 that
add up to 1.public NodeSpecification getNodeSpecification()
public void setComparator(String keyword, Comparator comparator)
keyword
- a keyword that is used in this Alignment.comparator
- a fitting Comparator that defines a local normalized
distance on the values for the given keyword.public void setComparator(int index, Comparator comparator)
index
- a keyword index that is used in this Alignment.comparator
- a fitting Comparator that defines a local normalized
distance on the values for the given keyword.public Comparator getComparator(String keyword)
keyword
- a keyword that is used in this Alignment.public Comparator getComparator(int index)
index
- a keyword index that is used in this Alignment.public int getOriginalIndex(int index)
index
- a keyword index in this AlignmentSpecification.public void setWeighting(double[] weighting)
weighting
- a double vector fulfilling the criteria given above.public double[] getWeighting()
public static boolean isValidWeighting(double[] weighting)
weighting
- a double array that might be a weighting.public int hashCode()
hashCode
in class IndexingScheme
public boolean equals(Object obj)
equals
in class IndexingScheme
Copyright (C) 2013, 2014 Benjamin Paaßen, Charlie Krüger, Georg Zentgraf, AG Theoretical Computer Science, Centre of Excellence Cognitive Interaction Technology (CITEC), University of Bielefeld, licensed under the AGPL v. 3: http://openresearch.cit-ec.de/projects/tcs