MCPcopy Create free account
hub / github.com/DocsaidLab/MRZScanner / test_textdecoder_default

Function test_textdecoder_default

tests/test_utils.py:48–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46
47
48def test_textdecoder_default():
49 chars_dict = {"<PAD>": 0, "<EOS>": 1, "A": 2, "B": 3, "C": 4}
50 decoder = TextDecoder(chars_dict=chars_dict, decode_mode=DecodeMode.Normal)
51 row = np.array([2, 3, 4, 1, 0], dtype=np.int32)
52 result = decoder.decode([row])
53 assert result == ["ABC"]
54
55
56def test_textdecoder_no_eos():

Callers

nothing calls this directly

Calls 2

decodeMethod · 0.95
TextDecoderClass · 0.90

Tested by

no test coverage detected