Generate the likely value of this census column, based on available information.

@param Individual $individual
@param Individual $head

@return string
969202
public function generate(Individual $individual, Individual $head): string
    {
        $family = $this->spouseFamily($individual);
        $sex    = $individual->sex();

        if ($family === null || $family->facts(['MARR'])->isEmpty()) {
            if ($this->isChild($individual)) {
                return $this->conditionChild($sex);
            }

            return $this->conditionSingle($sex);
        }

        if ($family->facts(['DIV'])->isNotEmpty()) {
            return $this->conditionDivorced($sex);
        }

        $spouse = $family->spouse($individual);
        if ($spouse instanceof Individual && $this->isDead($spouse)) {
            return $this->conditionWidowed($sex);
        }

        return $this->conditionMarried($sex);
    }
317370
public function getCurrentSpouse(): ?Individual
    {
        $family = $this->spouseFamilies()->last();

        if ($family instanceof Family) {
            return $family->spouse($this);
        }

        return null;
    }
82866
public function generate(Individual $individual, Individual $head): string
    {
        return $this->lastPartOfPlace(parent::generate($individual, $head));
    }
939935
public function generate(Individual $individual, Individual $head): string
    {
        if ($individual->getBirthDate()->isOK()) {
            foreach ($individual->spouseFamilies() as $family) {
                foreach ($family->facts(['MARR'], true) as $fact) {
                    if ($fact->date()->isOK()) {
                        return (string) Date::getAgeYears($individual->getBirthDate(), $fact->date());
                    }
                }
            }
        }

        return '';
    }
493383
public function getReportMenu(Individual $individual): Menu
    {
        return new Menu(
            $this->title(),
            route('report-setup', [
                'xref'   => $individual->xref(),
                'ged'    => $individual->tree()->name(),
                'report' => $this->name(),
            ]),
            'menu-report-' . $this->name(),
            ['rel' => 'nofollow']
        );
    }
1293575
private function getMapData(Individual $indi): stdClass
    {
        $facts = $this->getPersonalFacts($indi);

        $geojson = [
            'type'     => 'FeatureCollection',
            'features' => [],
        ];

        foreach ($facts as $id => $fact) {
            $location = new Location($fact->place()->gedcomName());

            // Use the co-ordinates from the fact (if they exist).
            $latitude  = $fact->latitude();
            $longitude = $fact->longitude();

            // Use the co-ordinates from the location otherwise.
            if ($latitude === 0.0 && $longitude === 0.0) {
                $latitude  = $location->latitude();
                $longitude = $location->longitude();
            }

            $icon = self::ICONS[$fact->getTag()] ?? self::DEFAULT_ICON;

            if ($latitude !== 0.0 || $longitude !== 0.0) {
                $geojson['features'][] = [
                    'type'       => 'Feature',
                    'id'         => $id,
                    'valid'      => true,
                    'geometry'   => [
                        'type'        => 'Point',
                        'coordinates' => [$longitude, $latitude],
                    ],
                    'properties' => [
                        'polyline' => null,
                        'icon'     => $icon,
                        'tooltip'  => strip_tags($fact->place()->fullName()),
                        'summary'  => view('modules/places/event-sidebar', $this->summaryData($indi, $fact)),
                        'zoom'     => $location->zoom(),
                    ],
                ];
            }
        }

        return (object) $geojson;
    }
988820
public function spouse(Individual $person, $access_level = null): ?Individual
    {
        if ($person === $this->wife) {
            return $this->husband($access_level);
        }

        return $this->wife($access_level);
    }
435510
public function mother(Individual $individual): ?Individual
    {
        $family = $individual->primaryChildFamily();

        if ($family) {
            return $family->wife();
        }

        return null;
    }
1238476
private function associateFacts(Individual $person): array
    {
        $facts = [];

        /** @var Individual[] $associates */
        $associates = array_merge(
            $person->linkedIndividuals('ASSO'),
            $person->linkedIndividuals('_ASSO'),
            $person->linkedFamilies('ASSO'),
            $person->linkedFamilies('_ASSO')
        );
        foreach ($associates as $associate) {
            foreach ($associate->facts() as $fact) {
                $arec = $fact->attribute('_ASSO');
                if (!$arec) {
                    $arec = $fact->attribute('ASSO');
                }
                if ($arec && trim($arec, '@') === $person->xref()) {
                    // Extract the important details from the fact
                    $factrec = '1 ' . $fact->getTag();
                    if (preg_match('/\n2 DATE .*/', $fact->gedcom(), $match)) {
                        $factrec .= $match[0];
                    }
                    if (preg_match('/\n2 PLAC .*/', $fact->gedcom(), $match)) {
                        $factrec .= $match[0];
                    }
                    if ($associate instanceof Family) {
                        foreach ($associate->spouses() as $spouse) {
                            $factrec .= "\n2 _ASSO @" . $spouse->xref() . '@';
                        }
                    } else {
                        $factrec .= "\n2 _ASSO @" . $associate->xref() . '@';
                    }
                    $facts[] = new Fact($factrec, $associate, 'asso');
                }
            }
        }

        return $facts;
    }
880517
public function father(Individual $individual): ?Individual
    {
        $family = $individual->primaryChildFamily();

        if ($family) {
            return $family->husband();
        }

        return null;
    }
917231
public function getSidebarContent(Individual $individual): string
    {
        ob_start();

        foreach ($individual->facts(static::HANDLED_FACTS) as $fact) {
            FunctionsPrintFacts::printFact($fact, $individual);
        }

        $html = ob_get_clean();

        return strip_tags($html, '<a><div><span>');
    }
697746
public function generate(Individual $individual, Individual $head): string
    {
        $birth_place  = $individual->getBirthPlace()->gedcomName();
        $census_place = $this->place();

        // Ignore the census country
        if ($birth_place === $census_place) {
            return '';
        }

        if (substr($birth_place, -strlen($census_place) - 2) === ', ' . $census_place) {
            return substr($birth_place, 0, -strlen($census_place) - 2);
        }

        return $birth_place;
    }
729673
public function getSidebars(Individual $individual): Collection
    {
        return $this->module_service->findByComponent(ModuleSidebarInterface::class, $individual->tree(), Auth::user())
            ->filter(static function (ModuleSidebarInterface $sidebar) use ($individual): bool {
                return $sidebar->hasSidebarContent($individual);
            });
    }
1136243
public function generate(Individual $individual, Individual $head): string
    {
        $name = $this->nameAtCensusDate($individual, $this->date());

        return strip_tags($name['full']);
    }
497225
public static function getCloseRelationshipName(Individual $individual1, Individual $individual2): string
    {
        if ($individual1 === $individual2) {
            return self::reflexivePronoun($individual1);
        }

        try {
            $relationship = self::getRelationship($individual1, $individual2);

            return self::getRelationshipName($relationship);
        } catch (Exception $ex) {
            return '';
        }
    }
266446
public function generate(Individual $individual, Individual $head): string
    {
        $birth_jd  = $individual->getBirthDate()->julianDay();
        $census_jd = $this->date()->julianDay();
        if ($birth_jd <= $census_jd && $birth_jd >= $census_jd - 365) {
            // Use the GEDCOM month, as we need this in English - for the US census
            return ucfirst(strtolower($individual->getBirthDate()->minimumDate()->format('%O')));
        }

        return '';
    }
1224745
public function getTabs(Individual $individual): Collection
    {
        return $this->module_service->findByComponent(ModuleTabInterface::class, $individual->tree(), Auth::user())
            ->filter(static function (ModuleTabInterface $tab) use ($individual): bool {
                return $tab->hasTabContent($individual);
            });
    }