Skip to contents

Find the position of a chunk among its siblings in a tree.

Usage

addPositionAmongSiblings(
  chunkDF,
  rezrObj,
  treeEntryDFAddress = NULL,
  cond = expr(TRUE)
)

addAllPositionsAmongSiblings(rezrObj, cond = expr(TRUE))

Arguments

chunkDF

The chunkDF to be edited.

rezrObj

The rezrObj containing the chunkDF.

treeEntryDFAddress

The address to the treeEntryDF layer that will be used. If left blank, all layers will be used.

cond

A condition for excluding siblings (for example, adjuncts and auxiliaries).

Value

The chunkDF with a column siblingPos giving the position of the chunk among its siblings in the tree.

Examples

sbc007 = getAllTreeCorrespondences(sbc007)
#> There is more than one tree entry match for the token 37EFCBECFD691. I will take the first match.
#> There is more than one tree entry match for the token 12D67756890C1. I will take the first match.
#> There is more than one tree entry match for the token 152560A5DE6AC. I will take the first match.
#> There is more than one tree entry match for the chunk 210FB26A315A. I will take the first match.
#> There is more than one tree entry match for the chunk 22273255D825D. I will take the first match.
sbc007$chunkDF$refexpr = addPositionAmongSiblings(sbc007$chunkDF$refexpr, sbc007)