public PosTag(String tag,Collection<LexicalCategory> categories, Collection<Pos> pos, boolean copy){ super(tag); if(copy){ this.pos = EnumSet.noneOf(Pos.class); if(pos != null){ this.pos.addAll(pos); } } else { this.pos = (EnumSet<Pos>)pos; } if(copy){ this.category = EnumSet.noneOf(LexicalCategory.class); if(categories != null){ this.category.addAll(categories); } } else { this.category = (EnumSet<LexicalCategory>)categories; } //and the union over the pos parents this.posHierarchy = EnumSet.noneOf(Pos.class); for(Pos p : this.pos){ this.posHierarchy.addAll(p.hierarchy()); this.category.addAll(p.categories()); } } /**
public PosTag(String tag,Collection<LexicalCategory> categories, Collection<Pos> pos, boolean copy){ super(tag); if(copy){ this.pos = EnumSet.noneOf(Pos.class); if(pos != null){ this.pos.addAll(pos); } } else { this.pos = (EnumSet<Pos>)pos; } if(copy){ this.category = EnumSet.noneOf(LexicalCategory.class); if(categories != null){ this.category.addAll(categories); } } else { this.category = (EnumSet<LexicalCategory>)categories; } //and the union over the pos parents this.posHierarchy = EnumSet.noneOf(Pos.class); for(Pos p : this.pos){ this.posHierarchy.addAll(p.hierarchy()); this.category.addAll(p.categories()); } } /**
categories.addAll(value.getCategories()); for(Pos pos : value.getPos()){ categories.removeAll(pos.categories());
categories.addAll(value.getCategories()); for(Pos pos : value.getPos()){ categories.removeAll(pos.categories());