try {

Path path = Paths.get(filename);

Map<String, Set<Integer>> wordlines = Files.lines(path).map(line -> line.split("\\s+")).flatMap(Arrays::stream)

.collect(Collectors.groupingBy(Function.identity(),

Collectors.mapping(word -> (wordlines).indexOf(word) + 1,

Collectors.toSet())));


하나 바꾸면 하나또 오류뜨고 그렇네;;