CountMap: Python-like Counter dictionary

Description Super class Methods Examples

Description

Counter dictionary to count the occurences of a character string. The class provides additionaly a function head(top_n) to get the top n occurences. Also included is a sort function to sort the internal list. WARNING: This operation cannot be undone.

Super class

RolliNLP::DictMap -> CountMap

Methods

Public methods

Inherited methods

Method add()

Usage
CountMap$add(key)

Method put()

Usage
CountMap$put(key, value)

Method order()

Usage
CountMap$order()

Method head()

Usage
CountMap$head(top_n)

Method clone()

The objects of this class are cloneable with this method.

Usage
CountMap$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

1
2
3
4
5
cl <- CountMap$new()
cl$add("Hello")
cl$add("Hello")
cl$get("Hello") == 2
cl$head(2)

LazerLambda/RolliNLP documentation built on Oct. 17, 2020, 8:54 p.m.