nametitle

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2020 License: LGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package nametitle is the subpackage of package candidate which generates names with titles stripped away based on pre-defined regular expression patterns.

Index

Constants

This section is empty.

Variables

View Source
var DefaultNameTitlePatterns = []*regexp.Regexp{
	regexp.MustCompile("^(.*)$"),

	regexp.MustCompile("^(?:mister )(.*)$"),
	regexp.MustCompile("^(?:miss )(.*)$"),
	regexp.MustCompile("^(?:master )(.*)$"),

	regexp.MustCompile("^(?:mr(?: |\\. |\\.))(.*)$"),
	regexp.MustCompile("^(?:mrs(?: |\\. |\\.))(.*)$"),
	regexp.MustCompile("^(?:ms(?: |\\. |\\.))(.*)$"),

	regexp.MustCompile("^(?:นาย ?)(.*)$"),
	regexp.MustCompile("^(?:นาง ?)(.*)$"),
	regexp.MustCompile("^(?:นางสาว ?)(.*)$"),
	regexp.MustCompile("^(?:เด็กชาย ?)(.*)$"),
	regexp.MustCompile("^(?:เด็กหญิง ?)(.*)$"),

	regexp.MustCompile("^(?:ดช(?: |\\. |\\.))(.*)$"),
	regexp.MustCompile("^(?:ดญ(?: |\\. |\\.))(.*)$"),

	regexp.MustCompile("^(?:น\\.ส\\. ?)(.*)$"),
	regexp.MustCompile("^(?:ด\\.ช\\. ?)(.*)$"),
	regexp.MustCompile("^(?:ด\\.ญ\\. ?)(.*)$"),
}

DefaultNameTitlePatterns is a sequence of all compiled regular expression objects which separates bare names from their prefixed and suffixed titles in a full name string. As of current, only common English and Thai prefixed titles are handled.

GenerateNamesWithoutTitles is a preset function which generates a sequence of all possible bare names (or names without prefixed or suffixed titles). It is built upon the function DecomposeName with the patterns from DefaultNameTitlePatterns.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL