/includes/functions_name.php

Description

Name Specific Functions

phpGedView: Genealogy Viewer Copyright (C) 2002 to 2007 John Finlay and Others

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

  • version: $Id: functions_name.php 981 2007-03-21 13:24:38Z fisharebest $
Functions
check_NN (line 727)

This function replaces @N.N. and @P.N. with the language specific translations

string check_NN (mixed $names)
  • mixed $names: $names could be an array of name parts or it could be a string of the name
DMSoundex (line 997)

determine the Daitch-Mokotoff Soundex code for a name

  • return: The array of codes
array DMSoundex (string $name, [ $option = ""])
  • string $name: The name
  • $option
extract_surname (line 609)

Extract the surname from a name

This function will extract the surname from an individual name in the form Surname, Given Name All surnames are stored in the global $surnames array It will only get the surnames that start with the letter $alpha For names like van den Burg, it will only return the "Burg" It will work if the surname is all lowercase

void extract_surname (string $indiname, [ $count = true])
  • string $indiname: the name to extract the surname from
  • $count
get_add_person_name (line 514)
void get_add_person_name ( $pid)
  • $pid
get_add_person_name_in_record (line 524)
void get_add_person_name_in_record ( $name_record, [ $keep_slash = false])
  • $name_record
  • $keep_slash
get_add_repo_descriptor (line 421)

get the additional descriptive title of the repository

  • return: the additional title of the repository
string get_add_repo_descriptor (string $rid)
  • string $rid: the gedcom xref id for the repository to find
get_add_source_descriptor (line 399)

get the additional descriptive title of the source

  • return: the additional title of the source
string get_add_source_descriptor (string $sid)
  • string $sid: the gedcom xref id for the source to find
get_common_surnames (line 59)

Get array of common surnames

This function returns a simple array of the most common surnames found in the individuals list.

void get_common_surnames (int $min)
  • int $min: the number of times a surname must occur before it is added to the array
get_common_surnames_index (line 38)

Get array of common surnames from index

This function returns a simple array of the most common surnames found in the individuals list.

void get_common_surnames_index ( $ged, int $min)
  • int $min: the number of times a surname must occur before it is added to the array
  • $ged
get_family_add_descriptor (line 486)
void get_family_add_descriptor ( $fid)
  • $fid
get_family_descriptor (line 460)
void get_family_descriptor ( $fid)
  • $fid
get_first_letter (line 667)

get first letter

get the first letter of a UTF-8 string

  • return: the first letter UTF-8 encoded
string get_first_letter (string $text, [ $import = false])
  • string $text: the text to get the first letter from
  • $import
get_indi_names (line 925)

get an array of names from an indivdual record

  • return: The array of individual names
array get_indi_names (string $indirec, [ $import = false])
  • string $indirec: The raw individual gedcom record
  • $import
get_media_descriptor (line 334)

get the descriptive title of the media object

  • return: the title of the source
string get_media_descriptor ( $id, string $sid)
  • string $sid: the gedcom xref id for the media to find
  • $id
get_name_in_record (line 110)

Get the name from the raw gedcom record. Use the level 2 XXXX parts in preference to the 1 NAME. Replace missing GIVN/SURN with "unknown" placeholders.

void get_name_in_record (string $indirec)
  • string $indirec: the raw gedcom record to get the name from
get_person_name (line 261)

get the name for a person

returns the name in the form Given Name Surname If the $NAME_FROM_GEDCOM variable is true then the name is retrieved from the gedcom record not from the database index.

  • return: the person's name (Given Name Surname)
string get_person_name (string $pid, [bool $checkUnknown = true])
  • string $pid: the xref gedcom id of the person
  • bool $checkUnknown: whether to check for (unknown) before returning
get_repo_descriptor (line 376)

get the descriptive title of the repository

  • return: the title of the repository
string get_repo_descriptor (string $rid)
  • string $rid: the gedcom xref id for the repository to find
get_sortable_add_name (line 550)
void get_sortable_add_name ( $pid)
  • $pid
get_sortable_family_descriptor (line 437)
void get_sortable_family_descriptor ( $fid)
  • $fid
get_sortable_name (line 176)

get the person's name as surname, given names

This function will return the given person's name in a format that is good for sorting Surname, given names

  • return: the sortable name
string get_sortable_name (string $pid, [string $alpha = ""], [string $surname = ""], [boolean $allnames = false])
  • string $pid: the gedcom xref id for the person
  • string $alpha: only get the name that starts with a certain letter
  • string $surname: only get the name that has this surname
  • boolean $allnames: true returns all names in an array
get_source_descriptor (line 357)

get the descriptive title of the source

  • return: the title of the source
string get_source_descriptor (string $sid)
  • string $sid: the gedcom xref id for the source to find
reverse_name (line 308)

reverse a name

this function will reverse a name for languages that prefer last name first such as hungarian and chinese

  • return: the reversed name
string reverse_name (string $name)
  • string $name: the name to reverse, must be gedcom encoded as if from the 1 NAME line
smart_utf8_decode (line 892)

Convert a string to UTF8

This function is a replacement for utf8_decode()

  • return: the converted text
  • author: http://www.php.net/manual/en/function.utf8-decode.php
string smart_utf8_decode (string $in_str)
  • string $in_str: the text to be converted
sortable_name_from_name (line 229)

get the sortable name from the gedcom name

  • return: The new name in the form Surname, Given Names
string sortable_name_from_name (string $name)
  • string $name: the name from the 1 NAME gedcom line including the /
str2lower (line 786)

Put all characters in a string in lowercase

This function is a replacement for strtolower() and will put all characters in lowercase

  • return: the converted text in lowercase
  • todo: look at function performance as it is much slower than strtolower
  • author: eikland
string str2lower (string $value)
  • string $value: the text to be converted to lowercase
str2upper (line 839)

Put all characters in a string in uppercase

This function is a replacement for strtoupper() and will put all characters in uppercase

  • return: the converted text in uppercase
  • todo: look at function performance as it is much slower than strtoupper
  • author: botak
string str2upper (string $value)
  • string $value: the text to be converted to uppercase
strip_prefix (line 591)

strip name prefixes

this function strips the prefixes of lastnames get rid of jr. Jr. Sr. sr. II, III and van, van der, de lowercase surname prefixes a . and space must be behind a-z to ensure shortened prefixes and multiple prefixes are removed

  • return: The updated name
string strip_prefix (string $lastname)
  • string $lastname: The name to strip
surname_count (line 635)

add a surname to the surnames array for counting

string surname_count (string $nsurname)
  • string $nsurname

Documentation generated on Wed, 28 Mar 2007 09:54:19 -0600 by phpDocumentor 1.3.1