private ArrayList<String> getSentences(String[] input, HTMLDocument doc) throws BadLocationException {
        ArrayList<String> result = new ArrayList<String>();
        for (String word : input) {
            result.add("Sentences that contains " + word);
            Pattern pattern = Pattern.compile("([^.\\n]*\\b(" + word + ")\\b)[^.\\n]+\\.?", Pattern.CASE_INSENSITIVE);
            Matcher matcher = pattern.matcher(doc.getText(0, doc.getLength()));
            while (matcher.find()) {
                result.add("    "+matcher.group());
            }
        }
        return result;
    }