RFPunctuation {PersianStemmer} | R Documentation |
Remove or fix punctuation.
Description
Removes punctuation characters or inserts spaces before and after them so that they can be used in text analysis as separate units.
Usage
RFPunctuation(texts, NoPunctuation)
Arguments
texts |
A string with punctuation which should be removed or fixed. |
NoPunctuation |
If TRUE, the function removes punctuation. If FALSE, the function inserts spaces before and after punctuation. |
Value
RFPunctuation
returns a string with punctuation removed or fixed for text analysis.
Author(s)
Safshekan, Nielsen
Examples
# Create string with Persian characters and punctuation
x <- '\u062F\u0627\u0646\u0634\u06AF\u0627\u0647\u060C \u062A\u0647\u0631\u0627\u0646\u061F'
# Remove punctuation
RFPunctuation(x, NoPunctuation = TRUE)
# Fix punctuation
RFPunctuation(x, NoPunctuation = FALSE)
[Package PersianStemmer version 1.0 Index]