private List<AgigaCoref> parseCorefs(VTDNav vn) throws PilotException, NavException {
        require (vn.matchElement(AgigaConstants.DOC));
        
        List<AgigaCoref> agigaCorefs = new ArrayList<AgigaCoref>();
        if (!vn.toElement(VTDNav.FIRST_CHILD, AgigaConstants.COREFERENCES)) {
            // If there is no coref annotation return the empty list
            log.finer("No corefs found");
            return agigaCorefs;
        }

        // Loop through each token
        AutoPilot corefAp = new AutoPilot(vn);
        corefAp.selectElement(AgigaConstants.COREFERENCE);
        while (corefAp.iterate()) {
            AgigaCoref coref = parseCoref(vn.cloneNav());
            agigaCorefs.add(coref);
        }
        return agigaCorefs;
    }
private List < AgigaCoref > parseCorefs ( VTDNav vn ) throws PilotException , NavException { require ( vn . matchElement ( AgigaConstants . DOC ) ) ; List < AgigaCoref > agigaCorefs = new ArrayList < AgigaCoref > ( ) ; if ( ! vn . toElement ( VTDNav . FIRST_CHILD , AgigaConstants . COREFERENCES ) ) { log . finer ( "No corefs found" ) ; return agigaCorefs ; } AutoPilot corefAp = new AutoPilot ( vn ) ; corefAp . selectElement ( AgigaConstants . COREFERENCE ) ; while ( corefAp . iterate ( ) ) { AgigaCoref coref = parseCoref ( vn . cloneNav ( ) ) ; agigaCorefs . add ( coref ) ; } return agigaCorefs ; }
Assumes the position of vn is at a "DOC" tag