Package com.cobber.fta.plugins
Class FirstName
- Object
-
- LogicalType
-
- LogicalTypeCode
-
- LogicalTypeFinite
-
- LogicalTypeFiniteSimple
-
- com.cobber.fta.plugins.PersonName
-
- com.cobber.fta.plugins.FirstName
-
- All Implemented Interfaces:
LTRandom
,Comparable<LogicalType>
- Direct Known Subclasses:
MiddleName
public class FirstName extends PersonName
Plugin to detect an individuals First Name.
-
-
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.plugins.PersonName
REGEXP
-
Fields inherited from class com.cobber.fta.LogicalTypeFiniteSimple
backout, memberSet, qualifier, reader, regExp
-
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
analysisConfig, defn, locale, localeInfo, pluginLocaleEntry, priority, threshold
-
-
Constructor Summary
Constructors Constructor Description FirstName(PluginDefinition plugin)
Construct a First Name plugin based on the Plugin Definition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getConfidence(long matchCount, long realSamples, AnalyzerContext context)
Confidence in the type classification.boolean
isValid(String input, boolean detectMode)
Is the supplied String an instance of this Semantic type?-
Methods inherited from class com.cobber.fta.plugins.PersonName
analyzeSet, isClosed, nextRandom
-
Methods inherited from class com.cobber.fta.LogicalTypeFiniteSimple
getMembers, getRegExp, getSemanticType, initialize, isMember, setContent
-
Methods inherited from class com.cobber.fta.LogicalTypeFinite
getIgnorable, getMaxLength, getMinLength, getSize, isRegExpComplete
-
Methods inherited from class com.cobber.fta.LogicalTypeCode
seed
-
Methods inherited from class com.cobber.fta.LogicalType
acceptsBaseType, compareTo, getBaseType, getDescription, getHeaderConfidence, getPluginDefinition, getPriority, getSignature, getThreshold, isLocaleSensitive, isValid, setThreshold
-
-
-
-
Field Detail
-
SEMANTIC_TYPE
public static final String SEMANTIC_TYPE
The Semantic type for this Plugin.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FirstName
public FirstName(PluginDefinition plugin)
Construct a First Name plugin based on the Plugin Definition.- Parameters:
plugin
- The definition of this plugin.
-
-
Method Detail
-
isValid
public boolean isValid(String input, boolean detectMode)
Description copied from class:LogicalType
Is the supplied String an instance of this Semantic type?- Overrides:
isValid
in classPersonName
- Parameters:
input
- String to check (trimmed for Numeric base Types, un-trimmed for String base Type)detectMode
- If true then we are in the process of detection, otherwise it is a simple validity check.- Returns:
- true iff the supplied String is an instance of this Semantic type.
-
getConfidence
public double getConfidence(long matchCount, long realSamples, AnalyzerContext context)
Description copied from class:LogicalType
Confidence in the type classification. Typically this will be the number of matches divided by the number of real samples.- Overrides:
getConfidence
in classLogicalType
- Parameters:
matchCount
- Number of matches (as determined by isValid())realSamples
- Number of samples observed - does not include either nulls or blankscontext
- Context we are operating under (includes data stream name(s))- Returns:
- Confidence as a percentage.
-
-