ApiBrain().RemoveStopwords

Takes an input string and removes the stopword Concepts, returning the result.

Description

Certain Conceptual processing may require only the most important “high-level” Concepts to be passed in from user input. This utility function automatically produces an output string from an input string of Concepts that has the “low-level” stopwords removed. These stopwords are found in the “linguistics” folder of the application.

The stopwords table needs to be loaded from a file when first creating a SILVIA Core. Depending on the platform, the parameter will either be a stopwords file name or a pre-read list of Strings passed in to the CreateCore function. If this is left null, there will be no stopwords to consider for removal or other related internal processing.

The second parameter in ApiBrain().RemoveStopwords is a list of Concepts in string form that should be left in the returned result, even if they exist in the stopwords table.

For instance, the stopword “when” may be important for this particular utterance, so you may specify this in the second parameter and it will not be removed automatically.

Example Usage (Java/C#)


string concepts = “where is the state of california”;

string importantConcepts = _core.ApiBrain().RemoveStopwords(concepts, “where what who why when how”);

Parameters

string

concepts

The string of space-separated Concepts to be stripped of stopwords.

string

include

The string of space-separated Concepts to be considered important, overriding any status as stopwords.

Returns

The string of space-separated Concepts, with removed stopwords.