Set<Constituent> newConstituents = new HashSet<Constituent>();
for (Constituent con : constituents) {
if (!(con instanceof LabeledConstituent)) {
throw new AssertionError("Unexpected constituent type " + con.getClass());
}
LabeledConstituent labeled = (LabeledConstituent) con;
newConstituents.add(new LabeledConstituent(labeled.start(), labeled.end(), tlp.basicCategory(labeled.value())));
}
return newConstituents;
}