benchmarkstt.normalization package

Module contents

class benchmarkstt.normalization.Base[source]

Bases: object

normalize(text)
class benchmarkstt.normalization.BaseWithFileSupport[source]

Bases: benchmarkstt.normalization.Base

This kind of normalization class supports loading the values from a file, i.e. being wrapped in a core.File wrapper.

class benchmarkstt.normalization.File(normalizer, file, encoding=None, path=None)[source]

Bases: benchmarkstt.normalization.Base

Read one per line and pass it to the given normalizer

Parameters:
  • normalizer (str|class) -- Normalizer name (or class)
  • file -- The file to read rules from
  • encoding -- The file encoding
Example text:

"This is an Ex-Parakeet"

Example normalizer:
 

"regex"

Example file:

"./resources/test/normalizers/regex/en_US"

Example encoding:
 

"UTF-8"

Example return:

"This is an Ex Parrot"

class benchmarkstt.normalization.FileFactory(base_class, namespaces=None)[source]

Bases: benchmarkstt.factory.Factory

create(name, file=None, encoding=None, path=None)[source]
class benchmarkstt.normalization.NormalizationComposite(title=None)[source]

Bases: benchmarkstt.normalization.Base

Combining normalizers

add(normalizer)[source]

Adds a normalizer to the composite "stack"