(String filePath)
| 8 | |
| 9 | public class FileToWords { |
| 10 | public static Stream<String> stream(String filePath) |
| 11 | throws Exception { |
| 12 | return Files.lines(Paths.get(filePath)) |
| 13 | .skip(1) // First (comment) line |
| 14 | .flatMap(line -> |
| 15 | Pattern.compile("\\W+").splitAsStream(line)); |
| 16 | } |
| 17 | } |