loadFields

0th

Percentile

Dictionary Handling

loadFields() loads dictionaries that are available on the web as plain text files.

Usage
loadFields(fieldnames = c("Liebe", "Familie"),
  baseurl = paste("https://raw.githubusercontent.com/quadrama/metadata/master",
  ensureSuffix(directory, fileSep), sep = fileSep),
  directory = "fields/", fileSuffix = ".txt", fileSep = "/")
Arguments
fieldnames

A list of names for the dictionaries. It is expected that files with that name can be found below the URL.

baseurl

The base path delivering the dictionaries. Should end in a /, field names will be appended and fed into read.csv().

directory

The last component of the base url. Useful to retrieve enriched word fields from metadata repo.

fileSuffix

The suffix for the dictionary files

fileSep

The file separator used to construct the URL Can be overwritten to load local dictionaries.

Value

A named list that holds the loaded dictionaries as character vectors.

File Format

Dictionary files should contain one word per line, with no comments or any other meta information. The entry name for the dictionary is given as the file name. It's therefore best if it does not contain special characters. The dictionary must be in UTF-8 encoding, and the file needs to end on .txt.

Aliases
  • loadFields
Examples
# NOT RUN {
# retrieves word fields from github
fields <- loadFields(fieldnames=c("Liebe", "Familie", "Krieg"))


# retrieves word fields from local directory (under windows)
fields <- loadFields(filednames=c("Health", "Death"),
                     baseurl="c:\\path\\to\\local\\directory",
                     fileSep="\\")
# }
Documentation reproduced from package DramaAnalysis, version 3.0.0, License: GPL (>= 3)

Community examples

Looks like there are no examples yet.