bag_of_word_ify: Function to convert a record into a bag of tokens with a...

Description Usage Arguments Value Examples

View source: R/klsh.R

Description

Function to convert a record into a bag of tokens with a fieldwise flag

Usage

1
bag_of_word_ify(record, k, fieldwise = FALSE)

Arguments

record

String or record

k

Parameter k, which is the number of shingle, tokens, or grams to break the string into

fieldwise

Flag where the defalt setting to include the record as the entire string

Value

Computes the bag of tokens for a string

Examples

1
2
3
4
5
data(RLdata500)
data.500 <- RLdata500[-c(2,4)]
bag_of_word_ify(data.500[1,c(-2)],k=2)
bag_of_word_ify(data.500[300,c(-2)],k=2)
names(bag_of_word_ify(data.500[300,c(-2)],k=2))

klsh documentation built on Jan. 13, 2021, 8:05 p.m.