Skip to content

Commit

Permalink
Explicitly annotate non-person etymology
Browse files Browse the repository at this point in the history
Setting gender to '-' instead of null when there is an etymology, but
person==False, allows to render it differently from completely missing
etymology.
  • Loading branch information
eginhard committed Mar 19, 2024
1 parent 9848ac3 commit 19c7405
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Command/GeoJSONCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ private function createProperties($object, array &$warnings = []): Properties
$_person = array_unique(array_column($detailsEtymology, 'person'));
$_gender = array_unique(array_column($detailsEtymology, 'gender'));

$genderEtymology = (count($_person) === 1 && current($_person) === true) ? (count($_gender) === 1 ? current($_gender) : '+') : false;
$genderEtymology = (count($_person) === 1 && current($_person) === true) ? (count($_gender) === 1 ? current($_gender) : '+') : '-';

if (count($detailsEtymology) === 1) {
$detailsEtymology = current($detailsEtymology);
Expand Down Expand Up @@ -433,7 +433,7 @@ private function createProperties($object, array &$warnings = []): Properties
$_person = array_unique(array_column($detailsWikidata, 'person'));
$_gender = array_unique(array_column($detailsWikidata, 'gender'));

$genderWikidata = (count($_person) === 1 && current($_person) === true) ? (count($_gender) === 1 ? current($_gender) : '+') : false;
$genderWikidata = (count($_person) === 1 && current($_person) === true) ? (count($_gender) === 1 ? current($_gender) : '+') : '-';

if (count($detailsWikidata) === 1) {
$detailsWikidata = current($detailsWikidata);
Expand Down

0 comments on commit 19c7405

Please sign in to comment.