Package ca.phon.ipa.features
Class FeatureSet
java.lang.Object
ca.phon.ipa.features.FeatureSet
Class to represent a charater's feature set.
Features are stored internally as a
BitSet
.
As of Phon 2.2 objects of this type are immutable after construction.-
Constructor Summary
ConstructorDescriptionCreate a new instance of a feature setFeatureSet
(BitSet featureSet) FeatureSet
(Set<String> features) -
Method Summary
Modifier and TypeMethodDescriptionboolean
static FeatureSet
Utility method for creating features sets from an array of values.Returnt the features.Return the set of manner features for this feature set.getPlace()
boolean
hasFeature
(String feature) Check for existance of a featurestatic FeatureSet
intersect
(FeatureSet fs1, FeatureSet fs2) Produces a new FeatureSet based on the set-intersection of the two given FeatureSets.boolean
intersects
(FeatureSet fs2) static boolean
intersects
(FeatureSet fs1, FeatureSet fs2) Do the features sets intersect.iterator()
static FeatureSet
minus
(FeatureSet fs1, FeatureSet fs2) Produces a new FeatureSet based on the set-subtraction of the given feature sets.static FeatureSet
singleonFeature
(String featureName) Create a feature set from a single feature.int
size()
Returns the number of features in the set.int
sonority()
toString()
A string representation of the feature setstatic FeatureSet
union
(FeatureSet fs1, FeatureSet fs2) Produces a new FeatureSet based on the set-union of the two given FeatureSetsMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
FeatureSet
public FeatureSet()Create a new instance of a feature set -
FeatureSet
-
FeatureSet
-
-
Method Details
-
singleonFeature
Create a feature set from a single feature.- Parameters:
featureName
-
-
fromArray
Utility method for creating features sets from an array of values.- Parameters:
features
- the list of features to add to the set. If the features[x] is a single character, the full feature set of the character is added.- Returns:
- the created feature set
-
hasFeature
Check for existance of a feature -
getFeatures
Returnt the features. This is not a live list. -
size
public int size()Returns the number of features in the set.- Returns:
- the cardinality of the set
-
sonority
public int sonority() -
toString
A string representation of the feature set -
equals
-
union
Produces a new FeatureSet based on the set-union of the two given FeatureSets- Parameters:
fs1
-fs2
-- Returns:
- fs1 UNION fs2
-
intersects
-
intersects
Do the features sets intersect.- Parameters:
fs1
-fs2
-- Returns:
- true if the two given featuresets have any common features.
-
intersect
Produces a new FeatureSet based on the set-intersection of the two given FeatureSets.- Parameters:
fs1
-fs2
-- Returns:
- fs1 INTERSECT fs2
-
minus
Produces a new FeatureSet based on the set-subtraction of the given feature sets.- Parameters:
fs1
-fs2
-- Returns:
- fs1 MINUS fs2
-
getManner
Return the set of manner features for this feature set.- Returns:
- manner features
-
getPlace
-
getVoicing
-
iterator
-