(self)
| 329 | """Tests split_sentences.""" |
| 330 | |
| 331 | def test_split_sentences(self): |
| 332 | texts = [ |
| 333 | "this is a pretty long sentence\n", |
| 334 | "this is sentence one.\n\n\nthis is sentence two. three.", |
| 335 | ] |
| 336 | ds_fn = make_ds_fn(False, texts, repeat=1) |
| 337 | split_fn = input_text.split_sentences() |
| 338 | ds = split_fn(ds_fn()) |
| 339 | |
| 340 | expected = [ |
| 341 | "this is a pretty long sentence", |
| 342 | "", |
| 343 | "this is sentence one.", |
| 344 | "this is sentence two.", |
| 345 | "three.", |
| 346 | "", |
| 347 | ] |
| 348 | actual = [extract_text(x) for x in ds] |
| 349 | assert expected == actual |
| 350 | |
| 351 | def test_split_sentences_keys(self): |
| 352 | texts = [ |
nothing calls this directly
no test coverage detected