Class NameLastFirst

    • Field Detail

      • SEMANTIC_TYPE

        public static final String SEMANTIC_TYPE
        The Semantic type for this Plugin.
        See Also:
        Constant Field Values
    • Constructor Detail

      • NameLastFirst

        public NameLastFirst​(PluginDefinition plugin)
        Construct a plugin to detect Last name followed by First name based on the Plugin Definition.
        Parameters:
        plugin - The definition of this plugin.
    • Method Detail

      • initialize

        public boolean initialize​(Locale locale)
                           throws FTAPluginException
        Description copied from class: LogicalType
        Called to perform any initialization.
        Overrides:
        initialize in class LogicalTypeCode
        Parameters:
        locale - The locale used for this analysis
        Returns:
        True if initialization was successful.
        Throws:
        FTAPluginException - Thrown when the plugin is incorrectly configured.
      • 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.
      • 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 class LogicalType
        Returns:
        The user-friendly name of the type-qualifier.
      • getBaseType

        public FTAType getBaseType()
        Description copied from class: LogicalType
        The underlying type we are qualifying.
        Overrides:
        getBaseType in class LogicalType
        Returns:
        The underlying type - e.g. STRING, LONG, etc.
      • getRegExp

        public String getRegExp()
        Description copied from class: LogicalType
        The Regular Expression that most closely matches (See LogicalType.isRegExpComplete()) this Logical Type. Note: All valid matches will match this RE, but the inverse is not necessarily true.
        Specified by:
        getRegExp in class LogicalType
        Returns:
        The Java Regular Expression that most closely matches this Logical Type.
      • isRegExpComplete

        public boolean isRegExpComplete()
        Description copied from class: LogicalType
        Is the returned Regular Expression a true and complete representation of the Logical Type. For example, \\d{5} is not for US ZIP codes (e.g. 00000 is not a valid Zip), whereas (?i)(male|female) could be valid for a Gender.
        Overrides:
        isRegExpComplete in class LogicalTypeInfinite
        Returns:
        The Java Regular Expression that most closely matches this Logical Type.
      • isValid

        public boolean isValid​(String input)
        Description copied from class: LogicalType
        Is the supplied String an instance of this logical type?
        Specified by:
        isValid in class LogicalType
        Parameters:
        input - String to check (trimmed for Numeric base Types, un-trimmed for String base Type)
        Returns:
        true iff the supplied String is an instance of this Logical type.
      • isCandidate

        public boolean isCandidate​(String trimmed,
                                   StringBuilder compressed,
                                   int[] charCounts,
                                   int[] lastIndex)
        Description copied from class: LogicalTypeInfinite
        A fast check to see if the supplied String might be an instance of this logical type?
        Specified by:
        isCandidate in class LogicalTypeInfinite
        Parameters:
        trimmed - String to check
        compressed - A compressed representation of the input string (e.g. \d{5} for 20351).
        charCounts - An array of occurrence counts for characters in the input (ASCII-only).
        lastIndex - An array of the last index where character is located (ASCII-only).
        Returns:
        true iff the supplied String is a possible instance of 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 class LogicalType
        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 against
        facts - Facts (min, max, sum) for the analysis to date (optional - i.e. maybe null)
        cardinality - Cardinality set, up to the maximum maintained
        outliers - Outlier set, up to the maximum maintained
        tokenStreams - Shapes observed
        analysisConfig - The Configuration of the current analysis
        Returns:
        Null if we think this is an instance of this logical type (backout pattern otherwise)
      • getConfidence

        public double getConfidence​(long matchCount,
                                    long realSamples,
                                    String dataStreamName)
        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 class LogicalType
        Parameters:
        matchCount - Number of matches (as determined by isValid())
        realSamples - Number of samples observed - does not include either nulls or blanks
        dataStreamName - Name of the Data Stream
        Returns:
        Confidence as a percentage.