Skip to content

Commit

Permalink
Don't include 'at school' as an occupation
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Aug 21, 2024
1 parent 331176c commit 79c23de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
16 changes: 5 additions & 11 deletions gedcom
Original file line number Diff line number Diff line change
Expand Up @@ -11221,17 +11221,8 @@ sub get_all_residences
# TODO: railway/railroad = le chemin de fer
sub get_all_occupations
{
my %params;

if(ref($_[0]) eq 'HASH') {
%params = %{$_[0]};
} elsif(scalar(@_) % 2 == 0) {
%params = @_;
} else {
$params{'person'} = shift;
}

my $person = $params{'person'};
my $params = get_params('person', @_);
my $person = $params->{'person'};

die 'Usage: get_all_occupations($person)' unless($person);

Expand Down Expand Up @@ -11259,6 +11250,9 @@ sub get_all_occupations
while($occupations[0] && ($occupations[0] eq 'Retired')) {
shift @occupations;
}
while($occupations[0] && ($occupations[0] eq 'At School')) {
shift @occupations;
}

while(scalar(@occupations) > 1) {
if(($occupations[0] =~ /^labou?rer/i) && ($occupations[1] =~ /^labou?rer/i)) {
Expand Down
1 change: 1 addition & 0 deletions tests/runtest
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ unset HTTP_PROXY

LANG=en_GB ./gedcom -dlh 'Nigel Horne' "$*" | grep --colour ' '
LANG=en_GB ./gedcom -dlh 'Nigel Horne' "$*" | egrep --colour '\. [A-Z]'
LANG=en_GB ./gedcom -dlh 'Nigel Horne' "$*" | egrep --colour -i 'and\s?$'
./gedcom -dlh 'Nigel Horne' "$*" | spell 2>&1 | egrep -v '^[A-Z]' | less
LANG=fr_FR ./gedcom -dlh 'Nigel Horne' "$*" | egrep --colour -i "\ss?he\s"
LANG=de_DE ./gedcom -dlh 'Nigel Horne' "$*" | egrep --colour -i "\ss?he\s"
Expand Down

0 comments on commit 79c23de

Please sign in to comment.