private List<Homonym> cleanse(List<Homonym> homonymList, int wType) {
        List<Integer> linesToRemove = new ArrayList<>();

        //combine split lines
        for (Homonym tr: homonymList) {
            for (int i =  tr.getWords().get(wType).getMeanings().size() - 1; i >= 0; i--) {
                Meaning se = tr.getWords().get(wType).getMeanings().get(i);
                if (se.getSynonyms().startsWith("##")) {
                    Meaning prev = tr.getWords().get(wType).getMeanings().get(i - 1);

                    //combine, but remove starting "##"
                    prev.setSynonyms(StringUtils.stripEnd(prev.getSynonyms(), null)
                            + (prev.getSynonyms().endsWith(StringHelper.SLASH) ? "" : StringHelper.SPACE)
                            + StringUtils.stripStart(se.getSynonyms().substring(2), null));

                    //mark "line" to be removed
                    linesToRemove.add(i);
                }
                removeMarkedLines(tr, wType, linesToRemove);
            }
        }

        //remove homonyms with empty meanings
        for (int i = homonymList.size() - 1; i >= 0 ; i--) {
            Homonym tr = homonymList.get(i);
            if (tr.getWords().get(wType).getMeanings().isEmpty() || !tr.getWords().get(wType).hasNonEmptyMeanings()) {
                linesToRemove.add(i);
            }
        }
        removeMarkedLines(homonymList, linesToRemove);

        return homonymList;
    }