Quickstart#

Introduction#

RightFielder Object will identify, parse and reorganize input data into usable data types, assuring that even the most inconsistent data entry will be properly validated and stored.

Sample Code#

RightFielder Object is compatible with multiple coding languages across different systems. The table below will link you to the sample code for each language hosted in the github repositories.

Language

System

Repository

C# .NET

Windows

melissa_favicon MelissaData/RightFielderObject-Dotnet

Linux

melissa_favicon MelissaData/RightFielderObject-Dotnet-Linux

melissa_favicon MelissaData/RightFielderObject-Dotnet-Wrappers

C++

Windows

melissa_favicon MelissaData/RightFielderObject-Cpp

Linux

melissa_favicon MelissaData/RightFielderObject-Cpp-Linux

Java

Windows

melissa_favicon MelissaData/RightFielderObject-Java

Linux

melissa_favicon MelissaData/RightFielderObject-Java-Linux

melissa_favicon MelissaData/RightFielderObject-Java-Wrappers

Python3

Windows

melissa_favicon MelissaData/RightFielderObject-Python3

Linux

melissa_favicon MelissaData/RightFielderObject-Python3-Linux

melissa_favicon MelissaData/RightFielderObject-Python3-Wrappers

How To Get Data#

Use the Melissa Updater to download the data files using the manifest named rf_data.

Getting Started#

Basic Flow of Actions#

To use the RightFielder Object, you can give it an input field. It will then parse and reorganize input data into usable data types. It can also return result codes based on what cases occured during the lookup.

This is the flow of how RightFielder Object is usually implemented:

The Reference Guide goes into detail on every method available with the RightFielder Object. All the Result Codes and descriptions are also in the reference guide.

1. Initialize RightFielder Object#

Start by creating an instance of the Melissa RightFielder Object.

Example Implementation:

  • C#
  • C++
  • Java
  • Python3
// Create instance of Melissa Right Fielder Object
public mdRightFielder mdRightFielderObj = new mdRightFielder();
// Create instance of Melissa Right Fielder Object
mdRightFielder* mdRightFielderObj = new mdRightFielder;
// Create instance of Melissa Right Fielder Object
mdRightFielder mdRightFielderObj = new mdRightFielder();
# Create instance of Melissa GeoCoder Object
md_right_fielder_obj = mdRightFielder_pythoncode.mdRightFielder()

2. Set a License#

To set a license, either configure the environmental variable for the license or use the method SetLicenseString.

Example Implementation:

  • C#
  • C++
  • Java
  • Python3
// Set license string
mdRightFielderObj.SetLicenseString(MELISSA_LICENSE_STRING);
// Set license string
mdRightFielderObj->SetLicenseString(MELISSA_LICENSE_STRING.c_str());
// Set license string
mdRightFielderObj.SetLicenseString(MELISSA_LICENSE_STRING);
# Set license string
md_right_fielder_obj.SetLicenseString(MELISSA_LICENSE_STRING)

To see when the license will expire, use the method GetLicenseExpirationDate.

Example Implementation:

  • C#
  • C++
  • Java
  • Python3
Console.WriteLine($"Expiration Date: {mdRightFielderObj.GetLicenseExpirationDate()}");
cout << "Expiration Date: " + string(mdRightFielderObj->GetLicenseExpirationDate()) << endl;
System.out.println("Expiration Date: " + mdRightFielderObj.GetLicenseExpirationDate());
print(f"Expiration Date: {md_right_fielder_obj.GetLicenseExpirationDate()}")

3. Initialize Data Files#

To set the path for the data files, use the method SetPathToRightFielderFiles.

Use the method InitializeDataFiles to setup the data files.

ProgramStatus can be used to store the result from InitializeDataFiles to ensure it worked as expected.

Example Implementation:

  • C#
  • C++
  • Java
  • Python3
// Set data paths for objects
mdRightFielderObj.SetPathToRightFielderFiles(PATH_TO_DATA_FILES);
mdRightFielder.ProgramStatus pStatus = mdRightFielderObj.InitializeDataFiles();

