* PRE: {@link CTTree#setPBLocs()} and {@link C} needs to be called before.
*/
private void normalizeLinks(PBInstance instance)
{
List<PBLoc> lDel = new ArrayList<PBLoc>();
CTTree tree = instance.getTree();
CTNode curr, node, ante;
PBLoc cLoc; int i;
List<CTNode> list;
CTNode pred = tree.getTerminal(instance.predId);
for (PBArg arg : instance.getArgs())
{
if (arg.isLabel(PBLib.PB_REL)) continue;
lDel.clear();
for (i=0; i<arg.getLocSize(); i++) // size() gets changed dynamically
{
cLoc = arg.getLoc(i);
curr = tree.getNode(cLoc);
if (CTLibEn.isComplementizer(curr))
{
if ((ante = curr.getAntecedent()) != null)
arg.addLoc(new PBLoc(ante.getPBLoc(), "*"));
if ((node = getCoIndexedWHNode(curr)) != null)
cLoc.set(node.getPBLoc(), "*");
}
else if (curr.pTag.startsWith("WH"))
{
if ((node = CTLibEn.getComplementizer(curr)) != null && (ante = node.getAntecedent()) != null)
arg.addLoc(new PBLoc(ante.getPBLoc(), "*"));
}
else if (curr.isEmptyCategoryRec()) // *T*, *
{
cLoc.height = 0;
node = tree.getTerminal(cLoc.terminalId);
if ((ante = node.getAntecedent()) != null)
arg.addLoc(new PBLoc(ante.getPBLoc(), "*"));
}
else if (!(list = curr.getIncludedEmptyCategory("\\*(ICH|RNR)\\*.*")).isEmpty())