Update of /cvsroot/genj/dev/src/report
In directory sc8-pr-cvs1:/tmp/cvs-serv27037/src/report
Modified Files:
ReportGedcomStatistics.java ReportGedcomStatistics.properties
Log Message:
many extensions: categories, output of entities ==> see info in report view
Index: ReportGedcomStatistics.java
===================================================================
RCS file: /cvsroot/genj/dev/src/report/ReportGedcomStatistics.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** ReportGedcomStatistics.java 24 Sep 2003 20:09:17 -0000 1.28
--- ReportGedcomStatistics.java 29 Sep 2003 12:44:14 -0000 1.29
***************
*** 10,20 ****
--- 10,25 ----
import genj.gedcom.Gedcom;
import genj.gedcom.Indi;
+ import genj.gedcom.Fam;
import genj.gedcom.Property;
+ import genj.gedcom.PropertyDate;
import genj.gedcom.PropertySex;
import genj.gedcom.TagPath;
import genj.report.Report;
+ import genj.gedcom.PointInTime;
import genj.util.ReferenceSet;
import java.util.Iterator;
+ import java.util.ArrayList;
+ import java.text.NumberFormat;
/**
***************
*** 23,225 ****
* $Header$
* @author Francois Massonneau <fmas@...>
! * @version 1.1
*/
public class ReportGedcomStatistics extends Report {
!
! /**
! * A data object that contains the statistical data we gather
! */
! private static class Statistics {
! /**package*/ int numMales = 0;
! /**package*/ int numFemales = 0;
! /**package*/ int numUnknown = 0;
! /**package*/ ReferenceSet birthPlaces = new ReferenceSet();
! /**package*/ ReferenceSet deathPlaces = new ReferenceSet();
! }
!
! /** whether we sort places by their name or occurance */
! public boolean isSortByPlace = true;
!
! /** the place that is not known */
! // private final static String UNKNOWN_PLACE = "[unknown places]";
!
! /** this report's version */
! public static final String VERSION = "1.1";
!
! /**
! * Returns the version of this script
! */
! public String getVersion() {
! return VERSION;
! }
!
! /**
! * Returns the name of this report - should be localized.
! */
! public String getName() {
! return i18n("script_name");
! }
!
! /**
! * Some information about this report
! * @return Information as String
! */
! public String getInfo() {
! return i18n("script_info");
! }
!
! /**
! * Author
! */
! public String getAuthor() {
! return "Francois Massonneau <fmas@...>";
! }
!
! /**
! * This method actually starts this report
! */
! public void start(Object context) {
!
! // expecting only gedcom
! Gedcom gedcom = (Gedcom)context;
!
! // Here's the data object that we use while looking
! // at the statistical characteristics
! Statistics stats = new Statistics();
!
! // So we loop over the Individuals
! Entity[] es = gedcom.getEntities(gedcom.INDI, "");
! for (int e=0;e<es.length;e++) {
! analyzeIndividual((Indi)es[e], stats);
}
! // And report what we've found
! reportResults(gedcom, stats);
! // Done
! }
!
! /**
! * Analyzes an Individual for the Statistics
! */
! private void analyzeIndividual(Indi indi, Statistics stats) {
! analyzeIndividualSex(indi, stats);
! analyzeIndividualBirth(indi, stats);
! analyzeIndividualDeath(indi, stats);
! }
!
! /**
! * Analyzes an Individual's SEX
! */
! private void analyzeIndividualSex(Indi indi, Statistics stats) {
!
! // Here comes the Sex check
! int sex = indi.getSex();
! switch (indi.getSex()) {
! case PropertySex.MALE:
! stats.numMales++;
! break;
! case PropertySex.FEMALE:
! stats.numFemales++;
! break;
! default:
! stats.numUnknown++;
! break;
! }
! }
!
! /**
! * Analyzes an Individual's BIRTH
! */
! private void analyzeIndividualBirth(Indi indi, Statistics stats) {
!
! // And here comes the check for place
! Property prop = indi.getProperty(new TagPath("INDI:BIRT:PLAC"));
! if (prop==null) return;
! String place = prop.getValue();
! if (place.length()==0) place = i18n("unknown_places");
! // keep track
! stats.birthPlaces.add(place, prop);
!
! // Done
! }
!
! /**
! * Analyzes an Individual's DEATH
! */
! private void analyzeIndividualDeath(Indi indi, Statistics stats) {
!
! // We only look at individuals with a DEATH property
! Object deat = indi.getProperty("DEAT");
! if (deat==null) return;
!
! // And here comes the check for place
! String place = "";
! Property prop = indi.getProperty(new TagPath("INDI:DEAT:PLAC"));
! if (prop!=null) place = prop.getValue();
! if (place.length()==0) place = i18n("unknown_places");
!
! // keep track of that
! stats.deathPlaces.add(place, prop);
!
! // Done
! }
!
! /**
! * Reports the result of our information-gathering
! */
! private void reportResults(Gedcom gedcom, Statistics stats) {
!
! // Header :
! println(i18n("header",gedcom.getName()));
! println();
! println(" "+i18n("about_people"));
!
! // One: We show the number of families :
! println(" - "+
! i18n("families",gedcom.getEntities(Gedcom.FAM).size()));
!
! // Two: We show the number of individuals :
! println(" - "+ i18n("individuals",
! gedcom.getEntities(Gedcom.INDI).size()));
!
! // Three: We show the number of males :
! println(" . "+i18n("males",stats.numMales));
!
! // Four: We show the number of females :
! println(" . "+i18n("females",stats.numFemales));
!
! // Five: We show the number of people whose sex is undefined :
! println(" . "+i18n("sex_unknown",stats.numUnknown));
!
! println();
!
! // Six: We show the birth places
! println(" "+i18n("about_birthplaces"));
! Iterator births = stats.birthPlaces.getValues(isSortByPlace).iterator();
! while (births.hasNext()) {
! String place = (String)births.next();
! Integer count = new Integer(stats.birthPlaces.getCount(place));
! Object[] msgargs = {count,place};
! println(" - "+i18n("indi_born",msgargs));
}
!
! println("");
!
! // Seven: We show the death places
! println(" "+i18n("about_deathplaces"));
! Iterator deaths = stats.deathPlaces.getValues(isSortByPlace).iterator();
! while (deaths.hasNext()) {
! String place = (String)deaths.next();
! Integer count = new Integer(stats.deathPlaces.getCount(place));
! Object[] msgargs = {count,place};
! println(" - "+i18n("indi_died",msgargs));
}
! // Done
! }
!
! } //ReportGedcomStatistics
--- 28,618 ----
* $Header$
* @author Francois Massonneau <fmas@...>
! * @author Carsten Müssig <carsten.muessig@...>
! * @version 2.0
*/
public class ReportGedcomStatistics extends Report {
!
! /** number of digits allowed in the fraction portion of a number */
! public int fractionDigits = 2;
! /** if individuals should be analyzed */
! public boolean analyzeIndividuals = true;
! /** whether individuals with min. / max. age should be reported */
! public boolean reportIndiAge = true;
! /** if families should be analyzed */
! public boolean analyzeFamilies = true;
! /** whether families with min. / max. children should be reported */
! public boolean reportFamChildren = true;
! /** if birth places should be analyzed */
! public boolean analyzeBirthPlaces = true;
! /** if marriage places should be analyzed */
! public boolean analyzeMarriagePlaces = true;
! /** if death places should be analyzed */
! public boolean analyzeDeathPlaces = true;
! /** whether we sort places by name or freqeuncy */
! public boolean sortByName = true;
!
! /** to store data about individuals
! * (all, males, females, unknown gender, husbands, wifes)
! */
! private static class StatisticsIndividuals {
! /** number of individuals
! */
! int number = 0;
! /** number of individuals with age
! */
! int withAge = 0;
! /** individuals sorted by age
! */
! ReferenceSet age = new ReferenceSet();
! /** min. age of individuals
! */
! int minAge = Integer.MAX_VALUE;
! /** min. age of individuals
! */
! int maxAge = Integer.MIN_VALUE;
! /** age of individuals added up
! */
! int sumAge = 0;
}
! /** to store data about families
! */
! private static class StatisticsFamilies {
! /** statistics of husbands
! */
! StatisticsIndividuals husbands = new StatisticsIndividuals();
! /** statistics of wifes
! */
! StatisticsIndividuals wifes = new StatisticsIndividuals();
! /** number of families
! */
! int number = 0;
! /** number of families with children
! */
! int withChildren = 0;
! /** families sorted by number of children
! */
! ReferenceSet children = new ReferenceSet();
! /** min. number of children
! */
! int minChildren = 999;
! /** max. number of children
! */
! int maxChildren = 0;
! /** number of children added up
! */
! int sumChildren = 0;
! }
! /** to store data about places
! */
! private static class StatisticsPlaces {
! /** which places the statistic is about (BIRTH||DEATh||MARRIAGE)
! */
! int which = -1;
! /** number of known places
! */
! int knownPlaces = 0;
! /** places sorted by name
! */
! ReferenceSet places = new ReferenceSet();
! }
! /** constant for indidcating birth
! */
! public static final int BIRTH = 1;
! /** constant for indidcating marriage
! */
! public static final int MARRIAGE = 2;
! /** constant for indidcating death
! */
! public static final int DEATH = 3;
! /** this report's version */
! public static final String VERSION = "2.0";
! /** Returns the version of the report
! */
! public String getVersion() {
! return VERSION;
}
!
! /** Returns the name of this report - should be localized.
! */
! public String getName() {
! return i18n("name");
! }
!
! /**
! * Some information about this report
! * @return Information as String
! */
! public String getInfo() {
! return i18n("info");
! }
!
! /**
! * Author
! */
! public String getAuthor() {
! return "Francois Massonneau <fmas@...>, Carsten M\u00FCssig <carsten.muessig@...>";
! }
!
! public String accepts(Object context) {
! if (context instanceof Gedcom)
! return getName();
! return null;
}
+
+ /**
+ * This method actually starts this report
+ */
+ public void start(Object context) {
+
+ // stop report when no output categories choosen
+ if((analyzeIndividuals==false)&&(analyzeFamilies==false)&&(analyzeBirthPlaces==false)&&(analyzeMarriagePlaces==false)&&(analyzeDeathPlaces==false))
+ return;
+
+ Gedcom gedcom = (Gedcom)context;
+
+ // what to analyze
+ Entity[] indis = gedcom.getEntities(gedcom.INDI, "");
+ Entity[] fams = gedcom.getEntities(Gedcom.FAM,"");
+
+ // where to write the statistic data
+ StatisticsIndividuals all=null, males=null, females=null, unknown=null;
+ StatisticsFamilies families=null;
+ StatisticsPlaces births=null, marriages=null, deaths=null;
+
+ if(analyzeIndividuals) {
+ all = new StatisticsIndividuals();
+ all.number = indis.length;
+ males = new StatisticsIndividuals();
+ females = new StatisticsIndividuals();
+ unknown = new StatisticsIndividuals();
+ analyzeIndividuals(indis, all, males, females, unknown);
+ }
+
+ if(analyzeFamilies) {
+ families = new StatisticsFamilies();
+ families.number = fams.length;
+ analyzeFamilies(fams, families);
+ }
+ if(analyzeBirthPlaces) {
+ births = new StatisticsPlaces();
+ births.which = BIRTH;
+ analyzePlaces(indis, births);
+ }
+ if(analyzeMarriagePlaces) {
+ marriages = new StatisticsPlaces();
+ marriages.which = MARRIAGE;
+ analyzePlaces(fams, marriages);
+ }
+ if(analyzeDeathPlaces) {
+ deaths = new StatisticsPlaces();
+ deaths.which = DEATH;
+ analyzePlaces(indis, deaths);
+ }
+
+ // generate output
+ println(i18n("header",gedcom.getName()));
+ println();
+
+ if(analyzeIndividuals)
+ reportIndividuals(all, males, females, unknown);
+
+
+ if(analyzeFamilies)
+ reportFamilies(families);
+
+ if(analyzeBirthPlaces) {
+ println(" "+i18n("birthPlaces")+": "+new Integer(births.knownPlaces));
+ reportPlaces(births);
+ }
+ if(analyzeMarriagePlaces) {
+ println(" "+i18n("marriagePlaces")+": "+new Integer(marriages.knownPlaces));
+ reportPlaces(marriages);
+ }
+ if(analyzeDeathPlaces) {
+ println(" "+i18n("deathPlaces")+": "+new Integer(deaths.knownPlaces));
+ reportPlaces(deaths);
+ }
+ }
+
+ /** Calculates the age of a individual. Ranges are taken into
+ * consideration by getDelta(begin, end)/2.
+ * @param indi individual for the calculation
+ * @param end end date for age calculation
+ * @return int[] : [day, month, year] or null if <CODE>d</CODE> < <CODE>birth</CODE>
+ */
+ private int[] getAge(Indi indi, PropertyDate end) {
+
+ double[] age = null;
+ int[] zero = {0,0,0};
+ String[] months = PointInTime.getMonths(false, true);
+ PropertyDate birth = indi.getBirthDate();
+
+ // end date < birth date
+ if(end.compareTo(birth)<0)
+ return null;
+ // end date == birth date
+ if(end.compareTo(birth)==0)
+ return zero;
+
+ PointInTime newBirth = null;
+ PointInTime newEnd = null;
+
+ if(birth.isRange()) {
+ PointInTime a = birth.getStart(), b = birth.getEnd();
+ // calculateAverageAge return int[] = {year, month, day}
+ age = calculateAverageAge(a.getDay()+b.getDay()+a.getMonth()*30+b.getMonth()*30+a.getYear()*360+b.getYear()*360, 2);
+ newBirth = PointInTime.getPointInTime((int)age[2]+" "+months[(int)age[1]]+" "+(int)age[0]);
+ }
+ else
+ newBirth = birth.getStart();
+
+ if(end.isRange()) {
+ PointInTime a = end.getStart(), b = end.getEnd();
+ // calculateAverageAge return int[] = {year, month, day}
+ age = calculateAverageAge(a.getDay()+b.getDay()+a.getMonth()*30+b.getMonth()*30+a.getYear()*360+b.getYear()*360, 2);
+ newEnd = PointInTime.getPointInTime((int)age[2]+" "+months[(int)age[1]]+" "+(int)age[0]);
+ }
+ else
+ newEnd = end.getStart();
+
+ return PointInTime.getDelta(newBirth, newEnd);
+ }
+
+ /** Rounds a number to a specified number digits in the fraction portion
+ * @param number number to round
+ * @param digits number of digits allowed in the fraction portion of <CODE>number</CODE>
+ * @return the rounded number
+ */
+ private double roundNumber(double number, int digits) {
+
+ NumberFormat nf = NumberFormat.getInstance();
+ nf.setMinimumFractionDigits(digits);
+ nf.setMaximumFractionDigits(digits);
+ nf.setGroupingUsed(false);
+ return Double.parseDouble(nf.format(number).replace(',','.'));
+ }
+
+ /**
+ * @param e entities to analyze
+ * @param places to store results
+ */
+ private void analyzePlaces(Entity[] e, StatisticsPlaces places) {
+
+ for(int i=0;i<e.length;i++) {
+ Object o=null;
+ Property prop=null;
+
+ switch(places.which) {
+
+ case BIRTH:
+ prop = e[i].getProperty(new TagPath("INDI:BIRT:PLAC"));
+ break;
+
+ case DEATH:
+ o = e[i].getProperty("DEAT");
+ if (o!=null)
+ prop = e[i].getProperty(new TagPath("INDI:DEAT:PLAC"));
+ break;
+
+ case MARRIAGE:
+ o = e[i].getProperty("MARR");
+ if (o!=null)
+ prop = e[i].getProperty(new TagPath("FAM:MARR:PLAC"));
+ break;
+ }
+
+ if (prop!=null) {
+ String place = prop.getValue();
+ if (place.length()>0) {
+ //places.places.add(place, prop);
+ places.places.add(place, e[i]);
+ places.knownPlaces++;
+ }
+ }
+ }
+ }
+
+ /**
+ * @param indi individual to analyze
+ * @param age age of indi
+ * @param gender to store results of the indi
+ * @param all to store results of all indis
+ */
+ private void analyzeAge(Indi indi, int[] age, StatisticsIndividuals gender, StatisticsIndividuals all) {
+
+ int a = age[0]*360+age[1]*30+age[2];
+ if(all!=null) {
+ all.withAge++;
+ all.age.add(new Integer(a),indi);
+ all.sumAge=all.sumAge+a;
+ if(a>all.maxAge)
+ all.maxAge=a;
+
+ if(a<all.minAge)
+ all.minAge=a;
+ }
+
+ gender.withAge++;
+ gender.age.add(new Integer(a),indi);
+ gender.sumAge=gender.sumAge+a;
+
+ if(a>gender.maxAge)
+ gender.maxAge=a;
+
+ if(a<gender.minAge)
+ gender.minAge=a;
+ }
+
+ /** Analyzes the individuals
+ * @param all to store results for all
+ * @param males to store results for males
+ * @param females to store results for females
+ * @param unknown to store results for unknown
+ * @param e array with individuals
+ */
+ private void analyzeIndividuals(Entity[] e,StatisticsIndividuals all,StatisticsIndividuals males,StatisticsIndividuals females,StatisticsIndividuals unknown) {
+
+ for(int i=0;i<e.length;i++) {
+
+ Indi indi = (Indi)e[i];
+ int[] age = null;
+
+ // get age when birth and death date are known and aren't ranges
+ if((indi.getBirthDate()!=null)&&(indi.getDeathDate()!=null))
+ age = getAge(indi, indi.getDeathDate());
+
+ switch (indi.getSex()) {
+
+ case PropertySex.MALE:
+
+ males.number++;
+ if(age!=null)
+ analyzeAge(indi, age, males, all);
+ break;
+
+ case PropertySex.FEMALE:
+
+ females.number++;
+ if(age!=null)
+ analyzeAge(indi, age, females, all);
+ break;
+
+ default:
+
+ unknown.number++;
+ if(age!=null)
+ analyzeAge(indi, age, unknown, all);
+ break;
+ }
+ }
+ }
+
+ /**
+ * @param families to store the result
+ * @param e array with families
+ */
+ private void analyzeFamilies(Entity[] e, StatisticsFamilies families) {
+
+ for(int i=0;i<e.length;i++) {
+ Fam fam = (Fam)e[i];
+
+ int children = fam.getNoOfChildren();
+ if(children > 0) {
+ families.withChildren++;
+ families.children.add(Integer.toString(children), fam);
+
+ //update number of max. children
+ if(children>families.maxChildren)
+ families.maxChildren=children;
+
+ //update families with min. children
+ if(children<families.minChildren)
+ families.minChildren=children;
+
+ // analyze marriage age of husband and wife
+ Indi husband=fam.getHusband();
+ Indi wife=fam.getWife();
+
+ // birth date of husband and wife as well as marriage date must be known and fixed (no ranges)
+ if((husband.getBirthDate()!=null)&&(wife.getBirthDate()!=null)&&(fam.getMarriageDate()!=null)) {
+
+ int[] marriageAgeHusband = getAge(husband, fam.getMarriageDate());
+ int[] marriageAgeWife = getAge(wife, fam.getMarriageDate());
+
+ analyzeAge(husband, marriageAgeHusband, families.husbands, null);
+ analyzeAge(wife, marriageAgeWife, families.wifes, null);
+ }
+ }
+ }
+ }
+
+ /**
+ * @param ages all ages added up (unit: days)
+ * @param numAges number of persons added up
+ * @return double[] with average age
+ */
+ private double[] calculateAverageAge(double ages, double numAges) {
+
+ double[] age = {0.0, 0.0, 0.0};
+
+ // only calculate if paramaters != default or unvalid values
+ if((numAges>0)&&(ages!=Integer.MAX_VALUE)&&(ages!=Integer.MIN_VALUE)) {
+ age[0] = Math.floor(ages/360/numAges);
+ ages = ages%(360*numAges);
+ age[1] = Math.floor(ages/30/numAges);
+ ages = ages%(30*numAges);
+ age[2] = roundNumber(ages/numAges, fractionDigits);
+ }
+ return age;
+ }
+
+ /** Prints min., average, and max. age
+ * @param stats to get the values from
+ * @param preMin prefix for min. age, e. g. "min. age:"
+ * @param preAvg prefix for average age, e. g. "avg. age:"
+ * @param preMax prefix for max. age, e. g. "max. age:"
+ */
+ private void printAges(String preMin, String preAvg, String preMax, StatisticsIndividuals stats) {
+
+ // print min. age
+ printMinMaxAge(preMin, stats.minAge, new ArrayList(stats.age.getReferences(new Integer(stats.minAge))));
+
+ // print average age
+ double[] age = calculateAverageAge(stats.sumAge,stats.withAge);
+ String[] str = {Integer.toString((int)age[0]), Integer.toString((int)age[1]), Double.toString(age[2])};
+ println(" "+i18n(preAvg)+" "+i18n("ageDisplay",str));
+
+ // print max. age
+ printMinMaxAge(preMax, stats.maxAge, new ArrayList(stats.age.getReferences(new Integer(stats.maxAge))));
+ }
+
+ /**
+ * @param prefix e. g. "min. age:"
+ * @param age to print
+ * @param ages individuals with this age
+ */
+ private void printMinMaxAge(String prefix, int age, ArrayList ages) {
+
+ double[] a = calculateAverageAge(age,1);
+ String[] str = {Integer.toString((int)a[0]), Integer.toString((int)a[1]), Integer.toString((int)a[2])};
+ println(" "+i18n(prefix)+" "+i18n("ageDisplay",str));
+ if(reportIndiAge) {
+ for(int i=0;i<ages.size();i++) {
+ Indi indi = (Indi)ages.get(i);
+ Object[] output = {indi.getId(), indi.getName()};
+ println(" "+i18n("entity", output));
+ }
+ }
+ }
+
+ /**
+ * @param stats data about individuals with this gender
+ */
+ private void printGender(StatisticsIndividuals stats) {
+
+ String[] output = { Integer.toString(stats.withAge), Double.toString(roundNumber((double)stats.withAge/(double)stats.number*100,fractionDigits)) };
+ println(" "+i18n("birthAndDeath",output));
+ printAges("minAge", "avgAge", "maxAge", stats);
+ }
+
+
+ /**
+ * @param all data about all
+ * @param males data about males
+ * @param females data about females
+ * @param unknown data about individuals with unknown gender
+ */
+ private void reportIndividuals(StatisticsIndividuals all, StatisticsIndividuals males, StatisticsIndividuals females, StatisticsIndividuals unknown) {
+
+ String[] str = new String[2];
+ println(" "+i18n("people"));
+
+ println(" "+i18n("number",all.number));
+ printGender(all);
+
+ str[0] = Integer.toString(males.number);
+ str[1] = Double.toString(roundNumber((double)males.number/(double)all.number*100, fractionDigits));
+ println(" "+i18n("males",str));
+ printGender(males);
+
+ str[0] = Integer.toString(females.number);
+ str[1] = Double.toString(roundNumber((double)females.number/(double)all.number*100, fractionDigits));
+ println(" "+i18n("females",str));
+ printGender(females);
+
+ str[0] = Integer.toString(unknown.number);
+ str[1] = Double.toString(roundNumber((double)unknown.number/(double)all.number*100, fractionDigits));
+ println(" "+i18n("unknown",str));
+ printGender(unknown);
+
+ println();
+ }
+
+ /**
+ * @param fams data about families
+ */
+ private void reportFamilies(StatisticsFamilies fams) {
+
+ ArrayList minChildren = new ArrayList(fams.children.getReferences(Integer.toString(fams.minChildren)));
+ ArrayList maxChildren = new ArrayList(fams.children.getReferences(Integer.toString(fams.maxChildren)));
+
+ println(" "+i18n("families"));
+
+ // all
+ println(" "+i18n("number",fams.number));
+ println(" "+i18n("minChild",fams.minChildren));
+
+ if(reportFamChildren) {
+ for(int i=0;i<minChildren.size();i++) {
+ Fam fam = (Fam)minChildren.get(i);
! String[] output = {fam.getId(), fam.toString()};
! println(" "+i18n("entity", output));
! }
! }
!
! println(" "+i18n("avgChild",Double.toString(roundNumber((double)fams.withChildren/(double)fams.number,fractionDigits))));
! println(" "+i18n("maxChild",fams.maxChildren));
!
! if(reportFamChildren) {
! for(int i=0;i<maxChildren.size();i++) {
! Fam fam = (Fam)maxChildren.get(i);
! Object[] output = {fam.getId(), fam.toString()};
! println(" "+i18n("entity", output));
! }
! }
!
! //ages at marriage
! String[] output = {Integer.toString(fams.husbands.withAge),Double.toString(roundNumber((double)fams.husbands.withAge/(double)fams.number*100,fractionDigits))};
! println(" "+i18n("birthAndMarriage",output));
!
! //husbands
! println(" "+i18n("husbands"));
! printAges("minMarrAge", "avgMarrAge", "maxMarrAge", fams.husbands);
!
! // wifes
! println(" "+i18n("wifes"));
! printAges("minMarrAge", "avgMarrAge", "maxMarrAge", fams.wifes);
!
! println();
! }
!
! /**
! * @param places */
! private void reportPlaces(StatisticsPlaces places) {
!
! int number = 0;
! Iterator p = places.places.getValues(sortByName).iterator();
! while (p.hasNext()) {
! String place = (String)p.next();
! number = places.places.getCount(place);
! println(" + "+place+": "+number+" ("+roundNumber((double)number/(double)places.knownPlaces*100, fractionDigits)+"%)");
! }
! println();
! }
! } //ReportGedcomStatistics
\ No newline at end of file
Index: ReportGedcomStatistics.properties
===================================================================
RCS file: /cvsroot/genj/dev/src/report/ReportGedcomStatistics.properties,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ReportGedcomStatistics.properties 24 Sep 2003 20:09:17 -0000 1.6
--- ReportGedcomStatistics.properties 29 Sep 2003 12:44:14 -0000 1.7
***************
*** 5,60 ****
# Languages supported :
# - english (default)
! # - french
! #
! script_name = Gedcom Statistics
! script_name.fr = Statistiques Gedcom
! script_info = This report gives you some statistics about the current Gedcom File.\n\
! . How many families, persons.\n\
! . Number of males, females, and individuals with undefined sex.\n\
! . Stats about birth places.\n\
! . Stats about death places.
! script_info.fr = Ce script vous donne quelques statistiques sur le fichier Gedcom actuellement ouvert.\n\
! . Combien de familles, de personnes.\n\
! . Nombre d'hommes, de femmes, ou d'individus dont le sexe n'est pas encore d\u00E9fini.\n\
! . Statistiques sur les lieux de naissance.\n\
! . Statistiques sur les lieux de d\u00E9c\u00E8s.
! about_people = * Stats about people :
! about_people.fr = * Statistiques concernant les personnes :
! about_birthplaces = * Stats about birth places :
! about_birthplaces.fr = * Statistiques concernant les lieux de naissance :
! about_deathplaces = * Stats about death places :
! about_deathplaces.fr = * Statistiques concernant les lieux de d\u00E9c\u00E8s :
header = In the Gedcom file named "{0}", there are :
header.fr = Dans le fichier Gedcom d\u00E9nomm\u00E9 "{0}", il y a :
! families = {0} Families.
! families.fr = {0} Familles.
! individuals = {0} individuals.
! individuals.fr = {0} personnes.
! males = {0} Males.
! males.fr = {0} Hommes.
! females = {0} Females.
! females.fr = {0} Femmes.
! sex_unknown = There {0,choice,0#are no individuals|1#is one individual|2#are {0,number,integer} individuals} of unknown gender.
! sex_unknown.fr = {0,choice,0#Il n''y a aucune personne|1#Il y a une personne|2#Il y a {0,number,integer} personnes} dont le sexe n''est pas connu.
! unknown_places = an unknown place
! unknown_places.fr = un endroit inconnu
! indi_born = {0,choice,0#No individuals were|1#1 individual was|2#{0,number} individuals were} born in {1}.
! indi_born.fr = {0,choice,0#Aucune personne est n\u00E9e|1#1 personne est n\u00E9e|2#{0,number} personnes sont n\u00E9es} \u00E0 {1}.
! indi_died = {0,choice,0#No individuals|1#1 individual|2#{0,number} individuals} died in {1}.
! indi_died.fr = {0,choice,0#Aucune personne est décédée|1#1 personne est décédée|2#{0,number} personnes sont décédées} \u00E0 {1}.
! isSortByPlace = Sort places by name (or number of occurances)
! isSortByPlace.de = Orte nach Namen sortieren (oder nach Vorkommen)
--- 5,126 ----
# Languages supported :
# - english (default)
! # - french (incomplete due to changes)
! # - german
! name=Gedcom Statistics
! name.de=Gedcom-Statistik
! name.fr=Statistiques Gedcom
! info=This report gives you some statistics about the current Gedcom File.\n\n Categories:\n. Individuals (gender, number, age) \n. Families (number, children, marriage age) \n. Places (name, number)\n\nOptions:\n . Turn categories on / off\n . Turn output of entities on / off\n . Sort order for places\n . Digits in fraction portion\n\n Info:\n . Managing time spans: (begin+end)/2\n . Managing ages: Year = 360 days, month = 30 days
! info.de=Dieser Report erstellt Statistiken \u00FCber die aktuelle Gedcom-Datei.\n\nKategorien:\n. Personen (Geschlecht, Anzahl, Alter) \n. Familien (Anzahl, Kinder, Heiratsalter) \n. Orte (Name, Anzahl)\n\nOptions:\n . Kategorien ein-/ausschalten\n . Ausgabe von Entit\u00E4ten ein-/ausschalten\n . Sortierreihenfolge f\u00FCr Orte\n . Nachkommastellen\n\n Info:\n . Handhabung Zeitspannen: (Beginn+Ende)/2\n . Handhabung Alter: Jahr = 360 Tage, Monat = 30 Tage
! fractionDigits=Digits in fraction portion
! fractionDigits.de=Nachkommastellen
! analyzeIndividuals=Analyze persons
! analyzeIndividuals.de=Personen auswerten
! analyzeFamilies=Analyze families
! analyzeFamilies.de=Familien auswerten
!
! analyzeBirthPlaces=Analyze birth places
! analyzeBirthPlaces.de=Geburtsorte auswerten
!
! analyzeMarriagePlaces=Evaluate marriage places
! analyzeMarriagePlaces.de=Heiratsorte auswerten
!
! analyzeDeathPlaces=Analyze death places
! analyzeDeathPlaces.de=Todesorte auswerten
!
! sortByName=Sort places by name (not by frequency)
! sortByName.de=Ort nach Namen sortieren (nicht nach H\u00E4ufigkeit)
header = In the Gedcom file named "{0}", there are :
+ header.de = In der Gedcom-Datei mit dem Namen "{0}" sind:
header.fr = Dans le fichier Gedcom d\u00E9nomm\u00E9 "{0}", il y a :
! known=+ Known: {0} ({1}%)
! known.de=+ Bekannte: {0} ({1}%)
! people=* People
! people.de=* Personen
! people.fr=* Personnes
! number=+ Number: {0}
! number.de=+ Anzahl: {0}
! males = + Males: {0} ({1}%)
! males.de=+ M\u00E4nnlich: {0} ({1}%)
! males.fr = + Hommes: {0} ({1}%)
! females = + Females: {0} ({1}%)
! females.de=+ Weiblich: {0} ({1}%)
! females.fr = + Femmes: {0} ({1}%)
! unknown=+ Unknown: {0} ({1}%)
! unknown.de=+ Unbekannt: {0} ({1}%)
! birthAndDeath=- With date of birth and date of death: {0} ({1}%)
! birthAndDeath.de=- Mit Geburts- und Todesdatum: {0} ({1}%)
! ageDisplay={0} years {1} months {2} days
! ageDisplay.de={0} Jahre {1} Monate {2} Tage
! minAge=. Youngest:
! minAge.de=. J\u00FCngster:
!
! avgAge=. Average age:
! avgAge.de=. Durchschnittl. Alter:
!
! maxAge=. Oldest:
! maxAge.de=. \u00C4ltester:
!
! families = * Families
! families.de = * Familien
! families.fr = * Familles
!
! minChild=- Min. number of children: {0}
! minChild.de=- Min. Anzahl Kinder: {0}
!
! avgChild=- Average number of children: {0}
! avgChild.de=- Durchschnittl. Anzahl Kinder: {0}
!
! maxChild=- Max. number of children: {0}
! maxChild.de=- Max. Anzahl Kinder: {0}
!
! birthAndMarriage=+ With date of birth and date of marriage: {0} ({1}%)
! birthAndMarriage.de=+ Mit Geburts- und Hochzeitsdatum: {0} ({1}%)
!
! husbands=- Husbands:
! husbands.de=- Ehem\u00E4nner:
!
! wifes=- Wifes:
! wifes.de=- Ehefrauen:
!
! minMarrAge=. Min. age at marriage:
! minMarrAge.de=. Min. Alter bei Heirat:
!
! maxMarrAge=. Max. age at marriage:
! maxMarrAge.de=. Max. Alter bei Heirat:
!
! avgMarrAge=. Average age at marriage:
! avgMarrAge.de=. Durchschnittl. Alter bei Heirat:
!
! birthPlaces=* Birthplaces
! birthPlaces.de=* Geburtsorte
! birthPlaces.fr=* Lieux de naissance
!
! deathPlaces=* Deathplaces
! deathPlaces.de=* Todesorte
! deathPlaces.fr=* Lieux de d\u00E9c\u00E8s
!
! marriagePlaces=* Marriageplaces:
! marriagePlaces.de=* Heiratsorte:
! reportIndiAge=Report individuals with min. / max. age
!
! reportIndiAge.de=Personen mit min. / max. Alter ausgeben
!
! entity=@{0}@ {1}
!
! reportFamChildren=Report families with min. / max. children
!
! reportFamChildren.de=Familien mit min. / max. Kinder ausgeben
|