/** * Creates a Role object to load an existing role. It receives the ID as an argument. It doesn't add the role to the predicate. * * @param id role's ID. * @param predicate the predicate which this role is part of * @param semRole semantic role * @param span span containing all the targets of the role * @return a new role. */ public Predicate.Role newRole(String id, Predicate predicate, String semRole, Span<Term> span) { idManager.roles.update(id); Predicate.Role newRole = new Predicate.Role(id, semRole, span); return newRole; }
/** * Creates a new Role object. It assigns an appropriate ID to it. It uses the ID of the predicate to create a new ID for the role. It doesn't add the role to the predicate. * * @param predicate the predicate which this role is part of * @param semRole semantic role * @param span span containing all the targets of the role * @return a new role. */ public Predicate.Role newRole(Predicate predicate, String semRole, Span<Term> span) { String newId = idManager.roles.getNext(); Predicate.Role newRole = new Predicate.Role(newId, semRole, span); return newRole; }
/** Creates a Role object to load an existing role. It receives the ID as an argument. It doesn't add the role to the predicate. * @param id role's ID. * @param predicate the predicate which this role is part of * @param semRole semantic role * @param span span containing all the targets of the role * @return a new role. */ public Predicate.Role newRole(String id, Predicate predicate, String semRole, Span<Term> span) { idManager.updateCounter(AnnotationType.ROLE, id); Predicate.Role newRole = new Predicate.Role(id, semRole, span); return newRole; }
/** Creates a new Role object. It assigns an appropriate ID to it. It uses the ID of the predicate to create a new ID for the role. It doesn't add the role to the predicate. * @param predicate the predicate which this role is part of * @param semRole semantic role * @param span span containing all the targets of the role * @return a new role. */ public Predicate.Role newRole(Predicate predicate, String semRole, Span<Term> span) { String newId = idManager.getNextId(AnnotationType.ROLE); Predicate.Role newRole = new Predicate.Role(newId, semRole, span); return newRole; }