Skip to content

Commit

Permalink
Played with https://github.com/kuerbis/Term-Choose but it only takes …
Browse files Browse the repository at this point in the history
…strings not objects
  • Loading branch information
nigelhorne committed Nov 4, 2024
1 parent f2385d6 commit 1a848c3
Showing 1 changed file with 27 additions and 9 deletions.
36 changes: 27 additions & 9 deletions gedcom
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ my %all_occupations;

my $ged = Gedcom->new(gedcom_file => $ARGV[0], read_only => 1);
my $nameparser = Lingua::EN::NameParse->new(extended_titles => 1, initials => 1);
if($opts{h}) {

if($opts{'h'}) {
my @rc = $ged->get_individual($opts{h});
if(scalar(@rc) == 0) {
die "$0: Can't find '$opts{h}' in $ARGV[0]";
Expand All @@ -216,6 +217,9 @@ if($opts{h}) {
# Need top of family tree
@rc = map { ($_->father() || $_->mother()) ? () : $_ } @rc;
if(scalar(@rc) > 1) {
# @rc = map { $_->as_string({ include_years => 1, middle_names => 1 }) } @rc;
# $me = Term::Choose::choose(\@rc, { prompt => "More than one $opts{h} found - choose one" });

my $i;
do {
$i = 0;
Expand Down Expand Up @@ -5403,22 +5407,27 @@ sub print_person
}
$living_alone = 0;
} elsif($father_date && (datecmp($rdate, $father_date) > 0)) {
$residencestring .= ' (the same place as ' .
($person->pronoun() eq 'She' ? 'her' : 'his');
if($language eq 'French') {
$residencestring .= " (le m\N{U+00EA}me endoite que";
} else {
$residencestring .= ' (the same place as ' .
($person->pronoun() eq 'She' ? 'her' : 'his');
}
if($mother_date && (datecmp($father_date, $mother_date) == 0)) {
$residencestring .= ' ses' if($language eq 'French');
$residencestring .= i18n(' parents ');
$printed_mother_same_place = 1;
} else {
$residencestring .= i18n(' father ');
}
if(datecmp($rdate, $father_date) > 0) {
$residencestring .= 'had been';
$residencestring .= i18n('had been');
} elsif($printed_mother_same_place) {
$residencestring .= 'were';
} else {
$residencestring .= 'was';
}
$residencestring .= ' living ' .
$residencestring .= i18n(' living ') .
year({ person => $person, string => $father_date }) .
')';
$printed_father_same_place = 1;
Expand Down Expand Up @@ -5962,7 +5971,11 @@ sub print_person
}
}

$phrase->set('Throughout ' . lc($person->possessive()) . ' life');
if($language eq 'French') {
$phrase->set('Pendant sa vie');
} else {
$phrase->set('Throughout ' . lc($person->possessive()) . ' life');
}
} else {
$phrase->set(ucfirst(i18n('during %s life', lc($person->possessive()))));
}
Expand Down Expand Up @@ -6003,7 +6016,7 @@ sub print_person
$s .= i18n(' has lived');
}
} else {
$s .= ' lived';
$s .= i18n(' lived');
}
} else {
if($all_in_county) {
Expand All @@ -6014,7 +6027,7 @@ sub print_person
if(is_alive($person) && !$first->date()) {
$s .= 'has ';
}
$s .= 'lived in several places';
$s .= i18n('lived in several places');
if($all_in_county) {
$s .= ' around the county';
@residencestringarray = map { if($_ =~ /(.+),\s*$all_in_county ([io]n .+)/) { "$1 $2" } else { $_ } } @residencestringarray;
Expand Down Expand Up @@ -13352,7 +13365,6 @@ sub twins
sub person_in_residence_record
{
my $params = get_params(undef, @_);
my %params;

my $person = $params->{'person'};
my $date = $params->{'date'};
Expand Down Expand Up @@ -14137,6 +14149,7 @@ grandfather::grandfather
grandmother::grandmother
great-grandchildren::great-grandchildren
had::had
had been::had been
has been married::has been married
has had::has had
has lived::has lived
Expand All @@ -14149,6 +14162,8 @@ is buried::is buried
is married to::is married to
later that same year::later that same year
lived::lived
lived in several places::lived in several places
living::living
living person::living person
married::married
mother::mother
Expand Down Expand Up @@ -14226,6 +14241,7 @@ following the death of::suite au mort de
from::de
has had::a eu
had::a eu
had been::avait été
has been married:M:a été marrié
has been married:F:a été marriée
has lived::a habité
Expand All @@ -14240,6 +14256,8 @@ is married to:M:est marié à
is married to:F:est mariée à
later that same year::plus tard la même année
lived::habitait
lived in several places::habitait dans plusiers lieux
living::vécu
living person::vivant
married::a marié
mother::mère
Expand Down

0 comments on commit 1a848c3

Please sign in to comment.