/** * Sets the labeler. * * @param l A labeling classifier. **/ public void setLabeler(Classifier l) { if (l == null || l.allowableValues().length != 2) { System.err.println("Error: " + name + ": An LTU must be given a single binary label classifier."); new Exception().printStackTrace(); System.exit(1); } super.setLabeler(l); allowableValues = l.allowableValues(); labelLexicon.clear(); labelLexicon.lookup(new DiscretePrimitiveStringFeature(l.containingPackage, l.name, "", allowableValues[0], (short) 0, (short) 2), true); labelLexicon.lookup(new DiscretePrimitiveStringFeature(l.containingPackage, l.name, "", allowableValues[1], (short) 1, (short) 2), true); createPrediction(0); createPrediction(1); }