Class Feature<T extends com.tibco.patterns.learn.jaxb.model.FeatureType>
- java.lang.Object
-
- com.tibco.patterns.learn.api.feature.Feature<T>
-
- Direct Known Subclasses:
GenderFeature,GenericFeature,PersonNameFeature
public class Feature<T extends com.tibco.patterns.learn.jaxb.model.FeatureType> extends java.lang.ObjectA user-defined feature composed of one or more querylets. Maintains an XML FeatureType object and a list of Querylet objects. Features are typically created using subclasses of the Feature class. Querylets are specified in constructors and later cannot be added/removed from the Feature.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>getFieldNames()java.lang.StringgetName()java.util.List<com.netrics.likeit.NetricsQuery>getNetricsQlts(java.lang.String[] values)Constructs all NetricsQuery querylets from the corresponding XML Search structure and the field values.intgetNQlts()QueryletgetQlt(int index)java.util.List<java.lang.String>getQltNames()java.util.List<AbstractQlt<?>>getQlts()voidsetName(java.lang.String name)Sets the name of this feature.java.lang.StringtoString()
-
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getQlt
public final Querylet getQlt(int index)
- Parameters:
index- - querylet index in the list of querylets for this feature.- Returns:
- the querylet with the given index.
-
getQlts
public final java.util.List<AbstractQlt<?>> getQlts()
- Returns:
- list of all querylets that stored in this feature
-
getName
public final java.lang.String getName()
- Returns:
- name of this feature.
-
setName
public final void setName(java.lang.String name)
Sets the name of this feature.- Parameters:
name- - the new name of this feature.
-
getNQlts
public final int getNQlts()
- Returns:
- the number of querylets in this user-defined feature
-
getQltNames
public final java.util.List<java.lang.String> getQltNames()
- Returns:
- names of all querylets in this feature. For generic features the only string in the list matches the name of the feature.
-
getNetricsQlts
public java.util.List<com.netrics.likeit.NetricsQuery> getNetricsQlts(java.lang.String[] values)
Constructs all NetricsQuery querylets from the corresponding XML Search structure and the field values. The returned querylets can then be used to obtain feature scores from Patterns server.- Parameters:
values- - The values of all non-key fields in the query record.- Returns:
- a list with constructed NetricsQuery querylets.
-
getFieldNames
public java.util.List<java.lang.String> getFieldNames()
- Returns:
- names of all fields included in all querylets of this feature
-
-