src/Generic/UTCoref/LinkAllMentions.cpp
/* This is a debug function.  It just goes through all pairs of nodes
   and links them if they are an exact string match */
This is a debug function.  It just goes through all pairs of nodes
and links them if they are an exact string match
This is a debug function . It just goes through all pairs of nodes and links them if they are an exact string match
void LinkAllMentions::link_strmatch(UTCoref &corefs) const {
   for (int i = 0 ; i < linkable_nodes.length() ; i++) {
	  const SynNode &left_node = *linkable_nodes[i];
	  std::wstring left_node_str = left_node.toTextString();
	  for (int j = i+1 ; j < linkable_nodes.length() ; j++) {
		 const SynNode &right_node = *linkable_nodes[j];
		 std::wstring right_node_str = right_node.toTextString();
		 if (left_node_str == right_node_str) {
			corefs.addLink(left_node, right_node);
		 }
		 right_node_str.clear();
	  }
	  left_node_str.clear();
   }
}
void LinkAllMentions :: link_strmatch ( UTCoref & corefs ) const { for ( int i = 0 ; i < linkable_nodes . length ( ) ; i ++ ) { const SynNode & left_node = * linkable_nodes [ i ] ; std :: wstring left_node_str = left_node . toTextString ( ) ; for ( int j = i + 1 ; j < linkable_nodes . length ( ) ; j ++ ) { const SynNode & right_node = * linkable_nodes [ j ] ; std :: wstring right_node_str = right_node . toTextString ( ) ; if ( left_node_str == right_node_str ) { corefs . addLink ( left_node , right_node ) ; } right_node_str . clear ( ) ; } left_node_str . clear ( ) ; } }
This is a debug function.
This is a debug function .