Class FeatureSetMatcher

java.lang.Object
ca.phon.phonex.FeatureSetMatcher
All Implemented Interfaces:
PhoneMatcher

public final class FeatureSetMatcher extends Object implements PhoneMatcher
Class to match phones based on feature sets.
  • Constructor Details

    • FeatureSetMatcher

      public FeatureSetMatcher()
      Constructor
    • FeatureSetMatcher

      public FeatureSetMatcher(FeatureSet requiredFeatures)
    • FeatureSetMatcher

      public FeatureSetMatcher(FeatureSet requiredFeatures, FeatureSet notFeatures)
  • Method Details

    • addRequiredFeature

      public void addRequiredFeature(String featureName)
      Add a new required feature to the set
      Parameters:
      featureName -
      Throws:
      IllegalArgumentException - if the given feature name is not a valid feature
    • addNotFeature

      public void addNotFeature(String featureName)
      Add a feature that is required NOT to be in the given phone's feature set.
      Parameters:
      featureName -
      Throws:
      IllegalArgumentException - if the given feature name is not a vaild feature.
    • matches

      public boolean matches(IPAElement p)
      Description copied from interface: PhoneMatcher
      Perform test on given phone.
      Specified by:
      matches in interface PhoneMatcher
    • matchesAnything

      public boolean matchesAnything()
      Description copied from interface: PhoneMatcher
      Does this matcher match anything? Used at runtime to help determine proper backtracking paths.
      Specified by:
      matchesAnything in interface PhoneMatcher
    • toString

      public String toString()
      Overrides:
      toString in class Object