def test_words2indices(self): v = Vocab('unk') words = ['i', 'like', 'pie'] v.update(words) v = v.freeze() assert v.words2indices(words) == [1, 2, 3] assert v.words2indices(['i', 'said']) == [1, 0]