model

package
v0.0.0-...-4d529e0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Unlicense Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FactCategoryAKA                   = "Also known as"
	FactCategoryMilitaryServiceNumber = "Military service number"
	FactCategoryCauseOfDeath          = "Cause of death"
)
View Source
const (
	FamilyBondMarried         = "married"
	FamilyBondUnmarried       = "unmarried"
	FamilyBondLikelyMarried   = "likely married"
	FamilyBondLikelyUnmarried = "likely unmarried"
	FamilyBondUnknown         = "unknown"

	FamilyEndReasonUnknown  = "unknown"
	FamilyEndReasonDivorce  = "divorce"
	FamilyEndReasonDeath    = "death"
	FamilyEndReasonAnulment = "anulment"
)
View Source
const (
	GenderMale    = "man"
	GenderFemale  = "woman"
	GenderUnknown = "unknown"
)
View Source
const (
	InferenceTypeYearOfBirth = "Year of birth"
	InferenceTypeYearOfDeath = "Year of death"
	InferenceTypeModeOfDeath = "Mode of death"
	InferenceTypeGeneralFact = "General fact"
)
View Source
const (
	UnknownNamePlaceholder      = "–?–" // en dashes, sorts after other names
	UnknownDateRangePlaceholder = "–?–"
)
View Source
const (
	PlaceTypeUnknown  = "place"
	PlaceTypeAddress  = "address"
	PlaceTypeCountry  = "country"
	PlaceTypeBuilding = "building"
	PlaceTypeStreet   = "street"
)
View Source
const MaxDistance = 1000

Variables

This section is empty.

Functions

func ApplyAndRecurseAncestors

func ApplyAndRecurseAncestors(p *Person, fn PersonActionFunc) error

ApplyAndRecurseAncestors applies fn to p and then recurses ancestors until fn returns false or an error, which is returned if encountered

func ApplyAndRecurseDescendants

func ApplyAndRecurseDescendants(p *Person, fn PersonActionFunc) error

ApplyAndRecurseDescendants applies fn to p and then recurses descendants until fn returns false or an error which is returned if encountered

func RecurseDescendantsAndApply

func RecurseDescendantsAndApply(p *Person, fn PersonActionFunc) error

RecurseDescendantsAndApply recurses descendants and then applies fn to p until fn returns an error which is returned if encountered. This differs from ApplyAndRecurseDescendants in the order in which fn is applied.

func SortPeople

func SortPeople(people []*Person)

func SortTimelineEvents

func SortTimelineEvents(evs []TimelineEvent)

func YearsSinceDeath

func YearsSinceDeath(p *Person) (int, bool)

Types

type AnnulmentEvent

type AnnulmentEvent struct {
	GeneralEvent
	GeneralPartyEvent
}

AnnulmentEvent represents the ending of a marriage by anulment in a timeline

func (*AnnulmentEvent) GetParty1

func (e *AnnulmentEvent) GetParty1() *Person

func (*AnnulmentEvent) GetParty2

func (e *AnnulmentEvent) GetParty2() *Person

func (*AnnulmentEvent) ShortDescription

func (e *AnnulmentEvent) ShortDescription() string

func (*AnnulmentEvent) Type

func (e *AnnulmentEvent) Type() string

func (*AnnulmentEvent) What

func (e *AnnulmentEvent) What() string

type Anomaly

type Anomaly struct {
	Category AnomalyCategory
	Text     string
	Context  string
}

An Anomaly is something detected in existing data that can be corrected manually

type AnomalyCategory

type AnomalyCategory string
const (
	AnomalyCategoryAttribute AnomalyCategory = "Attribute"
	AnomalyCategoryCitation  AnomalyCategory = "Citation"
	AnomalyCategoryEvent     AnomalyCategory = "Event"
	AnomalyCategoryName      AnomalyCategory = "Name"
)

func (AnomalyCategory) String

func (c AnomalyCategory) String() string

type ArrivalEvent

type ArrivalEvent struct {
	GeneralEvent
	GeneralIndividualEvent
}

ArrivalEvent represents the arrival of a person at a place

func (*ArrivalEvent) ShortDescription

func (e *ArrivalEvent) ShortDescription() string

func (*ArrivalEvent) Type

func (e *ArrivalEvent) Type() string

func (*ArrivalEvent) What

func (e *ArrivalEvent) What() string

type Association

type Association struct {
	Kind      AssociationKind
	Other     *Person
	Citations []*GeneralCitation
}

type AssociationKind

type AssociationKind string
const (
	AssociationKindTwin AssociationKind = "twin"
)

type BaptismEvent

type BaptismEvent struct {
	GeneralEvent
	GeneralIndividualEvent
}

BaptismEvent represents the baptism of a person in their timeline

func (*BaptismEvent) ShortDescription

func (e *BaptismEvent) ShortDescription() string

func (*BaptismEvent) Type

func (e *BaptismEvent) Type() string

func (*BaptismEvent) What

func (e *BaptismEvent) What() string

type BirthEvent

type BirthEvent struct {
	GeneralEvent
	GeneralIndividualEvent
}

BirthEvent represents the birth of a person in their timeline

func (*BirthEvent) ShortDescription

func (e *BirthEvent) ShortDescription() string

func (*BirthEvent) Type

func (e *BirthEvent) Type() string

func (*BirthEvent) What

func (e *BirthEvent) What() string

type BurialEvent

type BurialEvent struct {
	GeneralEvent
	GeneralIndividualEvent
}

BurialEvent represents the burial of a person in their timeline

func (*BurialEvent) ShortDescription

func (e *BurialEvent) ShortDescription() string

func (*BurialEvent) Type

func (e *BurialEvent) Type() string

func (*BurialEvent) What

func (e *BurialEvent) What() string

type CensusEntry

type CensusEntry struct {
	Principal      *Person
	RelationToHead CensusEntryRelation // cleaned
	Name           string              // as recorded
	Sex            string              // as recorded
	MaritalStatus  CensusEntryMaritalStatus
	Age            string // as recorded
	Occupation     string // as recorded
	PlaceOfBirth   string // as recorded
	Impairment     string // as recorded (deaf and dumb, blind, imbecile etc)
	Detail         string // any remaining unparsed detail
	Narrative      string // hand written narrative, if any
}

type CensusEntryMaritalStatus

type CensusEntryMaritalStatus string
const (
	CensusEntryMaritalStatusUnknown   CensusEntryMaritalStatus = ""
	CensusEntryMaritalStatusMarried   CensusEntryMaritalStatus = "married"
	CensusEntryMaritalStatusUnmarried CensusEntryMaritalStatus = "unmarried"
	CensusEntryMaritalStatusWidowed   CensusEntryMaritalStatus = "widowed"
	CensusEntryMaritalStatusDivorced  CensusEntryMaritalStatus = "divorced"
)

func (CensusEntryMaritalStatus) String

func (c CensusEntryMaritalStatus) String() string

type CensusEntryRelation

type CensusEntryRelation string
const (
	CensusEntryRelationUnknown       CensusEntryRelation = ""
	CensusEntryRelationHead          CensusEntryRelation = "head"
	CensusEntryRelationWife          CensusEntryRelation = "wife"
	CensusEntryRelationHusband       CensusEntryRelation = "husband"
	CensusEntryRelationSon           CensusEntryRelation = "son"
	CensusEntryRelationDaughter      CensusEntryRelation = "daughter"
	CensusEntryRelationChild         CensusEntryRelation = "child"
	CensusEntryRelationFather        CensusEntryRelation = "father"
	CensusEntryRelationMother        CensusEntryRelation = "mother"
	CensusEntryRelationUncle         CensusEntryRelation = "uncle"
	CensusEntryRelationAunt          CensusEntryRelation = "aunt"
	CensusEntryRelationLodger        CensusEntryRelation = "lodger"
	CensusEntryRelationBoarder       CensusEntryRelation = "boarder"
	CensusEntryRelationInmate        CensusEntryRelation = "inmate"
	CensusEntryRelationPatient       CensusEntryRelation = "patient"
	CensusEntryRelationServant       CensusEntryRelation = "servant"
	CensusEntryRelationNephew        CensusEntryRelation = "nephew"
	CensusEntryRelationNiece         CensusEntryRelation = "niece"
	CensusEntryRelationBrother       CensusEntryRelation = "brother"
	CensusEntryRelationSister        CensusEntryRelation = "sister"
	CensusEntryRelationSonInLaw      CensusEntryRelation = "son-in-law"
	CensusEntryRelationDaughterInLaw CensusEntryRelation = "daughter-in-law"
	CensusEntryRelationFatherInLaw   CensusEntryRelation = "father-in-law"
	CensusEntryRelationMotherInLaw   CensusEntryRelation = "mother-in-law"
	CensusEntryRelationBrotherInLaw  CensusEntryRelation = "brother-in-law"
	CensusEntryRelationSisterInLaw   CensusEntryRelation = "sister-in-law"
	CensusEntryRelationGrandson      CensusEntryRelation = "grandson"
	CensusEntryRelationGranddaughter CensusEntryRelation = "granddaughter"
	CensusEntryRelationVisitor       CensusEntryRelation = "visitor"
	CensusEntryRelationSoldier       CensusEntryRelation = "soldier"
	CensusEntryRelationFosterChild   CensusEntryRelation = "foster child"
)

These can all be followed by " of the head of the household." (except head and any impersonal ones)

func (CensusEntryRelation) IsImpersonal

func (r CensusEntryRelation) IsImpersonal() bool

IsImpersonal reports whether the relation is to the place rather than the head

func (CensusEntryRelation) String

func (r CensusEntryRelation) String() string

type CensusEvent

type CensusEvent struct {
	GeneralEvent
	Entries []*CensusEntry
}

CensusEvent represents the taking of a census in a timeline It is a shared event

func (*CensusEvent) DirectlyInvolves

func (e *CensusEvent) DirectlyInvolves(p *Person) bool

func (*CensusEvent) Entry

func (e *CensusEvent) Entry(p *Person) (*CensusEntry, bool)

func (*CensusEvent) Head

func (e *CensusEvent) Head() *Person

func (*CensusEvent) Participants

func (e *CensusEvent) Participants() []*Person

func (*CensusEvent) ShortDescription

func (e *CensusEvent) ShortDescription() string

func (*CensusEvent) Type

func (e *CensusEvent) Type() string

func (*CensusEvent) What

func (e *CensusEvent) What() string

type CitationMatcher

type CitationMatcher func(*GeneralCitation) bool

type CremationEvent

type CremationEvent struct {
	GeneralEvent
	GeneralIndividualEvent
}

CremationEvent represents the cremation of a person in their timeline

func (*CremationEvent) ShortDescription

func (e *CremationEvent) ShortDescription() string

func (*CremationEvent) Type

func (e *CremationEvent) Type() string

func (*CremationEvent) What

func (e *CremationEvent) What() string

type Crop

type Crop struct {
	Left   int
	Top    int
	Width  int
	Height int
}

type Date

type Date struct {
	Date       gdate.Date
	Derivation DateDerivation
}

func AboutYear

func AboutYear(y int) *Date

func AfterYear

func AfterYear(y int) *Date

func BeforeYear

func BeforeYear(y int) *Date

func PreciseDate

func PreciseDate(y, m, d int) *Date

func UnknownDate

func UnknownDate() *Date

func WithinDecade

func WithinDecade(y int) *Date

func Year

func Year(y int) *Date

func YearRange

func YearRange(l, u int) *Date

func (*Date) DateInYear

func (d *Date) DateInYear(long bool) (string, bool)

func (*Date) DecadeStart

func (d *Date) DecadeStart() (int, bool)

func (*Date) IntervalUntil

func (d *Date) IntervalUntil(other *Date) *Interval

func (*Date) IsFirm

func (d *Date) IsFirm() bool

IsEstimated reports whether d is a firm date or date range. Imprecise or estimated dates return false.

func (*Date) IsUnknown

func (d *Date) IsUnknown() bool

IsUnknown reports whether d is an Unknown date

func (*Date) SameYear

func (d *Date) SameYear(other *Date) bool

func (*Date) SortsBefore

func (d *Date) SortsBefore(other *Date) bool

func (*Date) String

func (d *Date) String() string

func (*Date) When

func (d *Date) When() string

func (*Date) WhenYear

func (d *Date) WhenYear() (string, bool)

func (*Date) WholeYearsUntil

func (d *Date) WholeYearsUntil(other *Date) (int, bool)

func (*Date) YMD

func (d *Date) YMD() (int, int, int, bool)

func (*Date) Year

func (d *Date) Year() (int, bool)

type DateDerivation

type DateDerivation int
const (
	DateDerivationStandard   DateDerivation = 0 // date is as given in source
	DateDerivationEstimated  DateDerivation = 1 // date was estimated from typical values (such as year of birth estimated from marriage)
	DateDerivationCalculated DateDerivation = 2 // date was calculated from another date (such as date of birth calculated using age at death)
)

func (DateDerivation) Qualifier

func (d DateDerivation) Qualifier() string

type DeathEvent

type DeathEvent struct {
	GeneralEvent
	GeneralIndividualEvent
}

DeathEvent represents the death of a person in their timeline

func (*DeathEvent) ShortDescription

func (e *DeathEvent) ShortDescription() string

func (*DeathEvent) Type

func (e *DeathEvent) Type() string

func (*DeathEvent) What

func (e *DeathEvent) What() string

type DepartureEvent

type DepartureEvent struct {
	GeneralEvent
	GeneralIndividualEvent
}

DepartureEvent represents the departure of a person from a place

func (*DepartureEvent) ShortDescription

func (e *DepartureEvent) ShortDescription() string

func (*DepartureEvent) Type

func (e *DepartureEvent) Type() string

func (*DepartureEvent) What

func (e *DepartureEvent) What() string

type DivorceEvent

type DivorceEvent struct {
	GeneralEvent
	GeneralPartyEvent
}

DivorceEvent represents the ending of a marriage by divorce in a timeline

func (*DivorceEvent) GetParty1

func (e *DivorceEvent) GetParty1() *Person

func (*DivorceEvent) GetParty2

func (e *DivorceEvent) GetParty2() *Person

func (*DivorceEvent) ShortDescription

func (e *DivorceEvent) ShortDescription() string

func (*DivorceEvent) Type

func (e *DivorceEvent) Type() string

func (*DivorceEvent) What

func (e *DivorceEvent) What() string

type EventDateType

type EventDateType string
const (
	EventDateTypeOccurred EventDateType = "occurred" // the date represents the date the event occurred
	EventDateTypeRecorded EventDateType = "recorded" // the date represents the date the event was recorded
)

type EventMatcher

type EventMatcher func(TimelineEvent) bool

type Fact

type Fact struct {
	Category  string
	Detail    string
	Citations []*GeneralCitation
}

func ParseCauseOfDeathFact

func ParseCauseOfDeathFact(text string, citations []*GeneralCitation) *Fact

type Family

type Family struct {
	ID string // canonical id
	// Page                string   // path to page in site
	Tags                []string // tags to add to the person's page
	PreferredUniqueName string   // name used to identify the family
	Father              *Person
	Mother              *Person
	Children            []*Person
	BestStartEvent      TimelineEvent // event that best represents the start of the family unit if the bond is a marriage type
	BestEndEvent        TimelineEvent // event that best represents the end of the family unit if the bond is a marriage type

	BestStartDate *Date // date that best represents the start of the family unit
	BestEndDate   *Date // date that best represents the end of the family unit

	Timeline       []TimelineEvent
	Bond           string  // the kind of bond between the parents in the family
	EndReason      string  // the reason the family unit ended
	EndDeathPerson *Person // the person whose death ended the family unit, if any
}

func (*Family) OtherParent

func (f *Family) OtherParent(p *Person) *Person

type FamilyEndEvent

type FamilyEndEvent struct {
	GeneralEvent
	GeneralPartyEvent
}

FamilyEndEvent represents the end of a family grouping, if no other more specific event is available

func (*FamilyEndEvent) GetParty1

func (e *FamilyEndEvent) GetParty1() *Person

func (*FamilyEndEvent) GetParty2

func (e *FamilyEndEvent) GetParty2() *Person

func (*FamilyEndEvent) ShortDescription

func (e *FamilyEndEvent) ShortDescription() string

func (*FamilyEndEvent) What

func (e *FamilyEndEvent) What() string

type FamilyStartEvent

type FamilyStartEvent struct {
	GeneralEvent
	GeneralPartyEvent
}

FamilyStartEvent represents the start of a family grouping, if no other more specific event is available

func (*FamilyStartEvent) GetParty1

func (e *FamilyStartEvent) GetParty1() *Person

func (*FamilyStartEvent) GetParty2

func (e *FamilyStartEvent) GetParty2() *Person

func (*FamilyStartEvent) ShortDescription

func (e *FamilyStartEvent) ShortDescription() string

func (*FamilyStartEvent) What

func (e *FamilyStartEvent) What() string

type FeatureImage

type FeatureImage struct {
	MediaObject MediaObject
	Crop        Crop
}

type Gender

type Gender string

func (Gender) ChildNoun

func (g Gender) ChildNoun() string

func (Gender) IsFemale

func (g Gender) IsFemale() bool

func (Gender) IsMale

func (g Gender) IsMale() bool

func (Gender) IsUnknown

func (g Gender) IsUnknown() bool

func (Gender) Noun

func (g Gender) Noun() string

func (Gender) ObjectPronoun

func (g Gender) ObjectPronoun() string

func (Gender) Opposite

func (g Gender) Opposite() Gender

func (Gender) PossessivePronounPlural

func (g Gender) PossessivePronounPlural() string

func (Gender) PossessivePronounSingular

func (g Gender) PossessivePronounSingular() string

func (Gender) ReflexivePronoun

func (g Gender) ReflexivePronoun() string

func (Gender) RelationToChildrenNoun

func (g Gender) RelationToChildrenNoun() string

RelationToChildrenNoun returns the general noun to use for child relation: father/mother or parent if gender is unknown (this person is the ___ of their child)

func (Gender) RelationToParentNoun

func (g Gender) RelationToParentNoun() string

RelationToParentNoun returns the general noun to use for parent relation: son/daughter or child if gender is unknown (this person is the ___ of their parent)

func (Gender) RelationToSiblingNoun

func (g Gender) RelationToSiblingNoun() string

RelationToSpouseNoun returns the general noun to use for sibling relation: brother/sister or sibling if gender is unknown (this person is the ___ of their sibling)

func (Gender) RelationToSpouseNoun

func (g Gender) RelationToSpouseNoun() string

RelationToSpouseNoun returns the general noun to use for spouse relation: husband/wife or spouse if gender is unknown (this person is the ___ of their spouse)

func (Gender) RelationToSpouseNounPlural

func (g Gender) RelationToSpouseNounPlural() string

func (Gender) SubjectPronoun

func (g Gender) SubjectPronoun() string
func (g Gender) SubjectPronounWithLink() string

func (Gender) WidowWidower

func (g Gender) WidowWidower() string

WidowWidower returns a word that fits the sentence: "when their spouse died, x was left a <widow/widower>"

type GeneralCitation

type GeneralCitation struct {
	Date              *Date
	Source            *Source
	Detail            string
	ID                string
	TranscriptionDate *Date
	TranscriptionText []Text
	URL               *Link
	MediaObjects      []*MediaObject
	EventsCited       []TimelineEvent
	PeopleCited       []*Person
}

func FilterCitationList

func FilterCitationList(cits []*GeneralCitation, include CitationMatcher) []*GeneralCitation

FilterCitationList returns a new slice that includes only the ciitations that match the supplied CitationMatcher

func (*GeneralCitation) String

func (c *GeneralCitation) String() string

type GeneralEvent

type GeneralEvent struct {
	Date      *Date
	Place     *Place
	Title     string
	Detail    string
	Citations []*GeneralCitation
	Inferred  bool
	Narrative string // hand written narrative, if any
}

func (*GeneralEvent) EventDate

func (e *GeneralEvent) EventDate() *Date

func (*GeneralEvent) GetCitations

func (e *GeneralEvent) GetCitations() []*GeneralCitation

func (*GeneralEvent) GetDate

func (e *GeneralEvent) GetDate() *Date

func (*GeneralEvent) GetDateType

func (e *GeneralEvent) GetDateType() EventDateType

func (*GeneralEvent) GetDetail

func (e *GeneralEvent) GetDetail() string

func (*GeneralEvent) GetNarrative

func (e *GeneralEvent) GetNarrative() string

func (*GeneralEvent) GetPlace

func (e *GeneralEvent) GetPlace() *Place

func (*GeneralEvent) GetTitle

func (e *GeneralEvent) GetTitle() string

func (*GeneralEvent) IsInferred

func (e *GeneralEvent) IsInferred() bool

func (*GeneralEvent) ShortDescription

func (e *GeneralEvent) ShortDescription() string

func (*GeneralEvent) SortsBefore

func (e *GeneralEvent) SortsBefore(other TimelineEvent) bool

func (*GeneralEvent) Type

func (e *GeneralEvent) Type() string

func (*GeneralEvent) What

func (e *GeneralEvent) What() string

func (*GeneralEvent) When

func (e *GeneralEvent) When() string

func (*GeneralEvent) Where

func (e *GeneralEvent) Where() string

type GeneralIndividualEvent

type GeneralIndividualEvent struct {
	Principal *Person
}

GeneralPartyEvent is a general event involving one individual.

func (*GeneralIndividualEvent) DirectlyInvolves

func (e *GeneralIndividualEvent) DirectlyInvolves(p *Person) bool

func (*GeneralIndividualEvent) GetPrincipal

func (e *GeneralIndividualEvent) GetPrincipal() *Person

func (*GeneralIndividualEvent) Participants

func (e *GeneralIndividualEvent) Participants() []*Person

type GeneralPartyEvent

type GeneralPartyEvent struct {
	Party1 *Person
	Party2 *Person
}

GeneralPartyEvent is a general event involving two principal parties.

func (*GeneralPartyEvent) DirectlyInvolves

func (e *GeneralPartyEvent) DirectlyInvolves(p *Person) bool

func (*GeneralPartyEvent) GetOther

func (e *GeneralPartyEvent) GetOther(p *Person) *Person

func (*GeneralPartyEvent) GetParty1

func (e *GeneralPartyEvent) GetParty1() *Person

func (*GeneralPartyEvent) GetParty2

func (e *GeneralPartyEvent) GetParty2() *Person

func (*GeneralPartyEvent) Participants

func (e *GeneralPartyEvent) Participants() []*Person

type IndividualNarrativeEvent

type IndividualNarrativeEvent struct {
	GeneralEvent
	GeneralIndividualEvent
}

IndividualNarrativeEvent represents some narrative that can be used as-is

func (*IndividualNarrativeEvent) ShortDescription

func (e *IndividualNarrativeEvent) ShortDescription() string

func (*IndividualNarrativeEvent) What

func (e *IndividualNarrativeEvent) What() string

type IndividualTimelineEvent

type IndividualTimelineEvent interface {
	TimelineEvent
	GetPrincipal() *Person
}

GeneralPartyEvent is a timeline event involving one individual.

type Inference

type Inference struct {
	Type   string
	Value  string
	Reason string
}

func (*Inference) AsCitation

func (inf *Inference) AsCitation() *GeneralCitation

type Interval

type Interval struct {
	Interval gdate.Interval
}

func IntervalSince

func IntervalSince(d *Date) *Interval

func UnknownInterval

func UnknownInterval() *Interval

func (*Interval) ApproxDays

func (in *Interval) ApproxDays() (int, bool)

func (*Interval) IsUnknown

func (in *Interval) IsUnknown() bool

func (*Interval) WholeYears

func (in *Interval) WholeYears() (int, bool)

func (*Interval) YMD

func (in *Interval) YMD() (int, int, int, bool)
type Link struct {
	Title string
	URL   string
}

type MarriageBannsEvent

type MarriageBannsEvent struct {
	GeneralEvent
	GeneralPartyEvent
}

MarriageBannsEvent represents the event that public notice is given that two people intend to marry

func (*MarriageBannsEvent) GetParty1

func (e *MarriageBannsEvent) GetParty1() *Person

func (*MarriageBannsEvent) GetParty2

func (e *MarriageBannsEvent) GetParty2() *Person

func (*MarriageBannsEvent) ShortDescription

func (e *MarriageBannsEvent) ShortDescription() string

func (*MarriageBannsEvent) Type

func (e *MarriageBannsEvent) Type() string

func (*MarriageBannsEvent) What

func (e *MarriageBannsEvent) What() string

type MarriageEvent

type MarriageEvent struct {
	GeneralEvent
	GeneralPartyEvent
}

MarriageEvent represents the joining of two people in marriage in a timeline

func (*MarriageEvent) ShortDescription

func (e *MarriageEvent) ShortDescription() string

func (*MarriageEvent) Type

func (e *MarriageEvent) Type() string

func (*MarriageEvent) What

func (e *MarriageEvent) What() string

type MarriageLicenseEvent

type MarriageLicenseEvent struct {
	GeneralEvent
	GeneralPartyEvent
}

MarriageLicenseEvent represents the event where two people obtain a license to marry

func (*MarriageLicenseEvent) GetParty1

func (e *MarriageLicenseEvent) GetParty1() *Person

func (*MarriageLicenseEvent) GetParty2

func (e *MarriageLicenseEvent) GetParty2() *Person

func (*MarriageLicenseEvent) ShortDescription

func (e *MarriageLicenseEvent) ShortDescription() string

func (*MarriageLicenseEvent) Type

func (e *MarriageLicenseEvent) Type() string

func (*MarriageLicenseEvent) What

func (e *MarriageLicenseEvent) What() string

type MediaObject

type MediaObject struct {
	ID          string
	SrcFilePath string
	FileName    string
	FileSize    int
	MediaType   string
	Width       int
	Height      int
	Citations   []*GeneralCitation
}

type ModeOfDeath

type ModeOfDeath string
const (
	ModeOfDeathNatural        ModeOfDeath = ""
	ModeOfDeathSuicide        ModeOfDeath = "suicide"
	ModeOfDeathLostAtSea      ModeOfDeath = "lost at sea"
	ModeOfDeathKilledInAction ModeOfDeath = "killed in action"
	ModeOfDeathDrowned        ModeOfDeath = "drowned"
	ModeOfDeathExecuted       ModeOfDeath = "executed"
)

func (ModeOfDeath) What

func (m ModeOfDeath) What() string

type Name

type Name struct {
	Name      string
	Citations []*GeneralCitation
}

type Note

type Note struct {
	Title         string
	Author        string
	Date          string
	Markdown      string
	PrimaryPerson *Person
}

type Occupation

type Occupation struct {
	StartDate   *Date
	EndDate     *Date
	Place       *Place
	Title       string
	Detail      string
	Citations   []*GeneralCitation
	Occurrences int
}

type POV

type POV struct {
	Person *Person // the person observing or experiencing the event
	Place  *Place  // the place in which the observing is taking place
}

POV represents a point of view. It is used to provide contect when constructing a description of an event.

type PartyNarrativeEvent

type PartyNarrativeEvent struct {
	GeneralEvent
	GeneralPartyEvent
}

PartyNarrativeEvent represents some narrative that can be used as-is

func (*PartyNarrativeEvent) ShortDescription

func (e *PartyNarrativeEvent) ShortDescription() string

func (*PartyNarrativeEvent) What

func (e *PartyNarrativeEvent) What() string

type PartyTimelineEvent

type PartyTimelineEvent interface {
	TimelineEvent
	GetParty1() *Person
	GetParty2() *Person
	GetOther(p *Person) *Person // returns the first of party1 or party2 that is not p
}

PartyTimelineEvent is a timeline event involving two parties.

type Person

type Person struct {
	ID string // canonical identifier
	// Page                      string    // path to page in site
	Tags                      []string  // tags to add to the person's page
	PreferredFullName         string    // full legal name
	PreferredGivenName        string    // name that can be used in prose, usually just the first name
	PreferredFamiliarName     string    // name that can be used in prose, usually just the first name or a nickname
	PreferredFamiliarFullName string    // full name using just the first name or a nickname
	PreferredFamilyName       string    // family name, or surname
	PreferredSortName         string    // name organised for sorting, generally as surname, forenames
	PreferredUniqueName       string    // a name with additional uniquely identifying information such as years of birth and death or a numeric identifier
	NickName                  string    // a name other than their given name that the are known by
	KnownNames                []*Name   // list of all known names
	Olb                       string    // One line bio
	Gender                    Gender    // male, female or unknown
	RelationToKeyPerson       *Relation // optional relation to the key person in the tree
	Father                    *Person
	Mother                    *Person
	ParentFamily              *Family                 // the family that this person is a child in
	Spouses                   []*Person               // list of people this person was in a relationship with
	Children                  []*Person               // list of people this person was considered a parent to
	Families                  []*Family               // list of families this person participated in as a parent
	VitalYears                string                  // best guess at year of birth and death in yyyy-yyyy format
	BestBirthlikeEvent        IndividualTimelineEvent // event that best represents the person's birth
	BestDeathlikeEvent        IndividualTimelineEvent // event that best represents the person's death
	Timeline                  []TimelineEvent
	BeingTense                string // tense to use when refering to person: 'is' if they are possibly alive, 'was' if they are dead

	Historic      bool // true if this person lived in a period more than a lifespan before the present (more than 120 years ago)
	PossiblyAlive bool // true if this person is possibly still alive, false if they are known to be dead or are historic
	DiedYoung     bool // true if this person died before adulthood

	Unknown            bool        // true if this person is known to have existed but no other information is known
	Unmarried          bool        // true if it is known that the person did not marry
	Childless          bool        // true if it is known that the person did not have any children
	Illegitimate       bool        // true if it is known that the person was born illegitimately
	BornInWorkhouse    bool        // true if the birth place of the person was a workhouse
	DiedInWorkhouse    bool        // true if the death place of the person was a workhouse
	Pauper             bool        // true if the person was, at some stage, noted as a pauper
	Twin               bool        // true if it is known that the person was a twin
	Blind              bool        // true if it is known that the person was blind for the majority of their life
	Deaf               bool        // true if it is known that the person was deaf for the majority of their life
	PhysicalImpairment bool        // true if it is known that the person was physically impaired for the majority of their life
	MentalImpairment   bool        // true if it is known that the person was mentally impaired for the majority of their life
	DiedInChildbirth   bool        // true if it is known that the person died in childbirth
	ModeOfDeath        ModeOfDeath // mode of death, if known
	CauseOfDeath       *Fact       // cause of death, if known
	Featured           bool        // true if this person is to be highlighted as a featured person on the tree overview
	Puzzle             bool        // true if this person is the centre of a significant puzzle

	Occupations       []*Occupation // list of occupations
	PrimaryOccupation string        // simple description of main occupation
	EditLink          *Link         // link to a page that can be used to edit the details of this person
	WikiTreeID        string        // the wikitree id of this person
	GrampsID          string        // the gramps id of this person
	Links             []Link        // list of links to more information relevant to this person

	Redacted           bool          // true if the person's details should be redacted
	RedactionKeepsName bool          // true if this person's name should be kept during redaction
	Inferences         []Inference   // list of inferences made
	Anomalies          []*Anomaly    // list of anomalies detected
	ToDos              []*ToDo       // list of todos detected
	MiscFacts          []Fact        // miscellaneous facts
	Associations       []Association // general associations with other people such as godparent or twin
	FeatureImage       *FeatureImage // an image that can be used to represent the person
	ResearchNotes      []*Note       // research notes associated with this person
}

func FilterPersonList

func FilterPersonList(people []*Person, include PersonMatcher) []*Person

FilterPersonList returns a new slice that includes only the people that match the supplied PersonMatcher

func UnknownPerson

func UnknownPerson() *Person

func (*Person) AgeInYearsAt

func (p *Person) AgeInYearsAt(dt *Date) (int, bool)

func (*Person) AgeInYearsAtDeath

func (p *Person) AgeInYearsAtDeath() (int, bool)

func (*Person) BestBirthDate

func (p *Person) BestBirthDate() *Date

func (*Person) BestDeathDate

func (p *Person) BestDeathDate() *Date

func (*Person) IsCloseToDirectAncestor

func (p *Person) IsCloseToDirectAncestor() bool

IsCloseToDirectAncestor reports whether a person is a direct ancestor or a child or spouse of a direct ancestor.

func (*Person) IsDirectAncestor

func (p *Person) IsDirectAncestor() bool

func (*Person) IsUnknown

func (p *Person) IsUnknown() bool

func (*Person) PreciseAgeAt

func (p *Person) PreciseAgeAt(dt *Date) (*gdate.PreciseInterval, bool)

func (*Person) RedactNames

func (p *Person) RedactNames(name string)

func (*Person) RelationTo

func (p *Person) RelationTo(other *Person, dt *Date) string

RelationTo returns a textual description of the relation of p to other. Returns an empty string if no relation was determined

func (*Person) RemoveDuplicateChildren

func (p *Person) RemoveDuplicateChildren()

func (*Person) RemoveDuplicateFamilies

func (p *Person) RemoveDuplicateFamilies()

func (*Person) RemoveDuplicateSpouses

func (p *Person) RemoveDuplicateSpouses()

func (*Person) SameAs

func (p *Person) SameAs(other *Person) bool

type PersonActionFunc

type PersonActionFunc func(*Person) (bool, error)

type PersonMatcher

type PersonMatcher func(*Person) bool

func PersonDoesNotHaveCommonAncestor

func PersonDoesNotHaveCommonAncestor() PersonMatcher

func PersonHasCommonAncestor

func PersonHasCommonAncestor() PersonMatcher

func PersonHasResearchNotes

func PersonHasResearchNotes() PersonMatcher

func PersonHasTag

func PersonHasTag(tag string) PersonMatcher

func PersonIsCloseToDirectAncestor

func PersonIsCloseToDirectAncestor() PersonMatcher

func PersonIsDirectAncestor

func PersonIsDirectAncestor() PersonMatcher

func PersonIsFeatured

func PersonIsFeatured() PersonMatcher

func PersonIsNotDirectAncestor

func PersonIsNotDirectAncestor() PersonMatcher

func PersonIsPuzzle

func PersonIsPuzzle() PersonMatcher

type Place

type Place struct {
	ID string // canonical identifier
	// Page                string    // path to page in site
	Tags                []string // tags to add to the place's page
	OriginalText        string   // the original text that was used to fill in the place information
	Hints               []place.Hint
	PreferredName       string          // fully parsed name but with just the minimum amount of context, such as "locality, region"
	PreferredUniqueName string          // fully parsed name but with just enough extra context to make it unique
	PreferredFullName   string          // the fully parsed name
	PreferredSortName   string          // name organised for sorting, generally as a reverse hierarchy of country, region, locality
	Parent              *Place          // the parent of this place in the administrative hierarchy
	PlaceType           PlaceType       // the type of place, such as "village", "town", "parish"
	Kind                place.PlaceKind // the kind of place
	Timeline            []TimelineEvent
	Unknown             bool    // true if this place is known to have existed but no other information is known
	Links               []Link  // list of links to more information relevant to this place
	Latitude            float64 // latitude of the place in decimal degrees, +ve is east of meridian, -ve is west
	Longitude           float64 // longitude of the place in decimal degrees, +ve is north of equator, -ve is south

	CountryName  *place.PlaceName
	UKNationName *place.PlaceName
}

func UnknownPlace

func UnknownPlace() *Place

func (*Place) IsUnknown

func (p *Place) IsUnknown() bool

func (*Place) SameAs

func (p *Place) SameAs(other *Place) bool

func (*Place) Where

func (p *Place) Where() string

type PlaceMatcher

type PlaceMatcher func(*Place) bool

func PlaceHasTag

func PlaceHasTag(tag string) PlaceMatcher

type PlaceType

type PlaceType string

func (PlaceType) InAt

func (p PlaceType) InAt() string

func (PlaceType) String

func (p PlaceType) String() string

type PlaceholderIndividualEvent

type PlaceholderIndividualEvent struct {
	GeneralEvent
	GeneralIndividualEvent
	ExtraInfo string
}

PlaceholderIndividualEvent represents an event involving one individual that has not been interpreted and is a placeholder until the necessary processing has been written.

func (*PlaceholderIndividualEvent) GetTitle

func (e *PlaceholderIndividualEvent) GetTitle() string

type PlaceholderPartyEvent

type PlaceholderPartyEvent struct {
	GeneralEvent
	GeneralPartyEvent
	ExtraInfo string
}

PlaceholderPartyEvent represents an event involving two parties that has not been interpreted and is a placeholder until the necessary processing has been written.

func (*PlaceholderPartyEvent) GetTitle

func (e *PlaceholderPartyEvent) GetTitle() string

type ProbateEvent

type ProbateEvent struct {
	GeneralEvent
	GeneralIndividualEvent
}

ProbateEvent represents the granting of probate for a person in their timeline

func (*ProbateEvent) ShortDescription

func (e *ProbateEvent) ShortDescription() string

func (*ProbateEvent) Type

func (e *ProbateEvent) Type() string

func (*ProbateEvent) What

func (e *ProbateEvent) What() string

type Relation

type Relation struct {
	From                  *Person
	To                    *Person
	CommonAncestor        *Person
	FromGenerations       int       // number of generations between the From person and CommonAncestor. 1 = common ancestor is parent of from
	ToGenerations         int       // number of generations between the To person and CommonAncestor. 1 = common ancestor is parent of to
	ClosestDirectRelation *Relation // if the To person does not share an ancestor with the From person, then this is the relation of From to a person who was the partner/spouse of a direct relation of To
	// ToSpouseGenerations   int       // number of generations between the To person and the spouse of SpouseRelation. 0 = spouse, 1 = parent of spouse
	SpouseRelation *Relation // the relationship of the To person to the spouse of the ClosestDirectRelation
}

Relation describes the relationship between the From person and the To

func Parent

func Parent(child *Person, parent *Person) *Relation

func Self

func Self(p *Person) *Relation

func Spouse

func Spouse(p *Person, spouse *Person) *Relation

func (*Relation) Distance

func (r *Relation) Distance() int

Distance computes a score for how distant the relationship is. A self relationship has score 0, a parent/child/spouse has score 1 A direct ancestor scores 1 per generation step A direct descendant scores 1 per generation step A descendant of a common ancestor scores 1 per generation step to the common ancestor and 2 per generation down beyond the first A non-direct relationship doubles the score of the closest direct relationship

