private List<Word> ranking(SWCDocument document, CommandLineArguments cmd) { RankingAlgo algo = RankingAlgorithmRegistry.getById(cmd.getRankAlgorithm()); document.weightFilter(cmd.getMaxWords(), algo); List<Word> words = document.getWords(); if (words.size() < 10) throw new RuntimeException("The input text is too short (" + words.size() + " words)"); return words; }