Documentation ¶
Index ¶
- Variables
- func CreateFile(fname string) (*os.File, error)
- func DefaultConfigDir() string
- func SaveGazeteer(filename string, g *Gazeteer) error
- func SaveIdentityMap(imFilename string, im *IdentityMap) error
- type Annotations
- func (o *Annotations) Add(kind string, id string, field string, value any) error
- func (o *Annotations) ApplyPerson(p *model.Person) error
- func (o *Annotations) ApplyPlace(p *model.Place) error
- func (o *Annotations) ApplySource(p *model.Source) error
- func (o *Annotations) ApplyTree(t *Tree) error
- func (a *Annotations) MarshalJSON() ([]byte, error)
- func (o *Annotations) Replace(kind string, id string, field string, value any) error
- func (a *Annotations) UnmarshalJSON(data []byte) error
- type AnnotationsJSON
- type Gazeteer
- func (g *Gazeteer) CleanHierarchy()
- func (g *Gazeteer) ID(original string, hints ...place.Hint) string
- func (g *Gazeteer) LookupPlace(id string) (GazeteerPlace, bool)
- func (g *Gazeteer) MarshalJSON() ([]byte, error)
- func (g *Gazeteer) MatchPlace(original string, hints ...place.Hint) (GazeteerPlace, error)
- func (g *Gazeteer) UnmarshalJSON(data []byte) error
- type GazeteerJSON
- type GazeteerPlace
- type IdentityMap
- type IdentityMapJSON
- type IdentityMappingJSON
- type Loader
- type ObjectAnnotationsJSON
- type PersonAnnotation
- type PersonMeta
- type PlaceAnnotation
- type PlaceInfoJSON
- type SourceAnnotation
- type Tree
- func (t *Tree) AddAlias(alias string, canonical string)
- func (t *Tree) AddSpouses(f *model.Family) error
- func (t *Tree) ApplyPeopleMatching(m model.PersonMatcher, fn model.PersonActionFunc) error
- func (t *Tree) BuildOlb(p *model.Person) error
- func (t *Tree) BuildRelationsToKeyPerson()
- func (t *Tree) CanonicalID(scope string, sid string) string
- func (t *Tree) CrossReferenceCitations(p *model.Person)
- func (t *Tree) ExpandPersonTimeline(p *model.Person) error
- func (t *Tree) FindCitation(scope string, sid string) (*model.GeneralCitation, bool)
- func (t *Tree) FindFamily(scope string, sid string) *model.Family
- func (t *Tree) FindFamilyByParents(father *model.Person, mother *model.Person) *model.Family
- func (t *Tree) FindFamilyOneParent(parent *model.Person, child *model.Person) *model.Family
- func (t *Tree) FindMediaObject(path string) *model.MediaObject
- func (t *Tree) FindPerson(scope string, sid string) *model.Person
- func (t *Tree) FindPlace(scope string, sid string) *model.Place
- func (t *Tree) FindPlaceUnstructured(name string, hints ...place.Hint) *model.Place
- func (t *Tree) FindRepository(scope string, sid string) *model.Repository
- func (t *Tree) FindSource(scope string, sid string) *model.Source
- func (t *Tree) Generate(redactLiving bool) error
- func (t *Tree) GetCitation(id string) (*model.GeneralCitation, bool)
- func (t *Tree) GetPerson(id string) (*model.Person, bool)
- func (t *Tree) GetPlace(id string) (*model.Place, bool)
- func (t *Tree) GetSource(id string) (*model.Source, bool)
- func (t *Tree) InferFamilyRelationships(f *model.Family) error
- func (t *Tree) InferFamilyStartEndDates(f *model.Family) error
- func (t *Tree) ListPeopleMatching(m model.PersonMatcher, limit int) []*model.Person
- func (t *Tree) ListPlacesMatching(m model.PlaceMatcher, limit int) []*model.Place
- func (t *Tree) PropagateParents(p *model.Person) error
- func (t *Tree) Redact(redactLiving bool) error
- func (t *Tree) RefinePersonNames(p *model.Person) error
- func (t *Tree) RefinePersonOccupations(p *model.Person) error
- func (t *Tree) SelectPersonBestBirthDeathEvents(p *model.Person) error
- func (t *Tree) SetKeyPerson(p *model.Person)
- func (t *Tree) TrimCitationEventsCited(c *model.GeneralCitation) error
- func (t *Tree) TrimCitationPeopleCited(c *model.GeneralCitation) error
- func (t *Tree) TrimPersonTimeline(p *model.Person) error
- func (t *Tree) TrimPlaceTimeline(p *model.Place) error
- func (t *Tree) TrimSourceTimeline(s *model.Source) error
- type TreeAnnotation
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidPlaceName = errors.New("invalid place name")
Functions ¶
func DefaultConfigDir ¶
func DefaultConfigDir() string
func SaveGazeteer ¶
func SaveIdentityMap ¶
func SaveIdentityMap(imFilename string, im *IdentityMap) error
Types ¶
type Annotations ¶
type Annotations struct {
// contains filtered or unexported fields
}
func LoadAnnotations ¶
func LoadAnnotations(filename string) (*Annotations, error)
func (*Annotations) ApplyPerson ¶
func (o *Annotations) ApplyPerson(p *model.Person) error
func (*Annotations) ApplyPlace ¶
func (o *Annotations) ApplyPlace(p *model.Place) error
func (*Annotations) ApplySource ¶
func (o *Annotations) ApplySource(p *model.Source) error
func (*Annotations) ApplyTree ¶
func (o *Annotations) ApplyTree(t *Tree) error
func (*Annotations) MarshalJSON ¶
func (a *Annotations) MarshalJSON() ([]byte, error)
func (*Annotations) UnmarshalJSON ¶
func (a *Annotations) UnmarshalJSON(data []byte) error
type AnnotationsJSON ¶
type AnnotationsJSON struct { People []ObjectAnnotationsJSON `json:"people,omitempty"` Places []ObjectAnnotationsJSON `json:"places,omitempty"` Sources []ObjectAnnotationsJSON `json:"sources,omitempty"` Trees []ObjectAnnotationsJSON `json:"trees,omitempty"` }
type Gazeteer ¶
type Gazeteer struct {
// contains filtered or unexported fields
}
func LoadGazeteer ¶
func (*Gazeteer) CleanHierarchy ¶
func (g *Gazeteer) CleanHierarchy()
func (*Gazeteer) ID ¶
ID returns the canonical identifier corresponding to the named place, creating a new one if necessary The supplied name is assumed to be generally unstructured, but ordered hierarchically from most to least specific with each heierarchy level separated by a comma. Additional context may be supplied by the use of hints. For example the user could hint that the place could be a UK registration district based on the source being the general register office.
func (*Gazeteer) LookupPlace ¶
func (g *Gazeteer) LookupPlace(id string) (GazeteerPlace, bool)
func (*Gazeteer) MarshalJSON ¶
func (*Gazeteer) MatchPlace ¶
MatchPlace returns information about the named place, creating a new one if necessary The supplied name is assumed to be generally unstructured, but ordered hierarchically from most to least specific with each heierarchy level separated by a comma. Additional context may be supplied by the use of hints. For example the user could hint that the place could be a UK registration district based on the source being the general register office.
func (*Gazeteer) UnmarshalJSON ¶
type GazeteerJSON ¶
type GazeteerJSON struct {
Places map[string]PlaceInfoJSON `json:"places"`
}
type GazeteerPlace ¶
type GazeteerPlace struct {
// contains filtered or unexported fields
}
type IdentityMap ¶
type IdentityMap struct {
// contains filtered or unexported fields
}
func LoadIdentityMap ¶
func LoadIdentityMap(imFilename string) (*IdentityMap, error)
func (*IdentityMap) AddAlias ¶
func (m *IdentityMap) AddAlias(alias string, canonical string)
AddAlias adds an alias to a canonical identifier. This can be used to create more friendly identifiers.
func (*IdentityMap) ID ¶
func (m *IdentityMap) ID(scope string, id string) string
ID returns the canonical identifier corresponding to the scoped identifier, creating a new one if necessary scope indicates the source of the supplied identifier, usually a gedcom file.
func (*IdentityMap) MarshalJSON ¶
func (m *IdentityMap) MarshalJSON() ([]byte, error)
func (*IdentityMap) UnmarshalJSON ¶
func (m *IdentityMap) UnmarshalJSON(data []byte) error
type IdentityMapJSON ¶
type IdentityMappingJSON ¶
type ObjectAnnotationsJSON ¶
type PersonAnnotation ¶
type PersonMeta ¶
type PersonMeta struct { Comment string Annotations []PersonAnnotation }
type PlaceAnnotation ¶
type PlaceInfoJSON ¶
type SourceAnnotation ¶
type Tree ¶
type Tree struct { ID string Name string Description string IdentityMap *IdentityMap Gazeteer *Gazeteer Annotations *Annotations People map[string]*model.Person Citations map[string]*model.GeneralCitation Sources map[string]*model.Source Repositories map[string]*model.Repository Places map[string]*model.Place Families map[string]*model.Family MediaObjects map[string]*model.MediaObject KeyPerson *model.Person }
func NewTree ¶
func NewTree(id string, m *IdentityMap, g *Gazeteer, a *Annotations) *Tree
func (*Tree) ApplyPeopleMatching ¶
func (t *Tree) ApplyPeopleMatching(m model.PersonMatcher, fn model.PersonActionFunc) error
ApplyPeopleMatching applies fn to each person that matches m until fn returns false or an error which is returned if encountered
func (*Tree) BuildRelationsToKeyPerson ¶
func (t *Tree) BuildRelationsToKeyPerson()
func (*Tree) CrossReferenceCitations ¶
func (*Tree) FindCitation ¶
func (*Tree) FindFamilyByParents ¶
func (*Tree) FindFamilyOneParent ¶
func (*Tree) FindMediaObject ¶
func (t *Tree) FindMediaObject(path string) *model.MediaObject
func (*Tree) FindPlaceUnstructured ¶
func (*Tree) FindRepository ¶
func (t *Tree) FindRepository(scope string, sid string) *model.Repository
func (*Tree) GetCitation ¶
func (t *Tree) GetCitation(id string) (*model.GeneralCitation, bool)
func (*Tree) InferFamilyRelationships ¶
func (*Tree) InferFamilyStartEndDates ¶
func (*Tree) ListPeopleMatching ¶
func (*Tree) ListPlacesMatching ¶
func (*Tree) RefinePersonOccupations ¶
func (*Tree) SelectPersonBestBirthDeathEvents ¶
func (*Tree) SetKeyPerson ¶
func (*Tree) TrimCitationEventsCited ¶
func (t *Tree) TrimCitationEventsCited(c *model.GeneralCitation) error
func (*Tree) TrimCitationPeopleCited ¶
func (t *Tree) TrimCitationPeopleCited(c *model.GeneralCitation) error