Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version
Go to top

Name genderization

, 22 Apr 2002
Extrapolate the gender of a person based on their first name
genderizer_demo.zip
Genderizer.dsp
Genderizer.opt
Genderizer.plg
NameDB.mdb
res
Genderizer.ico
Genderizer.exe
genderizer_src.zip
NameDB.mdb
// CFPSGenderize
// Author:	Matt Gullett
//			gullettm@yahoo.com
// Copyright (c) 2000
//
// This is a back-end utility class implementing support for name
// genderization services.  It is an extremely simple class with
// a map of names and genders.
//
// This class is highly dependent on the list of names/genders 
// available.
//
// You may freely use this source code in personal, freeware, shareware
// or commercial applications provided that 1) my name is recognized in the
// code and if this code represents a substantial portion of the application
// that my name be included in the credits for the application (about box, etc)
//
// Use this code at your own risk.  This code is provided AS-IS.  No warranty
// is granted as to the correctness, usefulness or value of this code.
//
// *******************************************************************
// TECHNICAL NOTES:
//
// See .cpp file for tech notes
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_FPSGENDERIZER_H__500DF6DA_E2C9_46F2_8D89_C20D96FB77B6__INCLUDED_)
#define AFX_FPSGENDERIZER_H__500DF6DA_E2C9_46F2_8D89_C20D96FB77B6__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define FPSGENDER_DEFAULT_TABLENAME		"FRST_NM_GNDR"
#define FPSGENDER_DEFAULT_HASHTABLESIZE	8001

class CFPSGenderizer  
{
public:
	virtual char Genderize(LPCTSTR lpszName);
	CFPSGenderizer();
	virtual ~CFPSGenderizer();

	virtual BOOL SetTableName(LPCTSTR lpszName);
	virtual BOOL Load(CArchive& ar);
	virtual BOOL Load(LPCTSTR lpszFileName);
	virtual BOOL Load(_ConnectionPtr& pConnection);

protected:
	void AddName(LPCTSTR lpszName, LPCTSTR lpszGender);
	void Optimize(CPtrList& List);

private:
	char		m_szTableName[MAX_PATH+1];

	CMapStringToString	m_mapNames;
};

#endif // !defined(AFX_FPSGENDERIZER_H__500DF6DA_E2C9_46F2_8D89_C20D96FB77B6__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Matt Gullett
Web Developer
United States United States
No Biography provided

| Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 23 Apr 2002
Article Copyright 2002 by Matt Gullett
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid