orderseq: Get sequence number (position) within a larger structure...

getOrderFromSeqR Documentation

Get sequence number (position) within a larger structure (turn, prosodic sentence, etc.) from the ID of that structure, or the other way around

Description

Get sequence number (position) within a larger structure (turn, prosodic sentence, etc.) from the ID of that structure, or the other way around

Usage

getOrderFromSeq(id, isWord = T)

getSeqFromOrder(order)

Arguments

id

The ID of the larger structure within which you would like to find the position of an individual component. For example, if you want to find the position of a word within a prosodic sentence from the prosodic sentence ID.

isWord

Vector of logical values indicating whether something is to be counted as word.

order

The position of an individual component within a larger structure.

Value

A vector of sequence values within that structure. For example, if you are working with the tokenDF and id gives the prosodic sentence ID, then this function will return the position of a token within a prosodic sentence.

A vector of either order values within the structure . For example, if you are working with the tokenDF and id gives the prosodic sentence ID, then getOrderFormSeq will return the position of a token within a prosodic sentence. If order gives the position within the prosodic sentence, then getSeqFromOrder will return the prosodic sentence sequence.

Examples

sbc007$tokenDF = addFieldLocal(sbc007$tokenDF, "tokenOrder2", getOrderFromSeq(unitSeq))
sbc007$tokenDF = addFieldLocal(sbc007$tokenDF, "pSent", getSeqFromOrder(pSentOrder))

johnwdubois/rezonateR documentation built on Nov. 19, 2024, 11:17 p.m.