Loading...
Implement a greedy longest-match WordPiece tokenizer.
Given a vocabulary (set of subword tokens) and a word, tokenize the word using greedy longest-match from left to right. Subword tokens after the first piece are prefixed with "##".
Rules:
Input:
Output: space-separated tokens
un ##able ##ing play ##s playing playing
play ##ing
un, ##able, ##ing, play, ##s, and playing, and the word to tokenize is playing.play.ing, which is found in the vocabulary as ##ing, so it is added as the next token.play ##ing.