Class FeatureNames


  • public class FeatureNames
    extends java.lang.Object
    Utility methods for query, document and constant rank feature names
    Author:
    bratseth
    • Constructor Summary

      Constructors 
      Constructor Description
      FeatureNames()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Optional<java.lang.String> argumentOf​(java.lang.String feature)
      Returns the single argument of the given feature name, without any quotes, or empty if it is not a valid query, attribute or constant feature name
      static com.yahoo.searchlib.rankingexpression.Reference asAttributeFeature​(java.lang.String attributeName)  
      static com.yahoo.searchlib.rankingexpression.Reference asConstantFeature​(java.lang.String constantName)  
      static com.yahoo.searchlib.rankingexpression.Reference asQueryFeature​(java.lang.String propertyName)  
      static boolean isConstantFeature​(com.yahoo.searchlib.rankingexpression.Reference reference)
      Returns true if this is a constant
      static boolean isSimpleFeature​(com.yahoo.searchlib.rankingexpression.Reference reference)
      Returns true if the given reference is an attribute, constant or query feature
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FeatureNames

        public FeatureNames()
    • Method Detail

      • asConstantFeature

        public static com.yahoo.searchlib.rankingexpression.Reference asConstantFeature​(java.lang.String constantName)
      • asAttributeFeature

        public static com.yahoo.searchlib.rankingexpression.Reference asAttributeFeature​(java.lang.String attributeName)
      • asQueryFeature

        public static com.yahoo.searchlib.rankingexpression.Reference asQueryFeature​(java.lang.String propertyName)
      • isSimpleFeature

        public static boolean isSimpleFeature​(com.yahoo.searchlib.rankingexpression.Reference reference)
        Returns true if the given reference is an attribute, constant or query feature
      • isConstantFeature

        public static boolean isConstantFeature​(com.yahoo.searchlib.rankingexpression.Reference reference)
        Returns true if this is a constant
      • argumentOf

        public static java.util.Optional<java.lang.String> argumentOf​(java.lang.String feature)
        Returns the single argument of the given feature name, without any quotes, or empty if it is not a valid query, attribute or constant feature name