src/UntypedCoref/CorefReader.cpp
/* Given a token in the form <sentence_number>:<node_number>, parse
   out those two numbers. */
Given a token in the form :, parse
out those two numbers.
Given a token in the form : parse out those two numbers .
void CorefReader::interpretNumbers(int &sentence, int &node_number, char* token) {
   char *strtok_saveptr;
   char *sentence_str = strtok_r(token, ":", &strtok_saveptr);
   if (sentence_str == NULL) {
	  throw UnexpectedInputException("CorefReader.cpp::interpretMention",
                                     "invalid coref token");
   }
   sentence = atoi(sentence_str);
   char *node_number_str = strtok_r(NULL, ":", &strtok_saveptr);
   if (node_number_str == NULL or strtok_r(NULL, ":", &strtok_saveptr) != NULL) {
	  throw UnexpectedInputException("CorefReader.cpp::interpretNumbers",
                                     "invalid coref token postcolon part");
   }
   node_number = atoi(node_number_str);
}
void CorefReader :: interpretNumbers ( int & sentence , int & node_number , char * token ) { char * strtok_saveptr ; char * sentence_str = strtok_r ( token , " " , & strtok_saveptr ) ; if ( sentence_str == NULL ) { throw UnexpectedInputException ( " " , " " ) ; } sentence = atoi ( sentence_str ) ; char * node_number_str = strtok_r ( NULL , " " , & strtok_saveptr ) ; if ( node_number_str == NULL or strtok_r ( NULL , " " , & strtok_saveptr ) != NULL ) { throw UnexpectedInputException ( " " , " " ) ; } node_number = atoi ( node_number_str ) ; }
Given a token in the form <sentence_number>:<node_number>, parse
out those two numbers.
Given a token in the form <sentence_number > : <node_number > parse out those two numbers .