private Syllable getSyllable(String syllableId) { Syllable syllable = new Syllable(); syllable.setId(syllableId); syllable.setPattern(getPattern(syllableId)); syllable.setLength(syllableId.length()); return syllable; }
private void processSyllables(String[] wordSyllables) { for (String wordSyllable : wordSyllables) { Syllable syllable = getSyllable(wordSyllable); if (!syllableIds.contains(syllable.getId())) { syllables.add(syllable); syllableIds.add(syllable.getId()); System.out.println("inserting syllable " + syllable.getId()); syllableDao.save(syllable); } } }