top_punct: Punctuation Operations

Description Usage Arguments Value Examples

Description

This function is part of the 'term operations' (top) function set
It takes and input string and standardizes / substitutes / replaces punctuations and characters

Usage

1
2
top_punct(string, lower = TRUE, punct.stand = TRUE,
  punct.rem = c("none", "partial", "complete"), punct.sub = FALSE)

Arguments

string

A character string

lower

Shall the string be transfored to lower case? (TRUE/FALSE)
This option is only available if punct.stand == TRUE

punct.stand

Shall the input string be standardized? (TRUE/FALSE)

punct.rem

Shall punctuation be removed? (One of none/partial/complete)
none: No removal of punctuations
partial: All punctuation except ampersand (&), forward slash (/) and hyphen (-) is removed
complete: All punctuation is removed

punct.sub

Shall certein punctuation characters be replaced? (TRUE/FALSE)
If TRUE the ampersand (&) and plus (+) characters will be replace with 'and'

Value

A charcter string

Examples

1
2
3
4
5
6
7
8
library(tpfuns)
input.string <- "TeSt STring: ( This, ) String [ Is a ] Test & ít-is badlý written"

top_punct(input.string, TRUE, TRUE, punct.rem = "none", FALSE)
top_punct(input.string, TRUE, TRUE, "partial", FALSE)
top_punct(input.string, TRUE, TRUE, "complete", FALSE)

top_punct(input.string, TRUE, TRUE, "partial", TRUE)

M-U-UNI-MA/tpfunctions documentation built on May 24, 2019, 7:37 a.m.