generations

package module
v0.0.0-...-769f2f8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2026 License: AGPL-3.0 Imports: 23 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

generations

generations creates beautiful genealogy tree documents (PDF) from simple YAML person databases. It is both a Go library (github.com/jojomi/generations) and a command line tool (cmd/) that renders family trees via LuaLaTeX and the excellent genealogytree LaTeX package.

Toolchain

Installation

With a Go environment set up:

go get -u github.com/jojomi/generations/cmd

Make sure lualatex is in your PATH.

Usage

generations genealogytree <config-file>...

The genealogytree subcommand reads one or more YAML document configs, renders every configured tree to LaTeX, compiles the result with lualatex, and (by default) opens the generated PDF.

Useful flags:

Flag Default Meaning
-c, --debug-config off dump the parsed config and exit
-i, --check-ids on error on person IDs that are referenced but not defined
-a, --anonymize off anonymize the rendered data
--compile on run lualatex (otherwise only the .tex file is written)
-n, --compile-runs 2 number of lualatex passes
-o, --open (global) on open the resulting PDF
-v, --verbose (global) on verbose output incl. lualatex log
-d, --database-base-dir (global) ~/.generations/databases/ base dir for database file lookup
Database (YAML)

A database is a YAML file with a persons list. Each person supports (schema in flat_person.go and models.go):

persons:
  - id: PachGerd1955          # free-form ID, referenced by other entries
    uuid: ...                 # optional stable UUID
    name:
      first: [Gerd, Michael]  # first names
      last: Pachowski
      birth: ...              # birth name, if different
    gender: male              # male / female / unknown
    birth:   {date: 1955-04-01, place: Musterstadt}
    baptism: {date: ..., place: ...}
    death:   {date: ..., place: ...}
    burial:  {date: ..., place: ...}
    mom: <id>                 # link to another person
    dad: <id>
    child_number: 2           # ordering among siblings
    partners:
      - id: <id>              # partner person
        engagement: {date: ..., place: ...}
        marriage:   {date: ..., place: ...}
        divorce:    {date: ..., place: ...}
    attributes: [dead, ...]   # free-form flags used by templates/styles
    image: portrait.jpg
    floruit: "1980-1990"      # active period, if exact dates unknown
    jobs: baker
    comment: ...

Dates are strings, so vague data like before 1932 is possible; exact dates use YYYY-MM-DD. Databases can be split across several files; duplicate entries are merged (missing mom/dad links are filled in from the duplicate).

Document config (YAML)

Schema in cmd/config.go, rendering options in render_tree_options.go and render_person_options.go. A config defines document-wide settings (title, date, attribution, custom-head LaTeX preamble, pre/post content, level styling, output filename) plus a list of trees:

title: "Stammbaum-Beispiel"
databases:
  - example/database.yml
output-filename: test.pdf
trees:
  - title: "Verwandtschaft"
    proband: "Gerd Pachowski"   # root person (ID, UUID, or "First Last")
    proband-level: 0
    scale: 0.7
    custom-styles: "template=signpost,timeflow=down,..."  # raw genealogytree options
    render-tree-options:
      max-parent-generations: -1          # -1 = unlimited, 0 = none
      max-parent-siblings-generations: 0
      max-child-generations: -1
      render-person-options:
        lastname-policy: 3                # e.g. current and birth name
        hide-birth: true                  # plus hide-death, hide-jobs, ...
Levels and themes

Tree levels (generations) can be styled individually — colors, box options, arbitrary genealogytree options — either absolute (by level index) or relative to the proband (see level.go). Reusable level themes ship in cmd/templates/levels/, e.g. colors-light, colors-gray, dense-children, gray-in-law, right-align-in-law.

Templates

Rendering is template-driven (Go text/template):

  • Document templates (cmd/templates/document/): the LaTeX skeleton (basic.tex).
  • Tree templates (cmd/templates/tree/): how a tree is embedded (basic.tex, min-space.tex, min-space-filled.tex, raw.tex); templates can take options from the config.
  • Node templates (*.tpl, e.g. cmd/templates/person.tpl, parent_tree.tpl, child_tree.tpl, union_tree.tpl): how persons and subtree structures are emitted as genealogytree code.

Example

An example database and document config are included:

generations genealogytree example/config.yml

The result looks like this:

page1

page2

(the full pdf)

Library architecture

The root package generations is usable independently of the CLI:

  • database.go — Database interface and YAML-backed MemoryDatabase (parsing, ID generation, duplicate merging, person lookup by ID/UUID/name)
  • flat_person.go / person.go / person_list.go — the Person interface and its flat YAML-backed implementation, relations (mom/dad/partners/children), person lists
  • relationship.go / flat_relationship.go — partner relationships (engagement, marriage, divorce)
  • generator.go, generator_parent_tree.go, generator_child_tree.go — RenderGenealogytree(person, options): recursive rendering of parent and child subtrees including siblings, partners, and ignore rules
  • render_tree_options.go / render_person_options.go — all rendering knobs (generation limits, hide flags, name policies, image handling)
  • level.go — per-generation styling
  • models.go / models_enum.go — shared models (DatePlace, Gender, Marriage; enums via go-enum)

Development

Run the tests (includes go generate for the enums and a coverage report):

./_run-tests.sh

Test fixtures live in testdata/database/.

FAQ

  1. What if I don't like LuaLaTeX? You can compile with other TeX processors too, but you will most likely have to change the document template.

  2. How do I use Fraktur fonts? Install the ttf-unifraktur package, then in custom-head use:

    \defaultfontfeatures{Ligatures=TeX}
    \setmainfont{UnifrakturMaguntia}
    \setsansfont{UnifrakturMaguntia}
    

    More info: http://unifraktur.sourceforge.net/maguntia.html

  3. How do I help LaTeX with hyphenating? In custom-head use:

     \hyphenation{Spe-cial-town-name}
    
  4. How do I reduce the PDF file size? The built-in PDF minification was removed because it caused issues with Ghostscript on some systems. To optimize your PDF afterwards, install pdfoptimize (Go tool using QPDF) and run:

     pdfoptimize input.pdf output.pdf
    

    Or add it to your local build scripts after generations familybook.

Documentation

Index

Constants

View Source
const GenerationsNone = -1
View Source
const GenerationsUnlimited = 1000

Variables

This section is empty.

Functions

func FourFourYearIDFunc

func FourFourYearIDFunc(p Person, d Database) error

func GetFourFourBirthNameID

func GetFourFourBirthNameID(p Person) (string, error)

func GetFourFourYearID

func GetFourFourYearID(p Person) (string, error)

func GetLastFirstNameID

