MCPcopy
hub / github.com/explosion/spaCy / test_ko_tokenizer_serialize

Function test_ko_tokenizer_serialize

spacy/tests/lang/ko/test_serialize.py:8–19  ·  view source on GitHub ↗
(ko_tokenizer)

Source from the content-addressed store, hash-verified

6
7
8def test_ko_tokenizer_serialize(ko_tokenizer):
9 tokenizer_bytes = ko_tokenizer.to_bytes()
10 nlp = Korean()
11 nlp.tokenizer.from_bytes(tokenizer_bytes)
12 assert tokenizer_bytes == nlp.tokenizer.to_bytes()
13
14 with make_tempdir() as d:
15 file_path = d / "tokenizer"
16 ko_tokenizer.to_disk(file_path)
17 nlp = Korean()
18 nlp.tokenizer.from_disk(file_path)
19 assert tokenizer_bytes == nlp.tokenizer.to_bytes()
20
21
22def test_ko_tokenizer_pickle(ko_tokenizer):

Callers

nothing calls this directly

Calls 6

KoreanClass · 0.90
make_tempdirFunction · 0.85
to_bytesMethod · 0.45
from_bytesMethod · 0.45
to_diskMethod · 0.45
from_diskMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…