surname prefix in names history

Report related issues - how to write them, what's needed, users need them, contributors write them

surname prefix in names history

Postby jo pol » Tue Sep 23, 2008 16:14:44

I really like the statistical report with names in history. But the last name of my family used to have a prefix which got lost somewhere in time. Now these variants are considered as different names and appear with different colours in the digram at different locations. I'd rather consider them as one or at least show them next to one another.

At first sight I see at least the following solutions.
1) stick to the surname part of INDI:NAME and (optionally?) drop lower case words at the head or move them to the tail.
2) use INDI:NAME:SURN if available, otherwise use the whole surname part of INDI:NAME

In general these prefixes are a problem, because when it comes to sorting, the prefix should be placed after the first name. A name like "Jan de Vries" would appear in the telephone directory as "Vries, Jan de". For this report of last names that would become "Vries, de". As the report shows the names sorted alphabetically that would satisfy me. So I guess the best (most generic) solution would be option one.

If I'm not overlooking things the ...LastNames... methods of class PropertyName currently are only used for this report. So currently I suppose I wouldn't destroy other things when adjusting these methods. Maybe the prefix-treatment should become an option, a global option as I would want that option for the table view too, or wherever last names are sorted. Maybe the global option is getting off-topic.

Any other thoughts/suggestions/hints?
jo pol
 
Posts: 141
Joined: Sun Sep 07, 2008 3:03:05

Postby island » Wed Sep 24, 2008 16:00:56

According to what you said, option 1 could be branched on option 1 ? If INDI:NAME:SURN is not available, then you stick to the surname part of INDI:NAME.
About your example, "Vries, de", is good for me too, but I would not vote for the fact you want to drop to lower case everything between the last name and the first name.
Now, for the method, I agree with this prefix-treatment to become a global option, but I would like to see the Options Menu to be splitted into several sub-menus, to make it easier to navigate in it. My two euro cents. Francois
Ancestris Genealogy program: http://www.ancestris.org
http://www.ancestris.org/ancestris_users/ancestris_localisation_utilisateurs_en.html
User avatar
island
 
Posts: 505
Joined: Sat Feb 28, 2004 16:07:30
Location: Ile de Groix, France

Postby nmeier » Wed Sep 24, 2008 23:15:46

Hi Jo Pol, Francois

I agree - letting the prefix affect the result seems wrong.

PropertyName.getLastName() is actually used elsewhere - what we could do is to add a parameter PropertyName.getLastName(boolean stripPrefixes) and as suggested make ignoring those prefixes an option for the report names in history (as usual a setting on the 2nd tab of the report).

For the table view we'd have to adjust the PropertyName.compareTo() method - I think we could safely ignore prefixes alltogether there.

Using INDI:NAME:SURN is fine with me too - wouldn't users enter the full name like this though making SURN not better to use?

INDI
1 NAME Johan /de Vries/
2 SURN de Vries

Cheers
Nils
User avatar
nmeier
Site Admin
 
Posts: 2143
Joined: Mon Feb 02, 2004 21:35:23
Location: Toronto, Canada

Postby jo pol » Sun Sep 28, 2008 6:43:30

A boolean is not sufficient. In the digram you might want to ignore, in other cases (when sorting or for indexes of names) you want another presentation. Including the first name in our country we would address someone as "Peter de Vries" but have him in the telephone directory as "Vries, Peter de". I know the Dutch-speaking Belgians have a different use of capitals: "Peter De Vries". I don't know how they sort. So I'm afraid we are wandering off to complex localisation.

Being impatient I already started to implement a first step just for the names history (just waiting to hear if the patch problem is really solved). I'm tempted to use an enum as argument which requires upgrade to at least Java 5 which causes tons of warnings.
jo pol
 
Posts: 141
Joined: Sun Sep 07, 2008 3:03:05

Postby jo pol » Tue Sep 30, 2008 1:57:30

Hi Nils

As I need to pay more attention again to other things in life, I only implemented the desired option for the name history report. No hurt feelings if you don't want the PropertyName class in this state. In that case please do apply the Dutch version of existing properties.

This time I only did the new English and all Dutch properties.

Code: Select all
oops something went wrong
jo pol
 
Posts: 141
Joined: Sun Sep 07, 2008 3:03:05

Postby jo pol » Tue Sep 30, 2008 2:38:25

next attempt
Code: Select all
### Eclipse Workspace Patch 1.0
#P GenJapp
Index: src/report/ReportNameHistory.java
===================================================================
RCS file: /cvsroot/genj/dev/app/src/report/ReportNameHistory.java,v
retrieving revision 1.18
diff -u -r1.18 ReportNameHistory.java
--- src/report/ReportNameHistory.java   5 Apr 2006 07:39:40 -0000   1.18
+++ src/report/ReportNameHistory.java   30 Sep 2008 06:39:54 -0000
@@ -27,6 +27,15 @@
  */
 public class ReportNameHistory extends Report {
 
+  /** how to treat a lower case prefix of the last name (such as "van der")  */
+  public int prefixPresentation = PropertyName.PREFIX_AS_IS;
+  public String[] prefixPresentations = {
+          // TODO use enum in PropertyName (when implemented) for the string constants   
+          translate("prefixAsIs"),
+          translate("prefixLast"),
+          translate("prefixIgnore")
+  };

   /** whether to group non-considered names */
   public boolean makeGroupOther = false;
 
@@ -138,7 +147,7 @@
      PropertyName name = (PropertyName)indi.getProperty("NAME");
      if (name==null||!name.isValid())
        return;
-     String last = name.getLastName();
+     String last = name.getLastName(prefixPresentation);
      if (last.length()==0)
        return;
 
Index: src/report/ReportNameHistory.properties
===================================================================
RCS file: /cvsroot/genj/dev/app/src/report/ReportNameHistory.properties,v
retrieving revision 1.18
diff -u -r1.18 ReportNameHistory.properties
--- src/report/ReportNameHistory.properties   22 Feb 2008 14:14:36 -0000   1.18
+++ src/report/ReportNameHistory.properties   30 Sep 2008 06:39:54 -0000
@@ -7,25 +7,36 @@
 #     - German
 #     - French
 #     - Polish
+#     - Dutch
 #
 
 
 author   = Nils Meier
 version  = 1.0
-updated  = 13 MAY 2006
+updated  = 28 MAY 2008 by Jo Pol (new prefix option)
 category = Statistics
 
 name    = Names in History
 name.de = Namensgeschichte
 name.fr = Utilisation des Noms de Famille
 name.pl = Nazwiska w historii
+name.nl = Geschiedenis van namen
 
 info    = <h1><center>Names in History</center></h1>
  Shows the history of family names along the timeline of a Gedcom file.<br>
+ <em>Notes on the options:</em>
+ <ul><li>a too small percentage makes calculation impossible.</li>
+ <li>even if surname prefixes should be ignored, percentages will be calculated over the original name.
+ For example: if "van Veen" and "van der Veen" each have a frequency of 1.5%
+ and the threshold is set to 2%, the name "Veen" won't show up.
+ </li>
+ <li>prefixes are only ignored if spelled in lower case</li>
+ </ul>
  <center>
  <img src="ReportNameHistorySample.gif"><br>
  </center>
  <br>
+
 info.de = <h1><center>Namensgeschichte</center></h1>
  Zeigt die Historie von Familiennamen im Zeitverlauf einer
  Gedcom Datei an.<br>
@@ -33,6 +44,22 @@
  <img src="ReportNameHistorySample.gif"><br>
  </center>
  <br>
+
+
+info.nl = <h1><center>Geschiedenis van namen</center></h1>
+ <p>Toont het gebruik van achternamen op een tijdlijn over de periode van het gedcom bestand.</p>
+ <em>Let op bij de opties:</em>
+ <ul><li>een te klein percentage kan het berekenen van de grafiek ondoenlijk maken.</li>
+ <li>indien tussenvoegsels genegeerd worden, worden de percentage toch berekend over de originele naam.
+ Stel "van Veen" en "van der Veen" hebben elk een frequentie van 1,5%.
+ Als de drempel is ingesteld op 2%, dan wordt "Veen" toch niet in de grafiek getoond.
+ </li>
+ <li>tussenvoegsels worden (indien gewenst) alleen genegeerd voor zover gespeld met kleine letters</li>
+ </ul>
+ <center>
+ <img src="ReportNameHistorySample.gif"><br>
+ </center>
+
 info.fr = <h1><center>Utilisation des Noms de Famille</center></h1>
  <div style="margin-left: 5px; text-align:justify;
  margin-right: 10px; font-style: normal; color: #000000">
@@ -72,31 +99,49 @@
 title.de = Namensgeschichte
 title.fr = Usage des Noms pour la Période couverte
 title.pl = Nazwiska w historii
+title.nl = Geschiedenis van namen
 
 yaxis    = Individuals per Year
 yaxis.de = Personen pro Jahr
 yaxis.fr = Nbre de Personnes par Année
 yaxis.pl = liczba osób / rok
+yaxis.nl = personen per jaar
 
 makeGroupOther    = One visible group for all non-considered names
 makeGroupOther.de = Eine sichtbare Gruppe fuer alle nicht beruecksichtigten Namen
 makeGroupOther.fr = Mettre dans un groupe tous les noms qui n'ont pas été pris en compte
 makeGroupOther.pl = Wyświetl osobną grupę dla rzadko występujących nazwisk
+makeGroupOther.nl = Eén zichtbare groep voor de uitgesloten namen
 
 lifespanWithoutDEAT    = Age at death for individuals without date of death
 lifespanWithoutDEAT.de = Alter beim Tod fuer Personen ohne Todesdatum
 lifespanWithoutDEAT.fr = Age de décès choisi, pour les personnes n'ayant pas leur date de décès d'indiquée
 lifespanWithoutDEAT.pl = Długość życia osób bez podanej daty śmierci
+lifespanWithoutDEAT.nl = Leeftijd bij overlijden
 
 minUseOfName    = Minimum use of last-name in Gedcom file to be considered (%)
 minUseOfName.de = Minimale Praesenz fuer beruecksichtigte Nachnahmen in Gedcom file (%)
 minUseOfName.fr = Utilisation minimum d'un Nom dans votre fichier Gedcom pour devoir être prise en considération (%)
 minUseOfName.pl = Wyświetl nazwiska, które pojawiają się nie rzadziej niż w (%)
+minUseOfName.nl = Minimum frequentie van de achternaam die getoond worden (%)
 
 others    = {0} Other Names
 others.de = {0} andere Namen
 others.fr = {0} Autres Noms
 others.pl = Inne nazwiska ({0})
+others.nl = {0} andere Namen
+
+prefixPresentation = Presentation of prefixes (such as: van der) of last names
+prefixPresentation.nl = Presentatie van tussenvoegsels (zoals: van der) van achternamen
+
+prefixAsIs = as is (de Vries)
+prefixAsIs.nl = als ingevoerd (de Vries)
+
+prefixIgnore = ignore (Vries)
+prefixIgnore.nl = negeren (Vries)
+
+prefixLast = last (Vries, de)
+prefixLast.nl = achteraan (Vries, de)
 
 # End of File
 
Index: src/core/genj/gedcom/PropertyName.java
===================================================================
RCS file: /cvsroot/genj/dev/app/src/core/genj/gedcom/PropertyName.java,v
retrieving revision 1.51
diff -u -r1.51 PropertyName.java
--- src/core/genj/gedcom/PropertyName.java   21 Nov 2007 21:06:24 -0000   1.51
+++ src/core/genj/gedcom/PropertyName.java   30 Sep 2008 06:39:54 -0000
@@ -31,6 +31,12 @@
  */
 public class PropertyName extends Property {
   
+  // TODO change to enum when migrating to java 5
+  // and apply at least to getSameLastNames and getLastNameCount
+  public static final int PREFIX_AS_IS = 0;
+  public static final int PREFIX_LAST = 1;
+  public static final int IGNORE_PREFIX = 2;
+
   public final static String TAG =  "NAME";
   
   private final static String
@@ -131,6 +137,32 @@
   }
 
   /**
+   * @param prefixPresentation
+   * @return 'de Vries' in case of PREFIX_AS_IS.
+   *         'Vries' in case of IGNORE_PREFIX.
+   *         'Vries, de' in case of PREFIX_LAST.
+   */
+  public String getLastName(int prefixPresentation) {
+   
+    if (prefixPresentation == PropertyName.PREFIX_AS_IS)
+      return lastName;
+   
+    String last = lastName.replaceFirst("^[a-z ]*", "");
+    last = last.replaceFirst("-", "");
+   
+    if (prefixPresentation == PropertyName.IGNORE_PREFIX) {
+      last = last.replaceFirst("Hengevel[dt]", "Hengeveld/t");
+      return last;
+    }
+   
+    int diff = lastName.length() - last.length();
+    if ( diff > 0 ) {
+      last = last + ", "+ lastName.subSequence(0, diff);
+    }
+    return last;
+  }
+
+  /**
    * the suffix
    */
   public String getSuffix() {
jo pol
 
Posts: 141
Joined: Sun Sep 07, 2008 3:03:05


Return to Dev - Report Writing

Who is online

Users browsing this forum: No registered users and 0 guests