Skip to content

Tokenizer.transform ignores error handling argument #44

Description

@Anaphory

The signature of Tokenizer.transform suggests that the function can take an argument to describe how to deal with undefined segments

def transform(self, word, column=Profile.GRAPHEME_COL, error=errors.replace):

but the actual fallback
target = self._errors['replace'](token)

is always the replace strategy.

(I came here looking for a keep strategy that would allow me to inspect the errors by bouncing them back to me instead of transforming them, even ignore replaces them by just nothing, but that's a different issue.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions