Versions in this module Expand all Collapse all v0 v0.0.2 Jul 29, 2024 v0.0.1 Jul 24, 2024 Changes in this version + var ErrInvalidPlaceName = errors.New("invalid place name") + 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 struct + func LoadAnnotations(filename string) (*Annotations, error) + func (a *Annotations) MarshalJSON() ([]byte, error) + func (a *Annotations) UnmarshalJSON(data []byte) error + 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 (o *Annotations) Replace(kind string, id string, field string, value any) error + type AnnotationsJSON struct + People []ObjectAnnotationsJSON + Places []ObjectAnnotationsJSON + Sources []ObjectAnnotationsJSON + Trees []ObjectAnnotationsJSON + type Gazeteer struct + func LoadGazeteer(filename string) (*Gazeteer, error) + 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 struct + Places map[string]PlaceInfoJSON + type GazeteerPlace struct + type IdentityMap struct + func LoadIdentityMap(imFilename string) (*IdentityMap, error) + func (m *IdentityMap) AddAlias(alias string, canonical string) + func (m *IdentityMap) ID(scope string, id string) string + func (m *IdentityMap) MarshalJSON() ([]byte, error) + func (m *IdentityMap) UnmarshalJSON(data []byte) error + type IdentityMapJSON struct + Places map[string]string + Replace map[string]string + Scopes map[string][]IdentityMappingJSON + type IdentityMappingJSON struct + ID string + ScopeID string + type Loader interface + Load func(*Tree) error + Scope func() string + type ObjectAnnotationsJSON struct + Add map[string]any + Comment string + ID string + Replace map[string]any + type PersonAnnotation struct + Field string + Fn personAnnotaterFunc + Kind string + Value any + type PersonMeta struct + Annotations []PersonAnnotation + Comment string + type PlaceAnnotation struct + Field string + Fn placeAnnotaterFunc + Kind string + Value any + type PlaceInfoJSON struct + IDSrc string + Kind string + Matches []string + Name string + ParentID string + type SourceAnnotation struct + Field string + Fn sourceAnnotaterFunc + Kind string + Value any + type Tree struct + Annotations *Annotations + Citations map[string]*model.GeneralCitation + Description string + Families map[string]*model.Family + Gazeteer *Gazeteer + ID string + IdentityMap *IdentityMap + KeyPerson *model.Person + MediaObjects map[string]*model.MediaObject + Name string + People map[string]*model.Person + Places map[string]*model.Place + Repositories map[string]*model.Repository + Sources map[string]*model.Source + func LoadTree(id string, configDir string, loader Loader) (*Tree, error) + func NewTree(id string, m *IdentityMap, g *Gazeteer, a *Annotations) *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 struct + Field string + Fn treeAnnotaterFunc + Kind string + Value any