Skip to content

better precedes() across trees #1

@martinpopel

Description

@martinpopel

$nodeA->precedes($nodeB) currently works only if both nodes are from the same tree. We could extend it, so it first checks whether $nodeA->bundle->number <=> $nodeB->bundle->number.

PRO: This could be useful in coreference handling etc. The current behavior of precedes with nodes from different trees is wrong (it should at least throw an exception).

CON: It will slow down slightly the most common use case - ordering within the same tree (but if super efficiency is needed, we can always use $nodeA->ord < $nodeB->ord).

NEUTRAL: What should we return if the two nodes are from different zones of the same bundle? An exception or just compare ord (and suppose the two zone have the same number of words, which is a possible use-case)?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions