/** * Iff oldLabel is a NegraLabel, copy it. */ public Label newLabel(Label oldLabel) { NegraLabel result; if(oldLabel instanceof NegraLabel) { NegraLabel l = (NegraLabel) oldLabel; result = new NegraLabel(l.value(), l.getEdge(), Generics.<String,String>newHashMap()); for (Map.Entry<String,String> e : l.features.entrySet()) { result.features.put(e.getKey(), e.getValue()); } } else { result = new NegraLabel(oldLabel.value()); } return result; } }
public Label newLabel(String labelStr) { return new NegraLabel(labelStr); }
public Label newLabel(String labelStr) { return new NegraLabel(labelStr); }
/** * Iff oldLabel is a NegraLabel, copy it. */ public Label newLabel(Label oldLabel) { NegraLabel result; if(oldLabel instanceof NegraLabel) { NegraLabel l = (NegraLabel) oldLabel; result = new NegraLabel(l.value(), l.getEdge(), new HashMap<String,String>()); for (Map.Entry<String,String> e : l.features.entrySet()) { result.features.put(e.getKey(), e.getValue()); } } else { result = new NegraLabel(oldLabel.value()); } return result; } }
public Label newLabel(String labelStr) { return new NegraLabel(labelStr); }
/** * Iff oldLabel is a NegraLabel, copy it. */ public Label newLabel(Label oldLabel) { NegraLabel result; if(oldLabel instanceof NegraLabel) { NegraLabel l = (NegraLabel) oldLabel; result = new NegraLabel(l.value(), l.getEdge(), Generics.<String,String>newHashMap()); for (Map.Entry<String,String> e : l.features.entrySet()) { result.features.put(e.getKey(), e.getValue()); } } else { result = new NegraLabel(oldLabel.value()); } return result; } }
public Label newLabel(String labelStr) { return new NegraLabel(labelStr); }
/** * Iff oldLabel is a NegraLabel, copy it. */ public Label newLabel(Label oldLabel) { NegraLabel result; if(oldLabel instanceof NegraLabel) { NegraLabel l = (NegraLabel) oldLabel; result = new NegraLabel(l.value(), l.getEdge(), Generics.<String,String>newHashMap()); for (Map.Entry<String,String> e : l.features.entrySet()) { result.features.put(e.getKey(), e.getValue()); } } else { result = new NegraLabel(oldLabel.value()); } return result; } }
protected Tree findMarkedHead(Tree[] kids) { for (int i = 0, n = kids.length; i < n; i++) { if (kids[i].label() instanceof NegraLabel && ((NegraLabel) kids[i].label()).getEdge() != null && ((NegraLabel) kids[i].label()).getEdge().equals("HD")) { //System.err.println("found manually-labeled head"); return kids[i]; } } return null; }
public Label newLabel(String labelStr) { return new NegraLabel(labelStr); }
/** * Iff oldLabel is a NegraLabel, copy it. */ public Label newLabel(Label oldLabel) { NegraLabel result; if(oldLabel instanceof NegraLabel) { NegraLabel l = (NegraLabel) oldLabel; result = new NegraLabel(l.value(), l.getEdge(), Generics.<String,String>newHashMap()); for (Map.Entry<String,String> e : l.features.entrySet()) { result.features.put(e.getKey(), e.getValue()); } } else { result = new NegraLabel(oldLabel.value()); } return result; } }