()
| 984 | |
| 985 | |
| 986 | def test_applycli_mixed(): |
| 987 | with make_tempdir() as data_path: |
| 988 | output = data_path / "testout.spacy" |
| 989 | text = "Testing apply cli" |
| 990 | nlp = spacy.blank("en") |
| 991 | doc = nlp(text) |
| 992 | jsonl_data = [{"text": text}] |
| 993 | srsly.write_jsonl(data_path / "test.jsonl", jsonl_data) |
| 994 | docbin = DocBin() |
| 995 | docbin.add(doc) |
| 996 | docbin.to_disk(data_path / "testin.spacy") |
| 997 | with open(data_path / "test.txt", "w") as ftest: |
| 998 | ftest.write(text) |
| 999 | apply(data_path, output, "blank:en", "text", 1, 1) |
| 1000 | # Check whether it worked |
| 1001 | result = list(DocBin().from_disk(output).get_docs(nlp.vocab)) |
| 1002 | assert len(result) == 3 |
| 1003 | for doc in result: |
| 1004 | assert doc.text == text |
| 1005 | |
| 1006 | |
| 1007 | def test_applycli_user_data(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…