Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Defaults = []byte(`{
"titles": [
{
"title": "Mr",
"type": "p"
},
{
"title": "Mr.",
"type": "p"
},
{
"title": "Mrs",
"type": "p"
},
{
"title": "Mrs.",
"type": "p"
},
{
"title": "Ms",
"type": "p"
},
{
"title": "Ms.",
"type": "p"
},
{
"title": "Dr",
"type": "p"
},
{
"title": "Dr.",
"type": "p"
},
{
"title": "Miss",
"type": "p"
},
{
"title": "Sir",
"type": "p"
},
{
"title": "Judge",
"type": "p"
},
{
"title": "Justice",
"type": "p"
},
{
"title": "Brother",
"type": "p"
},
{
"title": "Sister",
"type": "p"
},
{
"title": "Prof",
"type": "p"
},
{
"title": "Prof.",
"type": "p"
},
{
"title": "Professor",
"type": "p"
},
{
"title": "Col.",
"type": "p"
},
{
"title": "Colonel",
"type": "p"
},
{
"title": "General",
"type": "p"
},
{
"title": "Gen.",
"type": "p"
},
{
"title": "Sgt.",
"type": "p"
},
{
"title": "Sergeant",
"type": "p"
},
{
"title": "Agent",
"type": "p"
},
{
"title": "Principal",
"type": "p"
},
{
"title": "Queen",
"type": "p"
},
{
"title": "King",
"type": "p"
},
{
"title": "BA",
"type": "s"
},
{
"title": "B.A.",
"type": "s"
},
{
"title": "BS",
"type": "s"
},
{
"title": "B.S.",
"type": "s"
},
{
"title": "MBA",
"type": "s"
},
{
"title": "M.B.A.",
"type": "s"
},
{
"title": "PhD",
"type": "s"
},
{
"title": "Ph.D",
"type": "s"
},
{
"title": "Sr.",
"type": "s"
},
{
"title": "Sr",
"type": "s"
},
{
"title": "Senior",
"type": "s"
},
{
"title": "Jr.",
"type": "s"
},
{
"title": "Jr",
"type": "s"
},
{
"title": "Junior",
"type": "s"
},
{
"title": "I",
"type": "s"
},
{
"title": "II",
"type": "s"
},
{
"title": "III",
"type": "s"
},
{
"title": "IV",
"type": "s"
},
{
"title": "V",
"type": "s"
},
{
"title": "VI",
"type": "s"
},
{
"title": "VII",
"type": "s"
},
{
"title": "VIII",
"type": "s"
},
{
"title": "IX",
"type": "s"
},
{
"title": "X",
"type": "s"
}
]
}`)
Defaults provides a set of defaults at the package level.
Functions ¶
func LoadTitleData ¶
func LoadTitleData() error
LoadTitleData creates a map consisting of title prefixes and suffixes that are common. This can be called optionally by the consumer if they are expecting their input data to include prefixes and/or suffixes
func LoadTitleDataCSV ¶
LoadTitleDataCSV works the same as LoadTitleData(), but expects a file path as input with should contain a .csv file extension.
Types ¶
type Name ¶
type Name struct {
First, Middle, Last, Prefix, Suffix string
// contains filtered or unexported fields
}
Name contains a common list fields that could be combined as a person's full name
func (*Name) FormatName ¶
func (n *Name) FormatName()
FormatName creates a struct member with a formatted full name.
func (*Name) FormattedName ¶
FormattedName returns the formatted full name string created by FormatFullName()
func (*Name) Initials ¶
Initials returns the acronym for the Name. The argument del will default to an empty string, but a common input would be "." producing a result with periods (eg. J.K.M.)
func (*Name) SeparateName ¶
SeparateName uses receiver n, and parses full according to common logic and parses the full name with the fields separated. If full is empty, then Name will reflect the zero values appropriately. If full cannot be split on sep, then Name.First will be set as the entire value of full.