link-grammar-5.8.0/link-grammar/tokenize/wordgraph.c
/**
 * Get the real unsplit word of the given word.
 * While the Wordgraph is getting constructed, when a subword has itself as one
 * of its own alternatives, it appears in the wordgraph only once, still
 * pointing to its original unsplit_word. It appears once in order not to
 * complicate the graph, and the unsplit_word is not changed in order not loss
 * information (all of these are implementation decisions). However, for the
 * hierarchy position of the word (when it is a word to be issued, i.e. a leaf
 * node) the real unsplit word is needed, which is the word itself. It is fine
 * since such a word cannot get split further.
 */
Get the real unsplit word of the given word.
While the Wordgraph is getting constructed, when a subword has itself as one
of its own alternatives, it appears in the wordgraph only once, still
pointing to its original unsplit_word. It appears once in order not to
complicate the graph, and the unsplit_word is not changed in order not loss
information (all of these are implementation decisions). However, for the
hierarchy position of the word (when it is a word to be issued, i.e. a leaf
node) the real unsplit word is needed, which is the word itself. It is fine
since such a word cannot get split further.
Get the real unsplit word of the given word . While the Wordgraph is getting constructed when a subword has itself as one of its own alternatives it appears in the wordgraph only once still pointing to its original unsplit_word . It appears once in order not to complicate the graph and the unsplit_word is not changed in order not loss information ( all of these are implementation decisions ) . However for the hierarchy position of the word ( when it is a word to be issued i . e . a leaf node ) the real unsplit word is needed which is the word itself . It is fine since such a word cannot get split further .
Gword *find_real_unsplit_word(Gword *word, bool is_leaf)
{
	if (NULL == word->unsplit_word)
		return word;
	if (is_leaf && (word->status & WS_UNSPLIT))
		return word;
	return word->unsplit_word;
}
Gword * find_real_unsplit_word ( Gword * word , bool is_leaf ) { if ( NULL == word -> unsplit_word ) return word ; if ( is_leaf && ( word -> status & WS_UNSPLIT ) ) return word ; return word -> unsplit_word ; }
Get the real unsplit word of the given word.
Get the real unsplit word of the given word .
/* For the terminating word, return something unique. */