func GetLastFirstNameID(p Person) (string, error)

func GetLifeAge

func GetLifeAge(p Person, referenceDate time.Time) (*timecalc.DateDiff, error)

GetLifeAge returns the minimal age

func HasDied

func HasDied(p Person, referenceDate time.Time) bool

func IsAlive

func IsAlive(p Person, referenceDate time.Time) bool

func IsBorn

func IsBorn(p Person, referenceDate time.Time) bool

func IsMarried

func IsMarried(p Person, referenceDate time.Time) bool

func RenderGenealogytree

func RenderGenealogytree(p Person, o RenderTreeOptions) ([]byte, error)

func RenderParentSubtree

func RenderParentSubtree(p Person, o RenderTreeOptions, headless bool) ([]byte, error)

func RenderTemplateFile

func RenderTemplateFile(filename string, data interface{}, customFuncMap template.FuncMap) ([]byte, error)

func SplitPersons

func SplitPersons(personList *PersonList, split Person) (younger PersonList, older PersonList)

func TemplateLatexifyFunc

func TemplateLatexifyFunc(input string) string

Types

type AbsoluteLevel

type AbsoluteLevel struct {
	Index      int             `yaml:"index,omitempty"`
	Color      LevelColor      `yaml:"color,omitempty"`
	BoxOptions LevelBoxOptions `yaml:"box-options,omitempty"`
	Options    LevelOptions    `yaml:"options,omitempty"`
}

func (*AbsoluteLevel) Equals

func (l *AbsoluteLevel) Equals(other AbsoluteLevel) bool

func (*AbsoluteLevel) GetBoxOptions

func (l *AbsoluteLevel) GetBoxOptions() LevelBoxOptions

func (*AbsoluteLevel) GetColor

func (l *AbsoluteLevel) GetColor() LevelColor

func (*AbsoluteLevel) GetOptions

func (l *AbsoluteLevel) GetOptions() LevelOptions

func (*AbsoluteLevel) IsChildLevel

func (l *AbsoluteLevel) IsChildLevel(probandLevel int) bool

func (*AbsoluteLevel) IsParentLevel

func (l *AbsoluteLevel) IsParentLevel(probandLevel int) bool

func (*AbsoluteLevel) IsProbandLevel

func (l *AbsoluteLevel) IsProbandLevel(probandLevel int) bool

func (*AbsoluteLevel) SetBoxOptions

func (l *AbsoluteLevel) SetBoxOptions(lb LevelBoxOptions)

func (*AbsoluteLevel) SetColor

func (l *AbsoluteLevel) SetColor(lc LevelColor)

func (*AbsoluteLevel) SetOptions

func (l *AbsoluteLevel) SetOptions(lb LevelOptions)

type AttributePersons

type AttributePersons struct {
	Attribute string
	Persons   *PersonList
}

type BiographyElement

type BiographyElement struct {
	Text    string        `yaml:",omitempty"`
	Sources ReferenceList `yaml:",omitempty"`
}

type Comment

type Comment struct {
	Text    string        `yaml:",omitempty"`
	Sources ReferenceList `yaml:",omitempty"`
}

type Database

type Database interface {
	Get(search string) (Person, error)
	GetByID(ID string) (Person, error)
	MakeIDs(f func(p Person, d Database) error) error
}

type DatePlace

type DatePlace struct {
	Location `yaml:",inline,omitempty"`

	// need to support things like "before 1932" here
	Date        string        `yaml:",omitempty"`
	DateSources ReferenceList `yaml:"date_sources,omitempty"`
}

func (DatePlace) Empty

func (d DatePlace) Empty() bool

func (DatePlace) GetAgeBegin

func (d DatePlace) GetAgeBegin(other DatePlace) int

type FlatPerson

type FlatPerson struct {
	Dummy             bool               `yaml:"-"`
	ID                string             `yaml:",omitempty"`
	UUID              string             `yaml:",omitempty"`
	ChildNumber       *uint              `yaml:"child_number,omitempty"`
	RelationsCount    *uint              `yaml:"relations_count,omitempty"`
	Name              Name               `yaml:",omitempty"`
	Gender            string             `yaml:",omitempty"`
	Birth             DatePlace          `yaml:",omitempty"`
	Baptism           DatePlace          `yaml:",omitempty"`
	SaintsDay         SaintsDay          `yaml:"saintsday,omitempty"`
	Death             DatePlace          `yaml:",omitempty"`
	Dead              *bool              `yaml:",omitempty"`
	Burial            DatePlace          `yaml:",omitempty"`
	Mom               string             `yaml:",omitempty"`
	Dad               string             `yaml:",omitempty"`
	Partners          []FlatRelationship `yaml:",omitempty"`
	Attributes        []string           `yaml:",omitempty"`
	ImageFilename     string             `yaml:"image,omitempty"`
	Residences        []Residence        `yaml:",omitempty"`
	Jobs              []Job              `yaml:",omitempty"`
	Comments          []Comment          `yaml:",omitempty"`
	BiographyElements []BiographyElement `yaml:"biography,omitempty"`

	Sources       ReferenceList `yaml:"sources,omitempty"`
	GenderSources ReferenceList `yaml:"gender-sources,omitempty"`

	Database *MemoryDatabase `yaml:"-"`
	// contains filtered or unexported fields
}

func NewDummyFlatPerson

func NewDummyFlatPerson() *FlatPerson

func (*FlatPerson) AddAttribute

func (d *FlatPerson) AddAttribute(attr string)

func (*FlatPerson) AddBiographyElement

func (d *FlatPerson) AddBiographyElement(biographyElement BiographyElement)

func (*FlatPerson) AddComment

func (d *FlatPerson) AddComment(comment Comment)

func (*FlatPerson) AddJob

func (d *FlatPerson) AddJob(job Job)

func (*FlatPerson) AddResidence

func (d *FlatPerson) AddResidence(residence Residence)

func (*FlatPerson) AddTreePositionID

func (d *FlatPerson) AddTreePositionID(ID string) Person

func (*FlatPerson) ClearTreePositionIDs

func (d *FlatPerson) ClearTreePositionIDs() Person

func (*FlatPerson) Copy

func (d *FlatPerson) Copy() Person

func (*FlatPerson) Equals

func (d *FlatPerson) Equals(p2 Person) bool

func (*FlatPerson) GetAge

func (d *FlatPerson) GetAge(now time.Time) int

func (*FlatPerson) GetAttributes

func (d *FlatPerson) GetAttributes() []string

func (*FlatPerson) GetBaptism

func (d *FlatPerson) GetBaptism() DatePlace

func (*FlatPerson) GetBestID

func (d *FlatPerson) GetBestID() string

func (*FlatPerson) GetBiographyElements

func (d *FlatPerson) GetBiographyElements() []BiographyElement

func (*FlatPerson) GetBirth

func (d *FlatPerson) GetBirth() DatePlace

func (*FlatPerson) GetBurial

func (d *FlatPerson) GetBurial() DatePlace

func (*FlatPerson) GetChildNumber

func (d *FlatPerson) GetChildNumber() *uint

func (*FlatPerson) GetChildren

func (d *FlatPerson) GetChildren() (*PersonList, error)

func (*FlatPerson) GetChildrenCount

func (d *FlatPerson) GetChildrenCount() int

func (*FlatPerson) GetChildrenParents

func (d *FlatPerson) GetChildrenParents() (*PersonList, error)

func (*FlatPerson) GetChildrenWith

func (d *FlatPerson) GetChildrenWith(partner Person) (*PersonList, error)

func (*FlatPerson) GetComments

func (d *FlatPerson) GetComments() []Comment

func (*FlatPerson) GetDad

func (d *FlatPerson) GetDad() (Person, error)

func (*FlatPerson) GetDeadState

func (d *FlatPerson) GetDeadState() *bool

func (*FlatPerson) GetDeath

func (d *FlatPerson) GetDeath() DatePlace

func (*FlatPerson) GetDeathAge

func (d *FlatPerson) GetDeathAge() int

func (*FlatPerson) GetGender

func (d *FlatPerson) GetGender() Gender

func (*FlatPerson) GetGenderSources

func (d *FlatPerson) GetGenderSources() ReferenceList

func (*FlatPerson) GetID

func (d *FlatPerson) GetID() string

func (*FlatPerson) GetImageFilename

func (d *FlatPerson) GetImageFilename() string

func (*FlatPerson) GetJobs

func (d *FlatPerson) GetJobs() []Job

func (*FlatPerson) GetMainTreePositionID

func (d *FlatPerson) GetMainTreePositionID() string

func (*FlatPerson) GetMom

func (d *FlatPerson) GetMom() (Person, error)

func (*FlatPerson) GetName

func (d *FlatPerson) GetName() Name

func (*FlatPerson) GetPartners

func (d *FlatPerson) GetPartners() (*PersonList, error)

func (*FlatPerson) GetRawDad

func (d *FlatPerson) GetRawDad() string

func (*FlatPerson) GetRawMom

func (d *FlatPerson) GetRawMom() string

func (*FlatPerson) GetRelationsCount

func (d *FlatPerson) GetRelationsCount() *uint

func (*FlatPerson) GetRelationshipWith

func (d *FlatPerson) GetRelationshipWith(partner Person) Relationship

func (*FlatPerson) GetRelationships

func (d *FlatPerson) GetRelationships() []Relationship

func (*FlatPerson) GetResidences

func (d *FlatPerson) GetResidences() []Residence

func (*FlatPerson) GetSaintsDay

func (d *FlatPerson) GetSaintsDay() SaintsDay

func (*FlatPerson) GetSiblings

func (d *FlatPerson) GetSiblings() (*SiblingList, error)

func (*FlatPerson) GetSources

func (d *FlatPerson) GetSources() ReferenceList

func (*FlatPerson) GetTreePositionIDs

func (d *FlatPerson) GetTreePositionIDs() []string

func (*FlatPerson) GetUUID

func (d *FlatPerson) GetUUID() string

func (*FlatPerson) HasChildrenCount

func (d *FlatPerson) HasChildrenCount() bool

func (*FlatPerson) IsAlive

func (d *FlatPerson) IsAlive(referenceTime time.Time) bool

func (*FlatPerson) IsDummy

func (d *FlatPerson) IsDummy() bool

func (*FlatPerson) IsEmpty

func (d *FlatPerson) IsEmpty() bool

func (*FlatPerson) IsSpitzahn

func (d *FlatPerson) IsSpitzahn() bool

func (*FlatPerson) IsStopPerson

func (d *FlatPerson) IsStopPerson() bool

func (*FlatPerson) MatchesIDUUID

func (d *FlatPerson) MatchesIDUUID(idUUIDSearches ...string) bool

func (*FlatPerson) MatchesSearch

func (d *FlatPerson) MatchesSearch(search string) bool

func (*FlatPerson) SetBiographyElements

func (d *FlatPerson) SetBiographyElements(biographyElements []BiographyElement)

func (*FlatPerson) SetChildNumber

func (d *FlatPerson) SetChildNumber(childNumber *uint)

func (*FlatPerson) SetComments

func (d *FlatPerson) SetComments(comments []Comment)

func (*FlatPerson) SetID

func (d *FlatPerson) SetID(id string)

func (*FlatPerson) SetImageFilename

func (d *FlatPerson) SetImageFilename(filename string)

func (*FlatPerson) SetJobs

func (d *FlatPerson) SetJobs(jobs []Job)

func (*FlatPerson) SetRawDad

func (d *FlatPerson) SetRawDad(dad string)

func (*FlatPerson) SetRawMom

func (d *FlatPerson) SetRawMom(mom string)

func (*FlatPerson) SetRelationsCount

func (d *FlatPerson) SetRelationsCount(relationsCount *uint)

func (*FlatPerson) SetResidences

func (d *FlatPerson) SetResidences(residences []Residence)

func (*FlatPerson) SetStopPerson

func (d *FlatPerson) SetStopPerson(value bool)

func (FlatPerson) String

func (d FlatPerson) String() string

type FlatRelationship

type FlatRelationship struct {
	PartnerID         string    `yaml:"partner_id,omitempty"`
	Index             int       `yaml:"index,omitempty"`
	Engagement        DatePlace `yaml:"engagement,omitempty"`
	Marriage          DatePlace `yaml:"marriage,omitempty"`
	MarriageReligious DatePlace `yaml:"marriage_religious,omitempty"`
	Divorce           DatePlace `yaml:"divorce,omitempty"`
	ChildrenCount     *uint     `yaml:"children_count,omitempty"`

	Person FlatPerson `yaml:"-"`
}

func (FlatRelationship) GetChildrenCount

func (f FlatRelationship) GetChildrenCount() *uint

func (FlatRelationship) GetDivorce

func (f FlatRelationship) GetDivorce() *DatePlace

func (FlatRelationship) GetEngagement

func (f FlatRelationship) GetEngagement() *DatePlace

func (FlatRelationship) GetEngagementDuration

func (r FlatRelationship) GetEngagementDuration(a Person, referenceDate time.Time) timecalc.Duration

func (FlatRelationship) GetIndex

func (f FlatRelationship) GetIndex() int

