Skip to content

Strings with linux line endings break the tokenizer #24

Description

@palenshus

This causes an infinite loop:

var _tokenizer = new BertUncasedBaseTokenizer();
var sentence = "Linux\nline\nendings";
var tokens = _tokenizer.Tokenize(sentence);

The problem is that the TokenizeSentence method doesn't have '\n' as a valid token. It also has one space, and three spaces, but not two, for example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions