eprints / irstats2

Development repository for the EPrints statistical tools
6 stars 13 forks source link

Double-barrelled names #6

Closed sebastfr closed 7 years ago

sebastfr commented 11 years ago
If a name contains a hyphen like “Hans-ulrich” the name part after the hyphen is changed to lower case.

Probably because names are normalised for display and double-barrelled names are not in the regexp. TODO...

sebastfr commented 10 years ago

Also, as reported by Matt @USQ:

Top Authors grid, within the default ‘main’ report displays first letter capitalised for given and family, Ignoring Initials etc,.

graingert commented 10 years ago

http://search.cpan.org/~kimryan/Lingua-EN-NameParse-1.32/lib/Lingua/EN/NameParse.pm

jiadiyao commented 10 years ago

The following solution renders the author names as the one stored in the creator's field:

In Sets.pm sub normalise_name
Change:

return EPrints::Utils::is_set( $g ) ? (ucfirst( lc( $f ) ) ).", ".ucfirst( lc( $g ) ) : ucfirst( lc( $f ) );

to return EPrints::Utils::is_set( $g ) ? (ucfirst( lc( $f ) ) ).", ".$g: ucfirst( lc( $f ) );

This removes the deliberate action of lower casing the tail part of the given name.

Names with two initials, e.g. Hooper, TJ would not rendered as Hooper, Tj

sebastfr commented 10 years ago

From Christian / ep-tech:

The patch only deals with given names:

Before applying the patch Martínez robles, Juan pablo

After Martínez robles, Juan Pablo

sebastfr commented 10 years ago

Following graingert's suggestion, there's also http://search.cpan.org/~summer/Lingua-EN-NameCase-1.15/NameCase.pm (ubuntu: sudo apt-get install liblingua-en-namecase-perl)

Sets.pm - line 9: use Lingua::EN::NameCase qw( nc );

Sets.pm - line 433: return nc( "$f, $g" );

Then re-generate the stats' sets (bin/stats/process_stats --sets-only --verbose) and probably restart Apache.