cufu_freqlist: cufu_freqlist

Usage Arguments Value Note Author(s) Examples

View source: R/customized functions.R

Usage

1
cufu_freqlist(X_fnames, stop_list)

Arguments

X_fnames

the file names of corpora.

stop_list

words that need to be removed out of analysis.

Value

output a words frequency list

Note

This package is built to simplify the code in the final report of Methods of Corpus Linguistics

Author(s)

Christine Zhao

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## A_fnames <-    get_fnames(".../foldername")
## A_flist <- cufu_freqlist(A_fnames,stop_list)

## The function is currently defined as
function(X_fnames, stop_list) {
  # build frequency list for target corpus
  # [use whitespace as token splitter]
  # [drop tokens containing ":", "[", or "]" ]
  X_flist <- X_fnames 
    freqlist(re_token_splitter = r"--[(?xi)  \s+   ]--",
             re_drop_token     = r"--[(?xi)  [:\[\]] ]--",
             file_encoding     = "UTF-8")
  # inspecting the top freq. items (after dropping stop words)
  # [resorting to concordances when the need arises]
  X_flist <- X_flist 
    drop_types(stop_list)
  # return list
  return(X_flist)
}

Christine-Z/cufu documentation built on Jan. 4, 2022, 12:01 a.m.