private String buildTask1TokenJSON(StringBuilder textBuilder,NamedEntity namedEntity,Map<Integer,Integer> charOffsetStartMapping,Map<Integer,Integer> charOffsetEndMapping) throws CrowdException {
  if (!charOffsetStartMapping.containsKey(namedEntity.getBegin()) || !charOffsetEndMapping.containsKey(namedEntity.getEnd())) {
    throw new CrowdException("Data generation error: char offset to token mapping is inconsistent. Contact developpers!");
  }
  int start=charOffsetStartMapping.get(namedEntity.getBegin());
  int end=charOffsetEndMapping.get(namedEntity.getEnd());
  textBuilder.setLength(0);
  textBuilder.append("{\"s\":");
  textBuilder.append(start);
  textBuilder.append(",\"e\":");
  textBuilder.append(end);
  textBuilder.append("}");
  return new String(textBuilder);
}

private String buildTask1TokenJSON ( StringBuilder textBuilder , NamedEntity namedEntity , Map < Integer , Integer > charOffsetStartMapping , Map < Integer , Integer > charOffsetEndMapping ) throws CrowdException { if ( ! charOffsetStartMapping . containsKey ( namedEntity . getBegin ( ) ) || ! charOffsetEndMapping . containsKey ( namedEntity . getEnd ( ) ) ) { throw new CrowdException ( "Data generation error: char offset to token mapping is inconsistent. Contact developpers!" ) ; } int start = charOffsetStartMapping . get ( namedEntity . getBegin ( ) ) ; int end = charOffsetEndMapping . get ( namedEntity . getEnd ( ) ) ; textBuilder . setLength ( 0 ) ; textBuilder . append ( "{\"s\":" ) ; textBuilder . append ( start ) ; textBuilder . append ( ",\"e\":" ) ; textBuilder . append ( end ) ; textBuilder . append ( "}" ) ; return new String ( textBuilder ) ; }
helper method for generatetask1data , builds a single json formatted element describing start and end position of a named entity .
