Package 'NLPutils'

Title: Natural Language Processing Utilities
Description: Utilities for Natural Language Processing.
Authors: Kurt Hornik [aut, cre]
Maintainer: Kurt Hornik <[email protected]>
License: GPL-2
Version: 0.0-5.1
Built: 2024-11-19 05:41:46 UTC
Source: https://github.com/cran/NLPutils

Help Index


Document Diversity Annotator

Description

Generate an annotator which computes document diversity annotations for English documents using diversity() from package qdap.

Usage

QDAP_Diversity_Annotator()

Value

A Annotator object giving the generated document diversity annotator.

Examples

require("NLP")
doc <- readRDS(system.file("texts", "stanford.rds", package = "NLP"))
s <- content(doc)
a <- annotation(doc)

diversity_annotator <- QDAP_Diversity_Annotator()
diversity_annotator(s, a)

Document Formality Annotator

Description

Generate an annotator which computes document formality annotations for English documents using formality() from package qdap.

Usage

QDAP_Formality_Annotator()

Value

A Annotator object giving the generated document formality annotator.

Examples

require("NLP")
doc <- readRDS(system.file("texts", "stanford.rds", package = "NLP"))
s <- content(doc)
a <- annotation(doc)

formality_annotator <- QDAP_Formality_Annotator()
formality_annotator(s, a)

Sentence Polarity Annotator

Description

Generate an annotator which computes sentence polarity annotations for English documents using polarity() from package qdap.

Usage

QDAP_Polarity_Annotator()

Value

A Annotator object giving the generated sentence polarity annotator.

Examples

require("NLP")
doc <- readRDS(system.file("texts", "stanford.rds", package = "NLP"))
s <- content(doc)
a <- annotation(doc)

polarity_annotator <- QDAP_Polarity_Annotator()
polarity_annotator(s, a)

Word Stem Annotator

Description

Generate an annotator which computes word stem annotations using wordStem() from package SnowballC.

Usage

Snowball_Stem_Annotator(language = "porter")

Arguments

language

a character string giving the document language. See the documentation for wordStem() for more information.

Value

A Annotator object giving the generated word stem annotator.

Examples

require("NLP")
doc <- readRDS(system.file("texts", "stanford.rds", package = "NLP"))
s <- content(doc)
a <- annotation(doc)

stem_annotator <- Snowball_Stem_Annotator()
stem_annotator(s, a)