Package com.cobber.fta.plugins
Class Gender
- Object
-
- LogicalType
-
- LogicalTypeCode
-
- LogicalTypeFinite
-
- com.cobber.fta.plugins.Gender
-
- All Implemented Interfaces:
LTRandom
,Comparable<LogicalType>
public class Gender extends LogicalTypeFinite
Plugin to detect Gender.
-
-
Field Summary
Fields Modifier and Type Field Description static String
SEMANTIC_TYPE
The Semantic type for this Plugin.-
Fields inherited from class com.cobber.fta.LogicalTypeFinite
maxLength, minLength
-
Fields inherited from class com.cobber.fta.LogicalTypeCode
random
-
Fields inherited from class com.cobber.fta.LogicalType
defn, locale, pluginLocaleEntry, priority, threshold
-
-
Constructor Summary
Constructors Constructor Description Gender(PluginDefinition plugin)
Construct a Gender plugin based on the Plugin Definition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PluginAnalysis
analyzeSet(AnalyzerContext context, long matchCount, long realSamples, String currentRegExp, Facts facts, Map<String,Long> cardinality, Map<String,Long> outliers, TokenStreams tokenStreams, AnalysisConfig analysisConfig)
Given the data to date as embodied by the arguments return an analysis.Set<String>
getMembers()
String
getQualifier()
The user-friendly name of the Qualifier.String
getRegExp()
The Regular Expression that most closely matches (SeeLogicalType.isRegExpComplete()
) this Logical Type.boolean
initializeDelayed()
String
nextRandom()
nextRandom will generate a random (secure) valid example of this Semantic Type.-
Methods inherited from class com.cobber.fta.LogicalTypeFinite
getMaxLength, getMinLength, getSize, initialize, isClosed, isRegExpComplete, isValid
-
Methods inherited from class com.cobber.fta.LogicalTypeCode
seed
-
Methods inherited from class com.cobber.fta.LogicalType
acceptsBaseType, compareTo, getBaseType, getConfidence, getDescription, getHeaderConfidence, getPluginDefinition, getPriority, getSignature, getThreshold, isLocaleSensitive, setThreshold
-
-
-
-
Field Detail
-
SEMANTIC_TYPE
public static final String SEMANTIC_TYPE
The Semantic type for this Plugin.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Gender
public Gender(PluginDefinition plugin)
Construct a Gender plugin based on the Plugin Definition.- Parameters:
plugin
- The definition of this plugin.
-
-
Method Detail
-
nextRandom
public String nextRandom()
Description copied from interface:LTRandom
nextRandom will generate a random (secure) valid example of this Semantic Type.- Returns:
- a new valid example of the Semantic Type.
-
initializeDelayed
public boolean initializeDelayed()
-
getMembers
public Set<String> getMembers()
- Specified by:
getMembers
in classLogicalTypeFinite
-
getQualifier
public String getQualifier()
Description copied from class:LogicalType
The user-friendly name of the Qualifier. For example, EMAIL for an email address- Specified by:
getQualifier
in classLogicalType
- Returns:
- The user-friendly name of the type-qualifier.
-
getRegExp
public String getRegExp()
Description copied from class:LogicalType
The Regular Expression that most closely matches (SeeLogicalType.isRegExpComplete()
) this Logical Type. Note: All valid matches will match this RE, but the inverse is not necessarily true.- Specified by:
getRegExp
in classLogicalType
- Returns:
- The Java Regular Expression that most closely matches this Logical Type.
-
analyzeSet
public PluginAnalysis analyzeSet(AnalyzerContext context, long matchCount, long realSamples, String currentRegExp, Facts facts, Map<String,Long> cardinality, Map<String,Long> outliers, TokenStreams tokenStreams, AnalysisConfig analysisConfig)
Description copied from class:LogicalType
Given the data to date as embodied by the arguments return an analysis. If we think this is an instance of this logical type then valid will be true , if invalid then valid will be false and a new Pattern will be returned.- Specified by:
analyzeSet
in classLogicalType
- Parameters:
context
- The context used to interpret the Data Stream (for example, stream name, date resolution mode, etc)matchCount
- Number of samples that match so far (as determined by isValid()realSamples
- Number of real (i.e. non-blank and non-null) samples that we have processed so far.currentRegExp
- The current Regular Expression that we matched againstfacts
- Facts (min, max, sum) for the analysis to date (optional - i.e. maybe null)cardinality
- Cardinality set, up to the maximum maintainedoutliers
- Outlier set, up to the maximum maintainedtokenStreams
- Shapes observedanalysisConfig
- The Configuration of the current analysis- Returns:
- Null if we think this is an instance of this logical type (backout pattern otherwise)
-
-