func (*Relation) ExtendToChild

func (r *Relation) ExtendToChild(ch *Person) *Relation

ExtendToChild produces a new relationship extended to the child of the To person

func (*Relation) ExtendToParent

func (r *Relation) ExtendToParent(parent *Person) *Relation

ExtendToParent produces a new relationship extended to the parent of the To person

func (*Relation) ExtendToSpouse

func (r *Relation) ExtendToSpouse(spouse *Person) *Relation

ExtendToSpouse produces a new relationship extended to the spouse of the To person

func (*Relation) HasCommonAncestor

func (r *Relation) HasCommonAncestor() bool

HasCommonAncestor reports whether the From and To person have a common ancestor, including if the To person is a direct ancestor of the From person

func (*Relation) IsChild

func (r *Relation) IsChild() bool

IsChild reports whether the To person is a child of the From person

func (*Relation) IsCloseToDirectAncestor

func (r *Relation) IsCloseToDirectAncestor() bool

IsCloseToDirectAncestor reports whether To person is a direct ancestor or a child or spouse of the From person.

func (*Relation) IsDirectAncestor

func (r *Relation) IsDirectAncestor() bool

IsDirectAncestor reports whether the To person is a direct ancestor of the From person

func (*Relation) IsDirectDescendant

func (r *Relation) IsDirectDescendant() bool

IsDirectDescendant reports whether the To person is a direct descendant of the From person

func (*Relation) IsParent

func (r *Relation) IsParent() bool

IsParent reports whether the To person is a parent of the From person

func (*Relation) IsSelf

func (r *Relation) IsSelf() bool

func (*Relation) IsUnknown

func (r *Relation) IsUnknown() bool

func (*Relation) Name

func (r *Relation) Name() string

Name returns the name of the relation between From and To, in the form that "To is the Name() of From"

type Repository

type Repository struct {
	ID        string // canonical id
	Name      string
	ShortName string
}

type RepositoryRef

type RepositoryRef struct {
	Repository *Repository
	CallNo     string
}

type ResidenceRecordedEvent

type ResidenceRecordedEvent struct {
	GeneralEvent
	GeneralIndividualEvent
}

ResidenceRecordedEvent represents the event of a person's occupation being recorded / noted

func (*ResidenceRecordedEvent) GetDateType

func (e *ResidenceRecordedEvent) GetDateType() EventDateType

func (*ResidenceRecordedEvent) GetTitle

func (e *ResidenceRecordedEvent) GetTitle() string

func (*ResidenceRecordedEvent) ShortDescription

func (e *ResidenceRecordedEvent) ShortDescription() string

func (*ResidenceRecordedEvent) Type

func (e *ResidenceRecordedEvent) Type() string

func (*ResidenceRecordedEvent) What

func (e *ResidenceRecordedEvent) What() string

type Source

type Source struct {
	ID                  string // canonical id
	Unknown             bool   // true if this source is known to have existed but no other information is known
	Title               string
	SearchLink          string // link to online search interface
	RepositoryName      string
	RepositoryLink      string
	RepositoryRefs      []RepositoryRef
	EventsCiting        []TimelineEvent
	Tags                []string
	IsCivilRegistration bool // indicates whether this source holds civil registration records such as births marriages and deaths
	IsCensus            bool // indicates whether this source holds census records
	IsUnreliable        bool // indicates whether this source is of dubious reliability
}

func (*Source) IsUnknown

func (s *Source) IsUnknown() bool

type Text

type Text struct {
	Text      string
	Formatted bool
}

type Timeline

type Timeline struct {
	Events []TimelineEvent
}

type TimelineEvent

type TimelineEvent interface {
	GetDate() *Date
	GetDateType() EventDateType
	GetPlace() *Place
	GetTitle() string
	GetDetail() string
	GetCitations() []*GeneralCitation
	Type() string
	ShortDescription() string        // returns the abbreviated name of the event and its date, e.g. "b. 4 Jul 1928"
	What() string                    // married, born, divorced
	When() string                    // text description of date
	Where() string                   // text description of place
	IsInferred() bool                // whether or not the event was inferred to exist, i.e. has no supporting evidence
	DirectlyInvolves(p *Person) bool // whether or not the event directly involves a person as a principal or party
	Participants() []*Person
	SortsBefore(other TimelineEvent) bool
}

func CollapseEventList

func CollapseEventList(evs []TimelineEvent) []TimelineEvent

CollapseEventList returns a new slice that includes only unique events

func FilterEventList

func FilterEventList(evs []TimelineEvent, include EventMatcher) []TimelineEvent

FilterEventList returns a new slice that includes only the events that match the supplied EventMatcher

type ToDo

type ToDo struct {
	Category ToDoCategory
	Context  string
	Goal     string
	Reason   string
}

A ToDo is a task or loose end for an area of research

type ToDoCategory

type ToDoCategory string
const (
	ToDoCategoryCitations ToDoCategory = "Citation"
	ToDoCategoryMissing   ToDoCategory = "Missing Information"
	ToDoCategoryRecords   ToDoCategory = "Records"
)

func (ToDoCategory) String

func (c ToDoCategory) String() string

type WillEvent

type WillEvent struct {
	GeneralEvent
	GeneralIndividualEvent
}

WillEvent represents the writing of a will by a person in their timeline

func (*WillEvent) ShortDescription

func (e *WillEvent) ShortDescription() string

func (*WillEvent) Type

func (e *WillEvent) Type() string

func (*WillEvent) What

func (e *WillEvent) What() string

Jump to

Keyboard shortcuts

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