Learn R Programming

finnsurveytext (version 2.1.1)

fst_cn_search: Concept Network - Search TextRank for concepts

Description

This function takes a string of terms (separated by commas) or a single term and, using `textrank_keywords()` from `textrank` package, filters data based on `pos_filter` and finds words connected to search terms.

Usage

fst_cn_search(data, concepts, pos_filter = NULL)

Value

Dataframe of n-grams containing searched terms.

Arguments

data

A dataframe of text in CoNLL-U format, with optional additional columns.

concepts

String of terms to search for, separated by commas.

pos_filter

List of UPOS tags for inclusion, default is `NULL` to include all UPOS tags.

Examples

Run this code
con <- "kiusata, lyöminen, lyödä, potkia"
pf <- c("NOUN", "VERB", "ADJ", "ADV")
pf2 <- "NOUN, VERB, ADJ, ADV"
fst_cn_search(fst_child, concepts = con, pos_filter = pf)
fst_cn_search(fst_child, concepts = con, pos_filter = pf2)
fst_cn_search(fst_child, concepts = con)

Run the code above in your browser using DataLab