Pattern somePattern1 = Pattern.compile("asdadas");
Pattern somePattern2 = Pattern.compile("asdadas");
String[] words = text.split(" ");
for (String word : words) {
matcher = somePattern1.matcher(word);
if (matcher.matches()) {
concepts.offer(new Headword(word));
}
matcher = somePattern2.matcher(word);
if (matcher.matches()) {
concepts.offer(new PlainText(word));
}
// .... etc
}