Skip to content

Commit

Permalink
Added support for multiple names and date periods in location records (
Browse files Browse the repository at this point in the history
…fix #526)
  • Loading branch information
Serg-Norseman committed Jan 28, 2024
1 parent a00c07c commit c4edb6a
Show file tree
Hide file tree
Showing 84 changed files with 1,590 additions and 115 deletions.
3 changes: 3 additions & 0 deletions locales/Belarusian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -943,3 +943,6 @@
935=Portrait
936=Census analysis
937=The person can be found in the census `{0}`
938=History
939=The periods of place names overlap. This will cause errors when searching for a place name by date.
940=Extended locations
3 changes: 3 additions & 0 deletions locales/Chinese Simplified.lng
Original file line number Diff line number Diff line change
Expand Up @@ -943,3 +943,6 @@
935=Portrait
936=Census analysis
937=The person can be found in the census `{0}`
938=History
939=The periods of place names overlap. This will cause errors when searching for a place name by date.
940=Extended locations
3 changes: 3 additions & 0 deletions locales/Dutch.lng
Original file line number Diff line number Diff line change
Expand Up @@ -943,3 +943,6 @@
935=Portrait
936=Census analysis
937=The person can be found in the census `{0}`
938=History
939=The periods of place names overlap. This will cause errors when searching for a place name by date.
940=Extended locations
3 changes: 3 additions & 0 deletions locales/English.lng
Original file line number Diff line number Diff line change
Expand Up @@ -943,3 +943,6 @@
935=Portrait
936=Census analysis
937=The person can be found in the census `{0}`
938=History
939=The periods of place names overlap. This will cause errors when searching for a place name by date.
940=Extended locations
3 changes: 3 additions & 0 deletions locales/Hungarian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -943,3 +943,6 @@
935=Portré
936=Census analysis
937=The person can be found in the census `{0}`
938=History
939=The periods of place names overlap. This will cause errors when searching for a place name by date.
940=Extended locations
3 changes: 3 additions & 0 deletions locales/Icelandic.lng
Original file line number Diff line number Diff line change
Expand Up @@ -943,3 +943,6 @@
935=Portrait
936=Census analysis
937=The person can be found in the census `{0}`
938=History
939=The periods of place names overlap. This will cause errors when searching for a place name by date.
940=Extended locations
3 changes: 3 additions & 0 deletions locales/Japanese.lng
Original file line number Diff line number Diff line change
Expand Up @@ -943,3 +943,6 @@
935=ポートレート
936=Census analysis
937=The person can be found in the census `{0}`
938=History
939=The periods of place names overlap. This will cause errors when searching for a place name by date.
940=Extended locations
3 changes: 3 additions & 0 deletions locales/Kazakh (Cyrillic).lng
Original file line number Diff line number Diff line change
Expand Up @@ -943,3 +943,6 @@
935=Portrait
936=Census analysis
937=The person can be found in the census `{0}`
938=History
939=The periods of place names overlap. This will cause errors when searching for a place name by date.
940=Extended locations
3 changes: 3 additions & 0 deletions locales/Portuguese.lng
Original file line number Diff line number Diff line change
Expand Up @@ -943,3 +943,6 @@
935=Portrait
936=Census analysis
937=The person can be found in the census `{0}`
938=History
939=The periods of place names overlap. This will cause errors when searching for a place name by date.
940=Extended locations
3 changes: 3 additions & 0 deletions locales/Serbian (Latin).lng
Original file line number Diff line number Diff line change
Expand Up @@ -943,3 +943,6 @@
935=Portrait
936=Census analysis
937=The person can be found in the census `{0}`
938=History
939=The periods of place names overlap. This will cause errors when searching for a place name by date.
940=Extended locations
3 changes: 3 additions & 0 deletions locales/Spanish.lng
Original file line number Diff line number Diff line change
Expand Up @@ -943,3 +943,6 @@
935=Portrait
936=Census analysis
937=The person can be found in the census `{0}`
938=History
939=The periods of place names overlap. This will cause errors when searching for a place name by date.
940=Extended locations
3 changes: 3 additions & 0 deletions locales/czech.lng
Original file line number Diff line number Diff line change
Expand Up @@ -943,3 +943,6 @@
935=Portrait
936=Census analysis
937=The person can be found in the census `{0}`
938=History
939=The periods of place names overlap. This will cause errors when searching for a place name by date.
940=Extended locations
3 changes: 3 additions & 0 deletions locales/french.lng
Original file line number Diff line number Diff line change
Expand Up @@ -943,3 +943,6 @@
935=Portrait
936=Census analysis
937=The person can be found in the census `{0}`
938=History
939=The periods of place names overlap. This will cause errors when searching for a place name by date.
940=Extended locations
3 changes: 3 additions & 0 deletions locales/german.lng
Original file line number Diff line number Diff line change
Expand Up @@ -943,3 +943,6 @@
935=Porträt
936=Census analysis
937=The person can be found in the census `{0}`
938=History
939=The periods of place names overlap. This will cause errors when searching for a place name by date.
940=Extended locations
1 change: 1 addition & 0 deletions locales/help_enu/gkhHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ <h1>Change log</h1>

<p>
<b>??.??.2024 [v2.29.0 &amp; v3.5.0]</b><ul>
<li>Added support for multiple names and date periods in location records (GEDCOM 5.5 EL).
<li>Added a non-standard date attribute to source records (for clarifying and sorting censuses, parish books, confession books and personal documents).
<li>Fixed missing empty lines in notes.
<li>Fixed an error in attaching unknown (and webp) multimedia files.
Expand Down
1 change: 1 addition & 0 deletions locales/help_rus/gkhHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ <h1>История версий</h1>

<p>
<b>??.??.2024 [v2.29.0 &amp; v3.5.0]</b><ul>
<li>Добавлена поддержка множественных названий и периодов дат в записи мест (GEDCOM 5.5 EL).
<li>Добавлен нестандартный атрибут даты в записи источников (для уточнения и сортировки переписей, метрических книг, ревизских сказок, исповедных книг и личных документов).
<li>Исправлены отсутствующие пустые строки в заметках.
<li>Исправлена ошибка присоединения неизвестных (и webp) мультимедиа файлов.
Expand Down
3 changes: 3 additions & 0 deletions locales/italian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -943,3 +943,6 @@
935=Portrait
936=Census analysis
937=The person can be found in the census `{0}`
938=History
939=The periods of place names overlap. This will cause errors when searching for a place name by date.
940=Extended locations
3 changes: 3 additions & 0 deletions locales/polish.lng
Original file line number Diff line number Diff line change
Expand Up @@ -943,3 +943,6 @@
935=Portrait
936=Census analysis
937=The person can be found in the census `{0}`
938=History
939=The periods of place names overlap. This will cause errors when searching for a place name by date.
940=Extended locations
3 changes: 3 additions & 0 deletions locales/russian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -943,3 +943,6 @@
935=Портрет
936=Анализ переписей
937=Персона может быть найдена в переписи `{0}`
938=История
939=Периоды названий места пересекаются. Это приведет к ошибкам при поиске названия места по дате.
940=Расширенная обработка мест
3 changes: 3 additions & 0 deletions locales/ukrainian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -943,3 +943,6 @@
935=Portrait
936=Census analysis
937=The person can be found in the census `{0}`
938=History
939=The periods of place names overlap. This will cause errors when searching for a place name by date.
940=Extended locations
58 changes: 57 additions & 1 deletion projects/GKCore/GDModel/GDMCustomDate.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* "GEDKeeper", the personal genealogical database editor.
* Copyright (C) 2009-2023 by Sergey V. Zhdanovskih.
* Copyright (C) 2009-2024 by Sergey V. Zhdanovskih.
*
* This file is part of "GEDKeeper".
*
Expand Down Expand Up @@ -39,6 +39,23 @@ public enum GDMCalendar
}


public enum GDMDateType
{
Exact,
Before,
After,
Between,
PeriodTo,
PeriodFrom,
PeriodBetween,
About,
Calculated,
Estimated,

None
}


public enum GDMApproximated
{
daExact,
Expand Down Expand Up @@ -163,5 +180,44 @@ public static GDMDateRange CreateRange(GDMDate dateAfter, GDMDate dateBefore)
if (dateBefore != null) result.Before.Assign(dateBefore);
return result;
}


public static void GetDateRange(GDMCustomDate date, out GDMDate dateStart, out GDMDate dateEnd)
{
if (date is GDMDateRange) {
GDMDateRange dtRange = date as GDMDateRange;
dateStart = dtRange.After;
dateEnd = dtRange.Before;
} else if (date is GDMDatePeriod) {
GDMDatePeriod dtPeriod = date as GDMDatePeriod;
dateStart = dtPeriod.DateFrom;
dateEnd = dtPeriod.DateTo;
} else {
var dt = date as GDMDate;
dateStart = dt;
dateEnd = dt;
}
}

public static GDMDatePeriod GetIntersection(GDMCustomDate range1, GDMCustomDate range2)
{
if (range1 == null || range1.IsEmpty() || range2 == null || range2.IsEmpty())
return GDMDatePeriod.Empty;

GDMDate r1start, r1end, r2start, r2end;

GetDateRange(range1, out r1start, out r1end);
GetDateRange(range2, out r2start, out r2end);

GDMDate greatestStart = r1start.CompareTo(r2start) > 0 ? r1start : r2start;
GDMDate smallestEnd = r1end.CompareTo(r2end) < 0 ? r1end : r2end;

// no intersection
if (greatestStart.CompareTo(smallestEnd) > 0) {
return GDMDatePeriod.Empty;
}

return CreatePeriod(greatestStart, smallestEnd);
}
}
}
5 changes: 4 additions & 1 deletion projects/GKCore/GDModel/GDMDatePeriod.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* "GEDKeeper", the personal genealogical database editor.
* Copyright (C) 2009-2023 by Sergey V. Zhdanovskih.
* Copyright (C) 2009-2024 by Sergey V. Zhdanovskih.
*
* This file is part of "GEDKeeper".
*
Expand All @@ -27,6 +27,9 @@ namespace GDModel
{
public sealed class GDMDatePeriod : GDMCustomDate
{
public static readonly GDMDatePeriod Empty = new GDMDatePeriod();


private readonly GDMDate fDateFrom;
private readonly GDMDate fDateTo;

Expand Down
5 changes: 4 additions & 1 deletion projects/GKCore/GDModel/GDMDateRange.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* "GEDKeeper", the personal genealogical database editor.
* Copyright (C) 2009-2023 by Sergey V. Zhdanovskih.
* Copyright (C) 2009-2024 by Sergey V. Zhdanovskih.
*
* This file is part of "GEDKeeper".
*
Expand All @@ -27,6 +27,9 @@ namespace GDModel
{
public sealed class GDMDateRange : GDMCustomDate
{
public static readonly GDMDateRange Empty = new GDMDateRange();


private readonly GDMDate fDateAfter;
private readonly GDMDate fDateBefore;

Expand Down
Loading

0 comments on commit c4edb6a

Please sign in to comment.