lq-text: LQT_StringToPhrase

API t_Phrase * LQT_StringToPhrase (db, String) t_LQTEXT_Database *db; char *String;

Purpose

Creates a data structure representing the natural language phrase contained in the given String.

Words in the phrase that could not possibly be in the index are not included in the structure. This could be because they are in the stop list or are too short, or because the IndexNumbers parameter is set to `off' in the database configuration file and the words begin with a digit.

Words that could be in the database, but are not, are also excluded, but in this case the phrase cannot of course be matched.

Words ending in * or ? are considered to be wildcards; they are expanded automatically by LQT_Make­Matches­Where, or you can use LQT_ExpandWildCard to iterate over all the matches.

You can use LQT_Number­Of­Words­In­Phrase on the returned result, if it is not NULL, to determine the number of words in the string that were recognised as words that are in the database.

The result of LQT_String­To­Phrase can be passed to LQT_Make­Matches to find all occurrences of the phrase in the database.

Returns

the created t_Phrase, or NULL if either an error occurred or there were no recognised words in the given String.

See Also: