fst_cn_search: Concept Network - Search TextRank for concepts

View source: R/03_concept_network.R

fst_cn_searchR Documentation

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)

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.

Value

Dataframe of n-grams containing searched terms.

Examples

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)

finnsurveytext documentation built on April 4, 2025, 5:07 a.m.