Find common surnames.

@return string
480676
public function getCommonSurname(): string
    {
        $top_surname = $this->topSurnames(1, 0);
        
        return $top_surname
            ? implode(', ', array_keys(array_shift($top_surname)) ?? [])
            : '';
    }
10530
public function shortName()
    {
        if ($this->isAce()) {
            return self::ACE_SYMBOL;
        }
        if ($this->isKing()) {
            return self::KING_SYMBOL;
        }
        if ($this->isQueen()) {
            return self::QUEEN_SYMBOL;
        }
        if ($this->isJack()) {
            return self::JACK_SYMBOL;
        }
        if ($this->value() === 10) {
            return self::TEN_SYMBOL;
        }

        return (string) $this->value();
    }
684990
public function getDistinctString() {
    $distinct = array();
    if (is_array($s = $this->getDistinct()) && !empty($s)) {
      foreach ($s as $distinctAttribute) {
        $item = array();
        if ($distinctAttribute['dist_key'] != 'none_dist') {
          if (is_array($distinctAttribute) && !empty($distinctAttribute)) {
            foreach ($distinctAttribute as $k => $v) {
              $item[] = $k . ":" . $v;
            }
          }
          $distinct[] = implode(",", $item);
        } else {
          $distinct[] = $distinctAttribute['dist_key'];
        }
      }
    }
    return implode(";", $distinct);
  }
525351
def family_name(self):
        
        def find_first(dict_, keys, default=None):
            for key in keys:
                value = dict_.get(key)
                if value is not None:
                    return value
            return default
        # keys for Unicode, Mac, and Windows family name, respectively
        return find_first(self._names, ((0, 1), (1, 1), (3, 1)))
1314312
public function getNames()
    {
        $tags = $this->execute();
        $tags = \explode("\n", $tags);
        $tags = \array_map('trim', $tags);
        $tags = \array_filter($tags);

        return $tags;
    }
594770
public function get_assoc()
    {
        $out     = array('name' => $this->displayname);
        $typemap = $this->typemap;

        // copy name fields to output array
        foreach (array('firstname','surname','middlename','nickname','organization') as $col) {
            if (strlen($this->$col)) {
                $out[$col] = $this->$col;
            }
        }

        if ($this->raw['N'][0][3])
            $out['prefix'] = $this->raw['N'][0][3];
        if ($this->raw['N'][0][4])
            $out['suffix'] = $this->raw['N'][0][4];

        // convert from raw vcard data into associative data for Roundcube
        foreach (array_flip(self::$fieldmap) as $tag => $col) {
            foreach ((array)$this->raw[$tag] as $i => $raw) {
                if (is_array($raw)) {
                    $k       = -1;
                    $key     = $col;
                    $subtype = '';

                    if (!empty($raw['type'])) {
                        $combined = join(',', self::array_filter((array)$raw['type'], 'internet,pref', true));
                        $combined = strtoupper($combined);

                        if ($typemap[$combined]) {
                            $subtype = $typemap[$combined];
                        }
                        else if ($typemap[$raw['type'][++$k]]) {
                            $subtype = $typemap[$raw['type'][$k]];
                        }
                        else {
                            $subtype = strtolower($raw['type'][$k]);
                        }

                        while ($k < count($raw['type']) && ($subtype == 'internet' || $subtype == 'pref')) {
                            $subtype = $typemap[$raw['type'][++$k]] ?: strtolower($raw['type'][$k]);
                        }
                    }

                    // read vcard 2.1 subtype
                    if (!$subtype) {
                        foreach ($raw as $k => $v) {
                            if (!is_numeric($k) && $v === true && ($k = strtolower($k))
                                && !in_array($k, array('pref','internet','voice','base64'))
                            ) {
                                $k_uc    = strtoupper($k);
                                $subtype = $typemap[$k_uc] ?: $k;
                                break;
                            }
                        }
                    }

                    // force subtype if none set
                    if (!$subtype && preg_match('/^(email|phone|address|website)/', $key)) {
                        $subtype = 'other';
                    }

                    if ($subtype) {
                        $key .= ':' . $subtype;
                    }

                    // split ADR values into assoc array
                    if ($tag == 'ADR') {
                        list(,, $value['street'], $value['locality'], $value['region'], $value['zipcode'], $value['country']) = $raw;
                        $out[$key][] = $value;
                    }
                    else {
                        $out[$key][] = $raw[0];
                    }
                }
                else {
                    $out[$col][] = $raw;
                }
            }
        }

        // handle special IM fields as used by Apple
        foreach ($this->immap as $tag => $type) {
            foreach ((array)$this->raw[$tag] as $i => $raw) {
                $out['im:'.$type][] = $raw[0];
            }
        }

        // copy photo data
        if ($this->raw['PHOTO']) {
            $out['photo'] = $this->raw['PHOTO'][0][0];
        }

        return $out;
    }
