private void mergeLightVerbs(List<PBInstance> instances)
{
Map<String,PBInstance> mNouns = new HashMap<String,PBInstance>();
List<PBInstance> lVerbs = new ArrayList<PBInstance>();
List<PBInstance> remove = new ArrayList<PBInstance>();
PBInstance nInst;
List<PBArg> args;
PBArg rel;
for (PBInstance instance : instances)
{
if (instance.isVerbPredicate())
{
if (instance.roleset.endsWith("LV"))
lVerbs.add(instance);
}
else
mNouns.put(instance.getKey(), instance);
}
for (PBInstance instance : lVerbs)
{
nInst = null;
args = new ArrayList<PBArg>();
for (PBArg arg : instance.getArgs())
{
if (arg.label.endsWith("PRR"))
nInst = mNouns.get(instance.getKey(arg.getLoc(0).terminalId));
else if (arg.label.startsWith("LINK") || arg.isLabel(PBLib.PB_ARG0))
args.add(arg);
}
if (nInst == null)
{
StringBuilder build = new StringBuilder();
build.append(ERR_LV);
build.append(":");
build.append(" ");
build.append(instance.toString());
System.err.println(build.toString());
remove.add(instance);
}
else
{
nInst.addArgs(args);
rel = nInst.getFirstArg(PBLib.PB_REL);
rel.addLoc(new PBLoc(instance.predId, 0, ","));
args.clear();
for (PBArg arg : instance.getArgs())