NCSwearWordsTokenEnricher

class NCSwearWordsTokenEnricher(dictRes: String, stemmer: NCStemmer) extends NCTokenEnricher with LazyLogging

Swear-word token enricher.

This enricher adds swear boolean metadata property to the token instance if word it represents is in a swear word dictionary, i.e. the swear dictionary contains this word's stem. The value true of the metadata property indicates that this word's stem is found in the dictionary, false value indicates otherwise.

Value parameters:
dictRes

Relative path, absolute path, classpath resource or URL to the dictionary. The dictionary should have a simple plain text format with one lemma per line, empty lines are skipped, duplicates ignored, lines starting with # symbol will be treated as comments and ignored. Note that the search in the dictionary is implemented using words' stem and case is ignored.

stemmer

Stemmer implementation for the language used in the supplied swear-word dictionary.

See also:
Source:
NCSwearWordsTokenEnricher.scala
trait LazyLogging
class Object
trait Matchable
class Any

Value members

Concrete methods

override def enrich(req: NCRequest, cfg: NCModelConfig, toks: List[NCToken]): Unit

Enriches, or otherwise modifies, previously parsed tokens.

Enriches, or otherwise modifies, previously parsed tokens.

Definition Classes
Source:
NCSwearWordsTokenEnricher.scala

Inherited methods

Called when the component starts. Default implementation is no-op.

Called when the component starts. Default implementation is no-op.

Value parameters:
cfg

Configuration of the model this component is associated with.

Inherited from:
NCLifecycle
Source:
NCLifecycle.scala

Called when the component stops. Default implementation is no-op.

Called when the component stops. Default implementation is no-op.

Value parameters:
cfg

Configuration of the model this component is associated with.

Inherited from:
NCLifecycle
Source:
NCLifecycle.scala

Inherited fields

lazy protected val logger: Logger
Inherited from:
LazyLogging
Source:
Logging.scala