addIsWordField: Add a field on whether something is a word or not.

View source: R/generic.R

addIsWordFieldR Documentation

Add a field on whether something is a word or not.

Description

Add a field on whether something is a word or not.

Usage

addIsWordField(x, ...)

## S3 method for class 'rezrDF'
addIsWordField(x, cond, addWordSeq = T)

## S3 method for class 'rezrObj'
addIsWordField(x, cond, addWordSeq = T)

Arguments

x

The rezrDF or rezrObj to be edited.

cond

The wordhood condition. For example, if your word column is called 'word', and you wish to exclude zeroes, you may write 'x == "<0>"'.

addWordSeq

If TRUE, the columns wordOrder and docWordSeq will be added.

Value

The modified rezrDF or rezrObj. If addWordSeq is set to TRUE, the columns wordOrder and docWordSeq will be added to tokenDF and entryDF, and the columns wordOrderFirst, wordOrderLast, docWordSeqFirst and docWordSeqLast will be added to unitDF, chunkDF, rezDF and trackDF.

Note

If used on a rezrObj and addWordSeq = T, wordOrder and docWordSeq are automatically added to entry, unit, chunk, rez and track tables.

Examples

sbc007_withword = addIsWordField(sbc007, kind == "Word")
head(sbc007_withword$chunkDF$refexpr %>% select(id, text, tokenOrderFirst, wordOrderFirst, docTokenSeqLast, docWordSeqLast))

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