func (FlatRelationship) GetMarriage

func (f FlatRelationship) GetMarriage() *DatePlace

func (FlatRelationship) GetMarriageDuration

func (r FlatRelationship) GetMarriageDuration(a Person, referenceDate time.Time) timecalc.Duration

func (FlatRelationship) GetMarriageReligious

func (f FlatRelationship) GetMarriageReligious() *DatePlace

func (FlatRelationship) GetMarriageReligiousDuration

func (r FlatRelationship) GetMarriageReligiousDuration(a Person, referenceDate time.Time) timecalc.Duration

func (FlatRelationship) GetPartner

func (f FlatRelationship) GetPartner() (Person, error)

func (FlatRelationship) GetPartnerOrDummy

func (f FlatRelationship) GetPartnerOrDummy() Person

func (FlatRelationship) HasChildrenCount

func (f FlatRelationship) HasChildrenCount() bool

func (*FlatRelationship) SetChildrenCount

func (f *FlatRelationship) SetChildrenCount(childrenCount *uint)

type FootnoteContainer

type FootnoteContainer struct {
	// contains filtered or unexported fields
}

func NewFootnoteContainer

func NewFootnoteContainer() *FootnoteContainer

func (*FootnoteContainer) Add

func (f *FootnoteContainer) Add(key string) bool

func (*FootnoteContainer) GetLabel

func (f *FootnoteContainer) GetLabel(search string) string

func (*FootnoteContainer) GetLabelFor

func (f *FootnoteContainer) GetLabelFor(input string) string

func (*FootnoteContainer) Has

func (f *FootnoteContainer) Has(search string) bool

type Gender

type Gender int8

Gender x ENUM( unknown male female )

const (
	// GenderUnknown is a Gender of type Unknown
	GenderUnknown Gender = iota
	// GenderMale is a Gender of type Male
	GenderMale
	// GenderFemale is a Gender of type Female
	GenderFemale
)

func ParseGender

func ParseGender(name string) (Gender, error)

ParseGender attempts to convert a string to a Gender

func (Gender) IsUnknown

func (g Gender) IsUnknown() bool

func (Gender) String

func (x Gender) String() string

String implements the Stringer interface.

type GenderOrder

type GenderOrder int
ENUM(

MaleFirst = 1 FemaleFirst

const (
	// GenderOrderMaleFirst is a GenderOrder of type MaleFirst
	GenderOrderMaleFirst GenderOrder = iota + 1
	// GenderOrderFemaleFirst is a GenderOrder of type FemaleFirst
	GenderOrderFemaleFirst
)

func ParseGenderOrder

func ParseGenderOrder(name string) (GenderOrder, error)

ParseGenderOrder attempts to convert a string to a GenderOrder

func (GenderOrder) String

func (x GenderOrder) String() string

String implements the Stringer interface.

type GraphType

type GraphType int
ENUM(

parent = 1 child sandclock

const (
	// GraphTypeParent is a GraphType of type Parent
	GraphTypeParent GraphType = iota + 1
	// GraphTypeChild is a GraphType of type Child
	GraphTypeChild
	// GraphTypeSandclock is a GraphType of type Sandclock
	GraphTypeSandclock
)

func ParseGraphType

func ParseGraphType(name string) (GraphType, error)

ParseGraphType attempts to convert a string to a GraphType

func (GraphType) String

func (x GraphType) String() string

String implements the Stringer interface.

type Job

type Job struct {
	Type    string `yaml:",omitempty"`
	Company string `yaml:",omitempty"`
	Place   string `yaml:",omitempty"`
	From    string `yaml:",omitempty"`
	To      string `yaml:",omitempty"`

	DateSources ReferenceList `yaml:"date-sources,omitempty"`
	Sources     ReferenceList `yaml:",omitempty"`
}

type LastnamePolicy

type LastnamePolicy int
ENUM(

Birth = 1 Current CurrentAndBirth

const (
	// LastnamePolicyBirth is a LastnamePolicy of type Birth
	LastnamePolicyBirth LastnamePolicy = iota + 1
	// LastnamePolicyCurrent is a LastnamePolicy of type Current
	LastnamePolicyCurrent
	// LastnamePolicyCurrentAndBirth is a LastnamePolicy of type CurrentAndBirth
	LastnamePolicyCurrentAndBirth
)

func ParseLastnamePolicy

func ParseLastnamePolicy(name string) (LastnamePolicy, error)

ParseLastnamePolicy attempts to convert a string to a LastnamePolicy

func (LastnamePolicy) String

func (x LastnamePolicy) String() string

String implements the Stringer interface.

type Level

type Level interface {
	GetColor() LevelColor
	GetBoxOptions() LevelBoxOptions
	GetOptions() LevelOptions
	SetColor(c LevelColor)
	SetBoxOptions(b LevelBoxOptions)
	SetOptions(b LevelOptions)
}

func Merge

func Merge(a, b Level) Level

func MergeWithBase

func MergeWithBase(a, b Level) Level

type LevelBoxOptions

type LevelBoxOptions struct {
	Main string `yaml:"main,omitempty"`
	Leaf string `yaml:"leaf,omitempty"`
}

func (*LevelBoxOptions) Equals

func (lo *LevelBoxOptions) Equals(other LevelBoxOptions) bool

func (*LevelBoxOptions) IsEmpty

func (lo *LevelBoxOptions) IsEmpty() bool

func (*LevelBoxOptions) Merge

func (lo *LevelBoxOptions) Merge(inheritedOpts LevelBoxOptions) *LevelBoxOptions

Merge does append!

type LevelColor

type LevelColor struct {
	Main string `yaml:"main,omitempty"`
	Leaf string `yaml:"leaf,omitempty"`
}

func (*LevelColor) Equals

func (lc *LevelColor) Equals(other LevelColor) bool

func (*LevelColor) IsEmpty

func (lc *LevelColor) IsEmpty() bool

func (*LevelColor) MergeWithBase

func (lc *LevelColor) MergeWithBase(lc2 *LevelColor) *LevelColor

merge with default

func (*LevelColor) OverwriteWith

func (lc *LevelColor) OverwriteWith(lc2 *LevelColor) *LevelColor

overwrite

type LevelConfig

type LevelConfig struct {
	Absolute []AbsoluteLevel `yaml:"absolute,omitempty"`
	Relative []RelativeLevel `yaml:"relative,omitempty"`

	// globals
	Color      LevelColor      `yaml:"color,omitempty"`
	BoxOptions LevelBoxOptions `yaml:"box-options,omitempty"`
	Options    LevelOptions    `yaml:"options,omitempty"`

	Themes []string `yaml:"themes,omitempty"`

	// generated
	Combined []AbsoluteLevel `yaml:"-"`
}

func (*LevelConfig) AddDefaultLevels

func (l *LevelConfig) AddDefaultLevels(from, to int) *LevelConfig

func (*LevelConfig) Combine

func (l *LevelConfig) Combine(probandLevel int)

func (*LevelConfig) Inherit

func (l *LevelConfig) Inherit(probandLevel int, baseConfig LevelConfig) *LevelConfig

func (*LevelConfig) SetGlobals

func (l *LevelConfig) SetGlobals() *LevelConfig

type LevelOptions

type LevelOptions string

func (*LevelOptions) Merge

func (lo *LevelOptions) Merge(inheritedOpts LevelOptions) *LevelOptions

type LineageContainer

type LineageContainer struct {
	// contains filtered or unexported fields
}

func NewLineageContainer

func NewLineageContainer() *LineageContainer

func (*LineageContainer) Add

func (l *LineageContainer) Add(ID, treePositionID string, personList PersonList) *LineageContainer

Add adds two entries. One with the key, one with the TreePositionID that is calculated on the fly

func (*LineageContainer) AddWithBase

func (l *LineageContainer) AddWithBase(ID, treePositionID, baseID string, person Person) *LineageContainer

func (*LineageContainer) Get

func (l *LineageContainer) Get(ID string) *PersonList

func (*LineageContainer) String

func (l *LineageContainer) String() string

type Location

type Location struct {
	City    string `yaml:",omitempty"`
	Place   string `yaml:",omitempty"`
	Country string `yaml:",omitempty"`

	CitySources    ReferenceList `yaml:"city_sources,omitempty"`
	PlaceSources   ReferenceList `yaml:"place_sources,omitempty"`
	CountrySources ReferenceList `yaml:"country_sources,omitempty"`
	Sources        ReferenceList `yaml:",omitempty"`
}

type Marriage

type Marriage struct {
	DatePlace
	Partner Person
}

type MemoryDatabase

type MemoryDatabase struct {
	Persons []*FlatPerson
	Sources []Source // TODO Familybook sollte Source heißen und Source eher Reference
	// contains filtered or unexported fields
}

func LoadDatabases

func LoadDatabases(paths []string, baseDir string) (*MemoryDatabase, error)

func NewMemoryDatabase

func NewMemoryDatabase() *MemoryDatabase

func (MemoryDatabase) Anonymize

func (y MemoryDatabase) Anonymize()

func (*MemoryDatabase) Get

func (y *MemoryDatabase) Get(search string) (Person, error)

func (*MemoryDatabase) GetByID

func (y *MemoryDatabase) GetByID(ID string) (Person, error)

func (*MemoryDatabase) MakeIDs

func (y *MemoryDatabase) MakeIDs(f func(p Person, d Database) error) error

func (*MemoryDatabase) ParseYamlFile

func (y *MemoryDatabase) ParseYamlFile(filename string) error

func (*MemoryDatabase) WriteYamlFile

func (y *MemoryDatabase) WriteYamlFile(filename string) error

type Name

type Name struct {
	Title string   `yaml:",omitempty"`
	First []string `yaml:",omitempty"`
	// If the used first name is different from the first element in the .First slice, it can be set using .Used
	Used  string `yaml:",omitempty"`
	Last  string `yaml:",omitempty"`
	Birth string `yaml:",omitempty"`
	Alias string `yaml:",omitempty"`
	Nick  string `yaml:",omitempty"`

	Sources ReferenceList `yaml:",omitempty"`
}

func (Name) Empty

func (n Name) Empty() bool

func (Name) FormatFull

func (n Name) FormatFull() string

FormatFull displays the full name, firstname before lastname

func (Name) FormatFullInverse

func (n Name) FormatFullInverse() string

FormatFullInverse displays the full name, lastname before firstname

func (Name) FormatFullNoBirth

func (n Name) FormatFullNoBirth() string

FormatFullNoBirth displays the full name, firstname before lastname, excluding birth name

func (Name) FormatFullNoMiddle

func (n Name) FormatFullNoMiddle() string

FormatFullNoMiddle displays the full name, firstname before lastname, without middlename(s)

func (Name) FormatFullNoMiddleNoBirth

func (n Name) FormatFullNoMiddleNoBirth() string

FormatFullNoMiddleNoBirth displays the full name, firstname before lastname, without middlename(s), excluding birth name

func (Name) GetUsedFirst

func (n Name) GetUsedFirst() string

GetUsedFirst returns the used name if it is given, the first of the first names otherwise

func (Name) IsEmpty

func (n Name) IsEmpty() bool

type NodeType

type NodeType int
ENUM(

g = 1 p c

const (
	// NodeTypeG is a NodeType of type G
	NodeTypeG NodeType = iota + 1
	// NodeTypeP is a NodeType of type P
	NodeTypeP
	// NodeTypeC is a NodeType of type C
	NodeTypeC
)

func ParseNodeType

func ParseNodeType(name string) (NodeType, error)

ParseNodeType attempts to convert a string to a NodeType

func (NodeType) String

func (x NodeType) String() string

String implements the Stringer interface.

type PartnerChildren

type PartnerChildren struct {
	Partner  Person
	Children *PersonList
}

type Person

type Person interface {
	Equals(p2 Person) bool

	SetID(id string)
	GetID() string
	GetUUID() string
	GetBestID() string
	GetGender() Gender
	MatchesIDUUID(idUUIDSearches ...string) bool
	MatchesSearch(search string) bool
	GetChildNumber() *uint
	SetChildNumber(childNumber *uint)
	GetRelationsCount() *uint
	SetRelationsCount(relationsCount *uint)
	GetName() Name
	GetBirth() DatePlace
	GetBaptism() DatePlace
	GetSaintsDay() SaintsDay
	GetDeath() DatePlace
	GetDeadState() *bool
	// GetAge returns the age in years at the given point of time. -1 iff the age can't be determined.
	GetAge(now time.Time) int
	// GetDeathAge returns the age in years when the person died. -1 iff the age can't be determined.
	GetDeathAge() int
	GetBurial() DatePlace
	// GetChildren returns all children of this person
	GetChildren() (*PersonList, error)
	HasChildrenCount() bool
	GetChildrenCount() int
	GetRawMom() string
	GetMom() (Person, error)
	SetRawMom(string)
	GetRawDad() string
	GetDad() (Person, error)
	SetRawDad(string)
	GetSiblings() (*SiblingList, error)
	GetRelationships() []Relationship
	GetRelationshipWith(partner Person) Relationship
	// GetPartners returns the list partners that are known for this person
	// A partner is a person that
	// - has been married with this person for any given moment in the past
	// OR
	// - had at least one child with this partner for any given moment in the past
	GetPartners() (*PersonList, error)
	// GetChildrenWith returns the list of children of this person with a given partner
	GetChildrenWith(partner Person) (*PersonList, error)
	// GetChildrenParents returns the list partners that person has children with (possibly including `nil` iff there is children where no other parent is known)
	GetChildrenParents() (*PersonList, error)
	GetAttributes() []string
	AddAttribute(attr string)
	GetImageFilename() string
	SetImageFilename(filename string)
	GetResidences() []Residence
	AddResidence(residence Residence)
	SetResidences(residences []Residence)
	GetJobs() []Job
	SetJobs(jobs []Job)
	AddJob(job Job)
	GetBiographyElements() []BiographyElement
	AddBiographyElement(biographyElement BiographyElement)
	SetBiographyElements(biographyElements []BiographyElement)
	GetComments() []Comment
	AddComment(comment Comment)
	SetComments(comments []Comment)
	SetStopPerson(value bool)
	IsStopPerson() bool

	IsDummy() bool
	IsEmpty() bool
	IsAlive(referenceTime time.Time) bool
	IsSpitzahn() bool

	GetTreePositionIDs() []string
	GetMainTreePositionID() string
	AddTreePositionID(ID string) Person
	ClearTreePositionIDs() Person

	// source management
	GetSources() ReferenceList
	GetGenderSources() ReferenceList

	Copy() Person
	String() string
}

Person interface

type PersonList

type PersonList struct {
	// contains filtered or unexported fields
}

PersonList is a model for collection of persons

func NewPersonList

func NewPersonList() PersonList

func NewPersonListByIDs

func NewPersonListByIDs(database Database, IDs []string) (PersonList, error)

func NewPersonListWithDatabase

func NewPersonListWithDatabase(database Database) PersonList

func (*PersonList) AddChildren

func (p *PersonList) AddChildren() (*PersonList, error)

func (*PersonList) AddList

func (p *PersonList) AddList(personList *PersonList) *PersonList

func (*PersonList) AddParents

func (p *PersonList) AddParents() (*PersonList, error)

func (*PersonList) AddPerson

func (p *PersonList) AddPerson(person Person) *PersonList

func (*PersonList) AddSlice

func (p *PersonList) AddSlice(persons []Person) *PersonList

func (*PersonList) Contains

func (p *PersonList) Contains(person Person) bool

func (*PersonList) Count

func (p *PersonList) Count() int

func (*PersonList) Diff

func (p *PersonList) Diff(otherList *PersonList) (*PersonList, error)

func (*PersonList) Exclude

func (p *PersonList) Exclude(persons ...Person)

func (*PersonList) ExcludeList

func (p *PersonList) ExcludeList(persons *PersonList)

func (*PersonList) GetAttributes

func (p *PersonList) GetAttributes() []AttributePersons

func (*PersonList) GetChildren

func (p *PersonList) GetChildren() (PersonList, error)

func (*PersonList) GetFiltered

func (p *PersonList) GetFiltered(validationFunc func(p Person) bool) *PersonList

func (*PersonList) GetParents

func (p *PersonList) GetParents() (PersonList, error)

func (*PersonList) GetPartners

func (p *PersonList) GetPartners() (PersonList, error)

func (*PersonList) GetPersons

func (p *PersonList) GetPersons() []Person

func (*PersonList) GetTreePositionID

func (p *PersonList) GetTreePositionID() string

GetTreePositionID calculates and returns the TreePositionID. The ID is created by concatenating all IDs in the PersonList with "-".

func (*PersonList) GetTreePositionIDWith

func (p *PersonList) GetTreePositionIDWith(person Person) string

func (*PersonList) GetWithMergedTreePositionIDs

func (p *PersonList) GetWithMergedTreePositionIDs() *PersonList

func (*PersonList) HasSameElements

func (p *PersonList) HasSameElements(other *PersonList) bool

func (*PersonList) Invert

func (p *PersonList) Invert() *PersonList

func (*PersonList) Len

func (p *PersonList) Len() int

func (*PersonList) Less

func (p *PersonList) Less(i, j int) bool

func (*PersonList) MergeTreePositions

func (p *PersonList) MergeTreePositions(other *PersonList) *PersonList

func (*PersonList) Remove

func (p *PersonList) Remove(person Person) *PersonList

func (*PersonList) RemoveDuplicatesByBestID

func (p *PersonList) RemoveDuplicatesByBestID() *PersonList

func (*PersonList) SortPersons

func (p *PersonList) SortPersons(sortFunc func(a, b Person) bool) *PersonList

func (*PersonList) Swap

func (p *PersonList) Swap(i, j int)

type RankingItem

type RankingItem struct {
	Rank         int
	Value        interface{}
	RankingValue interface{}
	Persons      *PersonList
}

type RankingList

type RankingList struct {
	RankingItems []RankingItem
	Comparator   func(a, b RankingItem) bool
	// contains filtered or unexported fields
}

func NewRankingList

func NewRankingList() *RankingList

func (*RankingList) AddItem

func (r *RankingList) AddItem(item RankingItem) *RankingList

func (*RankingList) GetItems

func (r *RankingList) GetItems() []RankingItem

func (*RankingList) GetTop

func (r *RankingList) GetTop(i int) []RankingItem

func (*RankingList) Len

func (r *RankingList) Len() int

func (*RankingList) Less

func (r *RankingList) Less(i, j int) bool

func (*RankingList) Lock

func (r *RankingList) Lock()

func (*RankingList) Swap

func (r *RankingList) Swap(i, j int)

func (*RankingList) Unlock

func (r *RankingList) Unlock()

type Reference

type Reference struct {
	ID          string `yaml:",omitempty"`
	Description string `yaml:",omitempty"`
}

Reference type

func (*Reference) Ref

func (s *Reference) Ref() string

func (*Reference) String

func (s *Reference) String() string

type ReferenceEntry

type ReferenceEntry struct {
	Key          string
	Reference    Reference
	IsMainSource bool
}

type ReferenceList

type ReferenceList []Reference

type ReferencesContainer

type ReferencesContainer struct {
	// contains filtered or unexported fields
}

func NewReferencesContainer

func NewReferencesContainer() *ReferencesContainer

func (*ReferencesContainer) Add

func (f *ReferencesContainer) Add(source Reference, isMainSource bool) string

Add returns the key given

func (*ReferencesContainer) GetKey

func (f *ReferencesContainer) GetKey(source Reference) string

func (*ReferencesContainer) GetKeyByIndex

func (f *ReferencesContainer) GetKeyByIndex(i int) string

func (*ReferencesContainer) GetLabel

func (f *ReferencesContainer) GetLabel(search Reference) string

func (*ReferencesContainer) GetLabelFor

func (f *ReferencesContainer) GetLabelFor(source Reference) string

func (*ReferencesContainer) GetMainReferences

func (f *ReferencesContainer) GetMainReferences() []ReferenceEntry

func (*ReferencesContainer) GetNonMainReferences

func (f *ReferencesContainer) GetNonMainReferences() []ReferenceEntry

func (*ReferencesContainer) GetSources

func (f *ReferencesContainer) GetSources() []ReferenceEntry

func (*ReferencesContainer) Has

func (f *ReferencesContainer) Has(search Reference) bool

func (*ReferencesContainer) SetLabelBase

func (f *ReferencesContainer) SetLabelBase(base string)

type Relationship

type Relationship interface {
	GetIndex() int
	GetPartner() (Person, error)
	GetPartnerOrDummy() Person
	GetEngagement() *DatePlace
	GetMarriage() *DatePlace
	GetMarriageReligious() *DatePlace
	GetDivorce() *DatePlace
	SetChildrenCount(childrenCount *uint)
	GetChildrenCount() *uint
	HasChildrenCount() bool

	GetEngagementDuration(Person, time.Time) timecalc.Duration
	GetMarriageDuration(Person, time.Time) timecalc.Duration
	GetMarriageReligiousDuration(Person, time.Time) timecalc.Duration
}

type RelativeLevel

type RelativeLevel struct {
	Index      int
	Color      LevelColor
	BoxOptions LevelBoxOptions `yaml:"box-options,omitempty"`
	Options    LevelOptions    `yaml:"options,omitempty"`
}

func (*RelativeLevel) GetBoxOptions

func (l *RelativeLevel) GetBoxOptions() LevelBoxOptions

func (*RelativeLevel) GetColor

func (l *RelativeLevel) GetColor() LevelColor

func (*RelativeLevel) GetOptions

func (l *RelativeLevel) GetOptions() LevelOptions

func (*RelativeLevel) SetBoxOptions

func (l *RelativeLevel) SetBoxOptions(lb LevelBoxOptions)

func (*RelativeLevel) SetColor

func (l *RelativeLevel) SetColor(lc LevelColor)

func (*RelativeLevel) SetOptions

func (l *RelativeLevel) SetOptions(lb LevelOptions)

type RenderPersonOptions

type RenderPersonOptions struct {
	NodeType         NodeType
	TemplateFilename string
	Date             time.Time

	// Display filter
	HideRootNodeHighlighting bool           `yaml:"hide-root-node-highlighting,omitempty"`
	LastnamePolicy           LastnamePolicy `yaml:"lastname-policy,omitempty"`

	// Output filter
	HideID                   bool     `yaml:"hide-id,omitempty"`
	HideAttributes           []string `yaml:"hide-attributes,omitempty"`
	HideGender               bool     `yaml:"hide-gender,omitempty"`
	HideName                 bool     `yaml:"hide-name,omitempty"`
	HideBirth                bool     `yaml:"hide-birth,omitempty"`
	ShowAge                  bool     `yaml:"show-age,omitempty"`
	HideBaptism              bool     `yaml:"hide-baptism,omitempty"`
	HideSaintsDay            bool     `yaml:"hide-saints-day,omitempty"`
	HideDeath                bool     `yaml:"hide-death,omitempty"`
	HideDeathAge             bool     `yaml:"hide-death-age,omitempty"`
	HideBurial               bool     `yaml:"hide-burial,omitempty"`
	HideImage                bool     `yaml:"hide-image,omitempty"`
	HideJobs                 bool     `yaml:"hide-jobs,omitempty"`
	HideFloruit              bool     `yaml:"hide-floruit,omitempty"`
	HideComment              bool     `yaml:"hide-comment,omitempty"`
	HideEngagement           bool     `yaml:"hide-engagement,omitempty"`
	HideMarriage             bool     `yaml:"hide-marriage,omitempty"`
	HideMarriageAge          bool     `yaml:"hide-marriage-age,omitempty"`
	HideMarriageReligious    bool     `yaml:"hide-marriage-religious,omitempty"`
	HideMarriageReligiousAge bool     `yaml:"hide-marriage-religious-age,omitempty"`
	HideDivorce              bool     `yaml:"hide-divorce,omitempty"`

	// special filters
	HidePlaces      bool `yaml:"hide-places,omitempty"`
	HideMiddleNames bool `yaml:"hide-middle-names,omitempty"`
}

func (*RenderPersonOptions) HideAllData

func (o *RenderPersonOptions) HideAllData()

func (*RenderPersonOptions) HideImageByLevel

func (o *RenderPersonOptions) HideImageByLevel(treeOptions RenderTreeOptions, currentLevel int) *RenderPersonOptions

func (*RenderPersonOptions) SetDefaults

func (o *RenderPersonOptions) SetDefaults() *RenderPersonOptions

type RenderTreeOptions

type RenderTreeOptions struct {
	RenderPersonOptions *RenderPersonOptions `yaml:"render-person-options,omitempty"`

	TemplateFilenameTree               string `yaml:"template-filename-tree,omitempty"`
	TemplateFilenamePerson             string `yaml:"template-filename-person,omitempty"`
	TemplateFilenameParentTree         string `yaml:"template-filename-parent-tree,omitempty"`
	TemplateFilenameParentTreeHeadless string `yaml:"template-filename-parent-tree-headless,omitempty"`
	TemplateFilenameChildTree          string `yaml:"template-filename-child-tree,omitempty"`
	TemplateFilenameUnionTree          string `yaml:"template-filename-union-tree,omitempty"`

	FailForIDLookup bool

	GraphType GraphType

	GenderOrder GenderOrder

	// levels
	Levels []AbsoluteLevel `yaml:"-"`

	// Limits
	IgnoreIDs                    []string `yaml:"ignore,omitempty"`
	MaxParentGenerations         int      `yaml:"max-parent-generations,omitempty"`
	MaxParentSiblingsGenerations int      `yaml:"max-parent-siblings-generations,omitempty"`
	MaxChildGenerations          int      `yaml:"max-child-generations,omitempty"`
	MaxChildPartnersGenerations  int      `yaml:"max-child-partners-generations,omitempty"`
	MinImageLevel                *int     `yaml:"min-image-level,omitempty"`
	MaxImageLevel                *int     `yaml:"max-image-level,omitempty"`

	HideFamilyIDs                   bool  `yaml:"hide-family-ids,omitempty"`
	AddPhantomChildForEmptyFamilies *bool `yaml:"add-phantom-child-for-empty-families,omitempty"`
	// contains filtered or unexported fields
}

func (*RenderTreeOptions) SetDefaults

func (o *RenderTreeOptions) SetDefaults() *RenderTreeOptions

type Residence

type Residence struct {
	CO      string `yaml:"co,omitempty"`
	Address string `yaml:",omitempty"`
	ZipCode string `yaml:"zip-code,omitempty"`
	City    string `yaml:",omitempty"`
	Place   string `yaml:",omitempty"`
	Country string `yaml:",omitempty"`
	From    string `yaml:",omitempty"`
	To      string `yaml:",omitempty"`

	DateSources ReferenceList `yaml:"date-sources,omitempty"`
	Sources     ReferenceList `yaml:",omitempty"`
}

type SaintsDay

type SaintsDay struct {
	SourcedDate `yaml:",inline"`
	Description string `yaml:",omitempty"`
}

func (SaintsDay) Empty

func (s SaintsDay) Empty() bool

func (SaintsDay) String

func (s SaintsDay) String() string

type SiblingList

type SiblingList struct {
	Common  *PersonList
	WithMom []PartnerChildren
	WithDad []PartnerChildren
}

type Source

type Source struct {
	ID          string `yaml:",omitempty"`
	Description string `yaml:",omitempty"`
	PDF         string `yaml:",omitempty"`
	Pages       string `yaml:",omitempty"`
	Rotate      int    `yaml:",omitempty"`
}

Source is the definition of a material or digital source

type SourceEntry

type SourceEntry struct {
	Key  string
	Text string
}

type SourcedDate

type SourcedDate struct {
	// need to support things like "before 1932" here
	Date    string        `yaml:",omitempty"`
	Sources ReferenceList `yaml:",omitempty"`
}

func (SourcedDate) Empty

func (s SourcedDate) Empty() bool

type SourcesContainer

type SourcesContainer struct {
	// contains filtered or unexported fields
}

func NewSourcesContainer

func NewSourcesContainer() *SourcesContainer

func (*SourcesContainer) Add

func (f *SourcesContainer) Add(key string) string

Add returns the key given

func (*SourcesContainer) GetKey

func (f *SourcesContainer) GetKey(text string) string

func (*SourcesContainer) GetKeyByIndex

func (f *SourcesContainer) GetKeyByIndex(i int) string

func (*SourcesContainer) GetLabel

func (f *SourcesContainer) GetLabel(search string) string

func (*SourcesContainer) GetLabelFor

func (f *SourcesContainer) GetLabelFor(input string) string

func (*SourcesContainer) GetMainSource

func (f *SourcesContainer) GetMainSource() SourceEntry

func (*SourcesContainer) GetNotes

func (f *SourcesContainer) GetNotes() []SourceEntry

func (*SourcesContainer) Has

func (f *SourcesContainer) Has(search string) bool

func (*SourcesContainer) SetLabelBase

func (f *SourcesContainer) SetLabelBase(base string)

func (*SourcesContainer) SetMainSource

func (f *SourcesContainer) SetMainSource(mainSource SourceEntry)

type Stats

type Stats struct {
	// contains filtered or unexported fields
}

func NewStats

func NewStats(referenceDate time.Time) *Stats

func (*Stats) AliveCount

func (s *Stats) AliveCount(personList *PersonList) int

func (*Stats) AlivePersons

func (s *Stats) AlivePersons(personList *PersonList) *PersonList

func (*Stats) AvgMarriageAge

func (s *Stats) AvgMarriageAge(personList *PersonList) float64

func (*Stats) BirthDays

func (s *Stats) BirthDays(personList *PersonList) *RankingList

func (*Stats) BirthMonths

func (s *Stats) BirthMonths(personList *PersonList) *RankingList

func (*Stats) ChildrenCount

func (s *Stats) ChildrenCount(personList *PersonList) *RankingList

func (*Stats) DeadCount

func (s *Stats) DeadCount(personList *PersonList) int

func (*Stats) DeathAges

func (s *Stats) DeathAges(personList *PersonList) *RankingList

func (*Stats) DeathDays

func (s *Stats) DeathDays(personList *PersonList) *RankingList

func (*Stats) FemaleCount

func (s *Stats) FemaleCount(personList *PersonList) int

func (*Stats) GetReferenceDate

func (s *Stats) GetReferenceDate() time.Time

func (*Stats) LongestMarriages

func (s *Stats) LongestMarriages(personList *PersonList) *RankingList

func (*Stats) LongestName

func (s *Stats) LongestName(personList *PersonList) *RankingList

func (*Stats) MaleCount

func (s *Stats) MaleCount(personList *PersonList) int

func (*Stats) MarriageAges

func (s *Stats) MarriageAges(personList *PersonList) *RankingList

func (*Stats) MarriageDays

func (s *Stats) MarriageDays(personList *PersonList) *RankingList

func (*Stats) MarriedCount

func (s *Stats) MarriedCount(personList *PersonList) int

func (*Stats) MostCommonFirstNames

func (s *Stats) MostCommonFirstNames(personList *PersonList) *RankingList

func (*Stats) MostCommonLastNames

func (s *Stats) MostCommonLastNames(personList *PersonList) *RankingList

func (*Stats) MultipleAncestors

func (s *Stats) MultipleAncestors(personList *PersonList) *RankingList

func (*Stats) NewestBirths

func (s *Stats) NewestBirths(personList *PersonList) *RankingList

func (*Stats) NonUniqueBirthdays

func (s *Stats) NonUniqueBirthdays(personList *PersonList) *RankingList

func (*Stats) NonUniqueNames

func (s *Stats) NonUniqueNames(personList *PersonList) *RankingList

func (*Stats) Oldest

func (s *Stats) Oldest(personList *PersonList) *RankingList

func (*Stats) OldestBirths

func (s *Stats) OldestBirths(personList *PersonList) *RankingList

func (*Stats) ShortestName

func (s *Stats) ShortestName(personList *PersonList) *RankingList

func (*Stats) TotalAgeLiving

func (s *Stats) TotalAgeLiving(personList *PersonList) int64

func (*Stats) UniqueFirstNames

func (s *Stats) UniqueFirstNames(personList *PersonList) *RankingList

type YamlDatabase

type YamlDatabase struct {
	Persons        []*FlatPerson `yaml:",omitempty"`
	Sources        []Source      `yaml:",omitempty"`
	DefaultSources []Reference   `yaml:"default-sources,omitempty"`
}

Directories

Path Synopsis
cmd
generations command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址