Learn R Programming

Rwordseg (version 0.3-2)

createDict: Create a dictionary file from corpus.

Description

Read a corpus vector and generate the dictionary data frame.

Usage

createDict(trainvec, dicfile = NULL, wordsplit = "\\s+",
  natruesplit = "/")

Arguments

trainvec

A character vector of corpus.

dicfile

The path of output file. Defult is NULL.

wordsplit

Character containing regular expression to use for splitting words.

natruesplit

Character containing regular expression to use for splitting nature.

Value

A data frame of:

word

Word.

freq

Frequency.

nature

Nature.

Examples

Run this code
# NOT RUN {
data(PD980105)
d1 <- createDict(PD980105[1:10])
head(d1)

# }

Run the code above in your browser using DataLab