// Handle potential issues while initializing the data files
if (pStatus != mdRightFielder.ProgramStatus.NoError)
{
    Console.WriteLine("Failed to Initialize Object.");
    Console.WriteLine($"Program Status: {pStatus}");
    return;
}
// Set data paths for objects
mdRightFielderObj->SetPathToRightFielderFiles(PATH_TO_DATA_FILES.c_str());
mdRightFielder::ProgramStatus pStatus = mdRightFielderObj->InitializeDataFiles();

// Handle potential issues while initializing the data files
if (pStatus != mdRightFielder::NoError)
{
    cout << "Failed to Initialize Object." << endl;
    cout << pStatus << endl;
    return;
}
// Set data paths for objects
mdRightFielderObj.SetPathToRightFielderFiles(PATH_TO_DATA_FILES);
mdRightFielder.ProgramStatus pStatus = mdRightFielderObj.InitializeDataFiles();

// Handle potential issues while initializing the data files
if (pStatus != mdRightFielder.ProgramStatus.NoError) {
    System.out.println("Failed to Initialize Object.");
    System.out.println(pStatus);
    return;
}
# Set data paths for objects
md_right_fielder_obj.SetPathToRightFielderFiles(PATH_TO_DATA_FILES)
p_status = md_right_fielder_obj.InitializeDataFiles()

# Handle potential issues while initializing the data files
if (p_status != mdRightFielder_pythoncode.ProgramStatus.NoError):
    print("Failed to Initialize Object.")
    print(p_status)
    return

To check at what date the database was updated, use the method GetDatabaseDate.

The method GetBuildNumber gives the development build number of RightFielder Object.

Example Implementation:

  • C#
  • C++
  • Java
  • Python3
// If you see a different date than expected, check your license string and either
// download the new data files or use the Melissa Updater program to update your data files.
Console.WriteLine($"DataBase Date: {mdRightFielderObj.GetDatabaseDate()}");

// This number should match with file properties of the Melissa Object binary file.
// If TEST appears with the build number, there may be a license key issue.
Console.WriteLine($"Object Version: {mdRightFielderObj.GetBuildNumber()}\n");
// If you see a different date than expected, check your license string and either
// download the new data files or use the Melissa Updater program to update your data files.
cout << "DataBase Date: " + string(mdRightFielderObj->GetDatabaseDate()) << endl;

// This number should match with file properties of the Melissa Object binary file.
// If TEST appears with the build number, there may be a license key issue.
cout << "Object Version: " + string(mdRightFielderObj->GetBuildNumber()) << endl;
// If you see a different date than expected, check your license string and either
// download the new data files or use the Melissa Updater program to update your data files.
System.out.println("DataBase Date: " + mdRightFielderObj.GetDatabaseDate());

// This number should match with file properties of the Melissa Object binary file.
// If TEST appears with the build number, there may be a license key issue.
System.out.println("Object Version: " + mdRightFielderObj.GetBuildNumber());
# If you see a different date than expected, check your license string and either
# download the new data files or use the Melissa Updater program to update your data files.
print(f"DataBase Date: {md_right_fielder_obj.GetDatabaseDate()}")

# This number should match with file properties of the Melissa Object binary file.
# If TEST appears with the build number, there may be a license key issue.
print(f"Object Version: {md_right_fielder_obj.GetBuildNumber()}\n")

The method GetInitializeErrorString can get the status on errors in initialization. This can help determine if the code should continue running.

Example Implementation:

  • C#
  • C++
  • Java
  • Python3
bool shouldContinueRunning = true;

if (mdRightFielderObj.GetInitializeErrorString() != "No error")
{
    shouldContinueRunning = false;
}
bool shouldContinueRunning = true;

if (string(mdRightFielderObj->GetInitializeErrorString()) != "No error.")
{
    shouldContinueRunning = false;
}
Boolean shouldContinueRunning = true;

if (!mdRightFielderObj.GetInitializeErrorString().equals("No error"))
    shouldContinueRunning = false;
should_continue_running = True

if md_right_fielder_obj.GetInitializeErrorString() != "No error":
    should_continue_running = False

4. Parse Field#

Use the method Parse to parse the given field.

