@elliotchance elliotchance released this Feb 12, 2019

Warning: Add tests for UnparsableDate (#240)
Assets 6

@elliotchance elliotchance released this Feb 12, 2019

Warning: SiblingsBornTooClose (#239)

If siblings were born less than 9 months apart.
Assets 6

@elliotchance elliotchance released this Feb 12, 2019

Warning: ChildBornBeforeParent (#238)

When the child is born before either parent.
Assets 6

@elliotchance elliotchance released this Feb 12, 2019

Warning: Unparsable date (#237)

Warnings are a way to surface data that may be wrong for a variety of reasons. Some examples may be that dates cannot be understood, children are born before parents, nodes to adhere to GEDCOM standards, etc.

Nodes can now implement a Warner interface which returns a slice of Warning entities. Document also implements Warner to aggregate all warnings.

This patch starts with a single type of warning, when dates cannot be parsed. More kinds of warnings will be added in time.
Assets 6

@elliotchance elliotchance released this Feb 12, 2019

Date: Subtract dates into a Duration (#236)

A new Duration type with whole-day resolution and pretty formatting is ideal when dealing with durations from subtracting dates.
Assets 6

@elliotchance elliotchance released this Feb 12, 2019

Date: add ParseError (#235)

When parsing a date based on a string the error will be placed in ParseError.
Assets 6

@elliotchance elliotchance released this Feb 11, 2019

Refactoring DateNode to DateRange (#234)

Most of the date range functionality was in the DateNode which means it could not be used in other places we need to represent date ranges. There is now a DateRange type where most of these methods have been moved to.

Also, more comprehensive comparisons can be made like Before, After and range comparison constants.
Assets 6

@elliotchance elliotchance released this Feb 10, 2019

SexNode: replaces Sex (#233)

Qualified SexNode to represent gender. It has all the same functionality as the existing Sex type, but better reflects the node it represents.

Also added some more helpful methods like IsMale, IsFemale, IsUnknown and OwnershipWord.
Assets 6

@elliotchance elliotchance released this Feb 8, 2019

Vastly improved API (#232)

This is the biggest refactoring in a long time. This address several issues with the API that have been bothing me.

1. All nodes were created with basically the same interface, that always required a document. Now constructors are much more simple for most of them that do not need a document. For the handful that still do, these can only be created from the document itself to prevent the need to pass the Document around separately.

2. Since nodes that require an owner (such as a Document or Family) can only be created through these entities it will greatly improve strategies for caching where changed occur after the document is initially loaded. I haven't heavily jumped into this teritory, but it will have to happen soon.

3. Families are now structures correctly with ChildNode, HusbandNode and WifeNode rather than trying to step around these. Apart from being closer to the GEDCOM structure this also make it easier to build families programamtically without awkwardly moving pointers around as values.

4. Nodes is a new type for []Node.

Other more minor changes such as deleting nodes and correctly mapping documents when duplicating nodes.
Assets 6

@elliotchance elliotchance released this Feb 6, 2019

Decoder: More flexible pointers. Fixes #230 (#231)

Pointers can really include anything, apart from a "@". This patch also adds some more test edge cases.
Assets 6