Package com.cobber.fta.plugins
Class MiddleName
- Object
-
- LogicalType
-
- LogicalTypeCode
-
- LogicalTypeFinite
-
- LogicalTypeFiniteSimple
-
- com.cobber.fta.plugins.FirstName
-
- com.cobber.fta.plugins.MiddleName
-
- All Implemented Interfaces:
LTRandom
,Comparable<LogicalType>
public class MiddleName extends FirstName
Plugin to detect a middle name.
-
-
Field Summary
Fields Modifier and Type Field Description static String
REGEXP
-
Fields inherited from class com.cobber.fta.LogicalTypeFiniteSimple
backout, memberSet, reader, regExp, semanticType
-
Fields inherited from class com.cobber.fta.LogicalTypeFinite
maxLength, minLength
-
Fields inherited from class com.cobber.fta.LogicalType
analysisConfig, defn, locale, localeInfo, pluginLocaleEntry, priority, threshold
-
-
Constructor Summary
Constructors Constructor Description MiddleName(PluginDefinition plugin)
Construct a Middle Name 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, FiniteMap cardinality, FiniteMap outliers, TokenStreams tokenStreams, AnalysisConfig analysisConfig)
Given the data to date as embodied by the arguments return an analysis.boolean
initialize(AnalysisConfig analysisConfig)
Called to perform any initialization.boolean
isClosed()
Does the set of members enumerated reflect the entire set.boolean
isValid(String input, boolean detectMode, long count)
Is the supplied String an instance of this Semantic type?String
nextRandom()
nextRandom will generate a random (secure) valid example of this Semantic Type.-
Methods inherited from class com.cobber.fta.plugins.FirstName
getConfidence, isPlausible
-
Methods inherited from class com.cobber.fta.LogicalTypeFiniteSimple
getMembers, getRegExp, getSemanticType, isMember, setContent
-
Methods inherited from class com.cobber.fta.LogicalTypeFinite
getIgnorable, getMaxLength, getMinLength, getSize, isRegExpComplete
-
Methods inherited from class com.cobber.fta.LogicalTypeCode
getRandom, seed
-
Methods inherited from class com.cobber.fta.LogicalType
acceptsBaseType, compareTo, getBaseType, getDescription, getHeaderConfidence, getPluginDefinition, getPriority, getSignature, getThreshold, isLocaleSensitive, isValid, setThreshold
-
-
-
-
Field Detail
-
REGEXP
public static final String REGEXP
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MiddleName
public MiddleName(PluginDefinition plugin)
Construct a Middle Name plugin based on the Plugin Definition.- Parameters:
plugin
- The definition of this plugin.
-
-
Method Detail
-
initialize
public boolean initialize(AnalysisConfig analysisConfig) throws FTAPluginException
Description copied from class:LogicalType
Called to perform any initialization.- Overrides:
initialize
in classLogicalTypeFiniteSimple
- Parameters:
analysisConfig
- The Analysis configuration used for this analysis- Returns:
- True if initialization was successful.
- Throws:
FTAPluginException
- Thrown when the plugin is incorrectly configured.
-
isValid
public boolean isValid(String input, boolean detectMode, long count)
Description copied from class:LogicalType
Is the supplied String an instance of this Semantic type?- Overrides:
isValid
in classFirstName
- 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.count
- The number of instance of this sample.- Returns:
- true iff the supplied String is an instance of this Semantic type.
-
analyzeSet
public PluginAnalysis analyzeSet(AnalyzerContext context, long matchCount, long realSamples, String currentRegExp, Facts facts, FiniteMap cardinality, FiniteMap 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 Semantic type then valid will be true , if invalid then valid will be false and a new Pattern will be returned.- Overrides:
analyzeSet
in classFirstName
- 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 Semantic type (backout pattern otherwise)
-
nextRandom
public String nextRandom()
Description copied from interface:LTRandom
nextRandom will generate a random (secure) valid example of this Semantic Type.- Specified by:
nextRandom
in interfaceLTRandom
- Overrides:
nextRandom
in classLogicalTypeFiniteSimple
- Returns:
- a new valid example of the Semantic Type.
-
isClosed
public boolean isClosed()
Description copied from class:LogicalType
Does the set of members enumerated reflect the entire set. For example any of the ISO sets are reference sets and hence complete, compared to FirstName and LastName where the set provided is of the common names. If isClosed() is true then isValid() false does not imply that the input is not valid just that it is not in the set of 'known' members.- Overrides:
isClosed
in classLogicalTypeFinite
- Returns:
- A boolean indicating if the set is closed.
-
-