475956
public function getName()
    {
        $similarWords = [];
        $words = [];

        foreach ($this->_definitionSets as $definitionSet) {
            $word = $this->_getUniqueWord($definitionSet, $similarWords);
            $words[] = $word['word'];
            $similarWords[] = $word['word'];
            $similarWords = array_merge($similarWords, $word['similarWords']);
        }

        return implode(' ', $words);
    }
102499
public function getNames()
    {
        $names = array_keys($this->getServices());
        $len = strlen(self::METHOD_PREFIX);
        foreach (get_class_methods($this) as $method) {
            if (Text::startsWith($method, self::METHOD_PREFIX)) {
                $name = lcfirst(substr($method, $len));
                if ($name) {
                    $names[] = $name;
                }
            }
        }
        return $names;
    }
426577
public function commonItems()
    {
        return array_intersect(array_keys($this->input->getColumnsInfo()),
            array_keys($this->output->getColumnsInfo()));
    }
735775
public function getName()
    {
        $tableName = '';
        if ($this->hasSchema()) {
            $tableName = $this->guessSchemaName() . $this->database->getSchemaDelimiter();
        }

        $tableName .= $this->commonName;

        return $tableName;
    }
235681
public function getNormalizedName()
    {
        if ($this->normalizedName === null) {
            $this->normalizedName = implode('_', $this->getAncestorsNames());
        }
        return $this->normalizedName;
    }
1130540
private SortedMap<String, SortedSet<String>> findNamesPerSurname(
            final String surname) {
        if (surnameIndex.containsKey(surname)) {
            return surnameIndex.get(surname);
        }
        final SortedMap<String, SortedSet<String>> namesPerSurname =
                new TreeMap<String, SortedSet<String>>();
        surnameIndex.put(surname, namesPerSurname);
        return namesPerSurname;
    }
28635
protected function getEntityNamePlural()
    {
        $name = $this->getEntityNameSingular();
        $nameParts = Text::camelCaseToSeparator($name, '#');
        $nameParts = explode('#', $nameParts);
        $lastPart = array_pop($nameParts);
        $lastPart = ucfirst(Text::plural(strtolower($lastPart)));
        array_push($nameParts, $lastPart);
        return lcfirst(implode('', $nameParts));
    }
81601
public function getLastName()
    {
        $lastname = '';
        if (!empty($this->_gemsData['grs_surname_prefix'])) {
            $lastname .= $this->_gemsData['grs_surname_prefix'] . ' ';
        }
        $lastname .= $this->_gemsData['grs_last_name'];
        return $lastname;
    }
884808
protected function getNamePrecision()
    {
        $snakeParentModelName = snake_case($this->parentModel->getName());

        $recognizedForeignKeyNames = [
            $snakeParentModelName.'_id',
            'id_'.$snakeParentModelName,
        ];

        foreach ($recognizedForeignKeyNames as $recognizedName) {
            if ($this->foreignKey === $recognizedName) {
                return '';
            }
        }

        return 'Via'.studly_case($this->foreignKey);
    }
158998
protected function getNamePrecision()
    {
        $snakeParentModelName = snake_case($this->parentModel->getName());
        $snakeRelatedModelName = snake_case($this->relatedModel->getName());

        $recognizedPivotTableNames = [
            $snakeParentModelName.'_has_'.$this->relatedModel->getTable(),
            $snakeRelatedModelName.'_has_'.$this->parentModel->getTable(),
            $snakeParentModelName.'_'.$snakeRelatedModelName,
            $snakeRelatedModelName.'_'.$snakeParentModelName,
        ];

        foreach ($recognizedPivotTableNames as $recognizedName) {
            if ($this->pivotTable === $recognizedName) {
                return '';
            }
        }

        return 'Via'.studly_case($this->pivotTable);
    }
184541
protected function getLineages() {		
        $builder = new LineageBuilder($this->surname, Globals::getTree());
		$lineages = $builder->buildLineages();
		
    	return $lineages;
    }