The method SetUserPattern may be called before the parse to configure a custom type of information to analyze.

Example Implementation:

  • C#
  • C++
  • Java
  • Python3
// These are the configuarble pieces of the Right Fielder Object. We are setting what kind of information we want to be looked up
// SetUserPattern Method - Ex. Social Security Number
mdRightFielderObj.SetUserPattern("PatternName", "[0-9]{1}");

// This will call the function to process the given field
// as well as generate the result codes
mdRightFielderObj.Parse(FIELD_STRING);
// These are the configuarble pieces of the Right Fielder Object. We are setting what kind of information we want to be looked up
// SetUserPattern Method - Ex. Social Security Number
//mdRightFielderObj.SetUserPattern("PatternName", "[0-9]{1}");

// This will call the function to process the given field
// as well as generate the result codes
mdRightFielderObj->Parse(FIELD_STRING);
// These are the configuarble pieces of the Right Fielder Object. We are setting what kind of information we want to be looked up
// SetUserPattern Method - Ex. Social Security Number
mdRightFielderObj.SetUserPattern("PatternName", "[0-9]{1}");

// This will call the function to process the given field
// as well as generate the result codes
mdRightFielderObj.Parse(FIELD_STRING);
# These are the configuarble pieces of the Right Fielder Object. We are setting what kind of information we want to be looked up
# SetUserPattern Method - Ex. Social Security Number
md_right_fielder_obj.SetUserPattern("PatternName", "[0-9]{1}")

# This will call the function to process the given field
# as well as generate the result codes
md_right_fielder_obj.Parse(FIELD_STRING)

5. Get Sanitized Fields#

These methods get data from the parsed field:

Example Implementation:

  • C#
  • C++
  • Java
  • Python3
