link-grammar-5.8.0/link-grammar/post-process/constituents.c
/**
 * Look for a constituent started by an MVs or MVg.
 * Find any VP's or ADJP's that contain it (without going
 * beyond a larger S or NP). Adjust them so that
 * they end right before the m domain starts.
 */
Look for a constituent started by an MVs or MVg.
Find any VP's or ADJP's that contain it (without going
beyond a larger S or NP). Adjust them so that
they end right before the m domain starts.
Look for a constituent started by an MVs or MVg . Find any VP ' s or ADJP ' s that contain it ( without going beyond a larger S or NP ) . Adjust them so that they end right before the m domain starts .
static void adjust_subordinate_clauses(con_context_t *ctxt, Linkage linkage,
                                       int numcon_total,
                                       int numcon_subl)
{
	int c, c2;
	size_t w, w2;
	bool done;
	for (c=numcon_total; c<numcon_total + numcon_subl; c++)
	{
		if ((post_process_match("MVs", ctxt->constituent[c].start_link) == 1) ||
			 (post_process_match("MVg", ctxt->constituent[c].start_link) == 1))
		{
			done = false;
			for (w2 = ctxt->constituent[c].left-1; (false == done) && w2 != (size_t) -1; w2--)
			{
				for (c2 = numcon_total; c2 < numcon_total + numcon_subl; c2++)
				{
					if (!((ctxt->constituent[c2].left == w2) &&
						  (ctxt->constituent[c2].right >= ctxt->constituent[c].right)))
						continue;
					if ((strcmp(ctxt->constituent[c2].type, "S") == 0) ||
						(strcmp(ctxt->constituent[c2].type, "NP") == 0)) {
						done = true;
						break;
					}
					if ((ctxt->constituent[c2].domain_type == 'v') ||
						(ctxt->constituent[c2].domain_type == 'a'))
					{
						w = ctxt->constituent[c].left - 1;
						ctxt->constituent[c2].right = w;
						if (verbosity_level(D_CONST))
						{
							err_msg(lg_Debug, "Adjusting constituent %d:\n\\", c2);
							print_constituent(ctxt, linkage, c2);
						}
					}
				}
			}
			if (strcmp(linkage->word[ctxt->constituent[c].left], ",") == 0)
				ctxt->constituent[c].left++;
		}
	}
}
static void adjust_subordinate_clauses ( con_context_t * ctxt , Linkage linkage , int numcon_total , int numcon_subl ) { int c , c2 ; size_t w , w2 ; bool done ; for ( c = numcon_total ; c < numcon_total + numcon_subl ; c ++ ) { if ( ( post_process_match ( " " , ctxt -> constituent [ c ] . start_link ) == 1 ) || ( post_process_match ( " " , ctxt -> constituent [ c ] . start_link ) == 1 ) ) { done = false ; for ( w2 = ctxt -> constituent [ c ] . left - 1 ; ( false == done ) && w2 != ( size_t ) -1 ; w2 -- ) { for ( c2 = numcon_total ; c2 < numcon_total + numcon_subl ; c2 ++ ) { if ( ! ( ( ctxt -> constituent [ c2 ] . left == w2 ) && ( ctxt -> constituent [ c2 ] . right >= ctxt -> constituent [ c ] . right ) ) ) continue ; if ( ( strcmp ( ctxt -> constituent [ c2 ] . type , " " ) == 0 ) || ( strcmp ( ctxt -> constituent [ c2 ] . type , " " ) == 0 ) ) { done = true ; break ; } if ( ( ctxt -> constituent [ c2 ] . domain_type == ' ' ) || ( ctxt -> constituent [ c2 ] . domain_type == ' ' ) ) { w = ctxt -> constituent [ c ] . left - 1 ; ctxt -> constituent [ c2 ] . right = w ; if ( verbosity_level ( D_CONST ) ) { err_msg ( lg_Debug , " \n \\ " , c2 ) ; print_constituent ( ctxt , linkage , c2 ) ; } } } } if ( strcmp ( linkage -> word [ ctxt -> constituent [ c ] . left ] , " " ) == 0 ) ctxt -> constituent [ c ] . left ++ ; } } }
Look for a constituent started by an MVs or MVg.
Look for a constituent started by an MVs or MVg .