mdRightFielderObj.GetAddress();
mdRightFielderObj.GetAddress2();
mdRightFielderObj.GetAddress3();
mdRightFielderObj.GetCity();
mdRightFielderObj.GetState();
mdRightFielderObj.GetPostalCode();
mdRightFielderObj.GetFullNameNext();
mdRightFielderObj.GetFullName();
mdRightFielderObj.GetDepartmentNext();
mdRightFielderObj.GetDepartment();
mdRightFielderObj.GetCompanyNext();
mdRightFielderObj.GetCompany();
mdRightFielderObj.GetCountry();
mdRightFielderObj.GetLastLine();
mdRightFielderObj.GetPhoneNext();
mdRightFielderObj.GetPhone();
mdRightFielderObj.GetPhoneTypeNext();
mdRightFielderObj.GetPhoneType();
mdRightFielderObj.GetEmailNext();
mdRightFielderObj.GetEmail();
mdRightFielderObj.GetURLNext();
mdRightFielderObj.GetURL();
mdRightFielderObj.GetUserFieldNext("SSN");
mdRightFielderObj.GetUserField("SSN");
mdRightFielderObj.GetUnrecognizedNext();
mdRightFielderObj.GetUnrecognized();
mdRightFielderObj->GetAddress();
mdRightFielderObj->GetAddress2();
mdRightFielderObj->GetAddress3();
mdRightFielderObj->GetCity();
mdRightFielderObj->GetState();
mdRightFielderObj->GetPostalCode();
mdRightFielderObj->GetFullNameNext();
mdRightFielderObj->GetFullName();
mdRightFielderObj->GetDepartmentNext();
mdRightFielderObj->GetDepartment();
mdRightFielderObj->GetCompanyNext();
mdRightFielderObj->GetCompany();
mdRightFielderObj->GetCountry();
mdRightFielderObj->GetLastLine();
mdRightFielderObj->GetPhoneNext();
mdRightFielderObj->GetPhone();
mdRightFielderObj->GetPhoneTypeNext();
mdRightFielderObj->GetPhoneType();
mdRightFielderObj->GetEmailNext();
mdRightFielderObj->GetEmail();
mdRightFielderObj->GetURLNext();
mdRightFielderObj->GetURL();
mdRightFielderObj->GetUserFieldNext("SSN");
mdRightFielderObj->GetUserField("SSN");
mdRightFielderObj->GetUnrecognizedNext();
mdRightFielderObj->GetUnrecognized();
mdRightFielderObj.GetAddress();
mdRightFielderObj.GetAddress2();
mdRightFielderObj.GetAddress3();
mdRightFielderObj.GetCity();
mdRightFielderObj.GetState();
mdRightFielderObj.GetPostalCode();
mdRightFielderObj.GetFullNameNext();
mdRightFielderObj.GetFullName();
mdRightFielderObj.GetDepartmentNext();
mdRightFielderObj.GetDepartment();
mdRightFielderObj.GetCompanyNext();
mdRightFielderObj.GetCompany();
mdRightFielderObj.GetCountry();
mdRightFielderObj.GetLastLine();
mdRightFielderObj.GetPhoneNext();
mdRightFielderObj.GetPhone();
mdRightFielderObj.GetPhoneTypeNext();
mdRightFielderObj.GetPhoneType();
mdRightFielderObj.GetEmailNext();
mdRightFielderObj.GetEmail();
mdRightFielderObj.GetURLNext();
mdRightFielderObj.GetURL();
mdRightFielderObj.GetUserFieldNext("SSN");
mdRightFielderObj.GetUserField("SSN");
mdRightFielderObj.GetUnrecognizedNext();
mdRightFielderObj.GetUnrecognized();
md_right_fielder_obj.GetAddress()
md_right_fielder_obj.GetAddress2()
md_right_fielder_obj.GetAddress3()
md_right_fielder_obj.GetCity()
md_right_fielder_obj.GetState()
md_right_fielder_obj.GetPostalCode()
md_right_fielder_obj.GetFullNameNext()
md_right_fielder_obj.GetFullName()
md_right_fielder_obj.GetDepartmentNext()
md_right_fielder_obj.GetDepartment()
md_right_fielder_obj.GetCompanyNext()
md_right_fielder_obj.GetCompany()
md_right_fielder_obj.GetCountry()
md_right_fielder_obj.GetLastLine()
md_right_fielder_obj.GetPhoneNext()
md_right_fielder_obj.GetPhone()
md_right_fielder_obj.GetPhoneTypeNext()
md_right_fielder_obj.GetPhoneType()
md_right_fielder_obj.GetEmailNext()
md_right_fielder_obj.GetEmail()
md_right_fielder_obj.GetURLNext()
md_right_fielder_obj.GetURL()
md_right_fielder_obj.GetUserFieldNext("SSN")
md_right_fielder_obj.GetUserField("SSN")
md_right_fielder_obj.GetUnrecognizedNext()
md_right_fielder_obj.GetUnrecognized()

6. Get the Melissa Result Codes#

To get the result codes, use the method GetResults. This will return all of the result codes stacked together in a single String separated by ‘,’ delimiters.

Example Implementation:

  • C#
  • C++
  • Java
  • Python3
string ResultCodes = mdRightFielderObj.GetResults();
string ResultCodes = mdRightFielderObj->GetResults();
String ResultCodes = mdRightFielderObj.GetResults();
result_codes = md_right_fielder_obj.GetResults()

The following implementation shows one way of interpreting the results by using the method GetResultCodeDescription:

  • C#
  • C++
  • Java
  • Python3
mdRightFielderObj.GetResultCodeDescription(RESULT_CODE_STRING, mdRightFielder.ResultCdDescOpt.ResultCodeDescriptionLong);

// ResultsCodes explain any issues RightFielder Object has.
mdRightFielderObj->GetResultCodeDescription(RESULT_CODE_STRING.c_str(), mdRightFielder->ResultCodeDescriptionLong);

// ResultsCodes explain any issues RightFielder Object has.
mdRightFielderObj.GetResultCodeDescription(RESULT_CODE_STRING, mdRightFielder.ResultCdDescOpt.ResultCodeDescriptionLong);

// ResultsCodes explain any issues RightFielder Object has.
md_right_fielder_obj.GetResultCodeDescription(RESULT_CODE_STRING, mdRightFielder_pythoncode.ResultCdDescOpt.ResultCodeDescriptionLong)

# ResultsCodes explain any issues RightFielder Object has.