Language.GenerateTerms(String, Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Generate regular expressions to match word sequences in original string.
public static string[] GenerateTerms (string phrase, int maxLength);
static member GenerateTerms : string * int -> string[]
Public Shared Function GenerateTerms (phrase As String, maxLength As Integer) As String()
Parameters
- phrase
- String
Original string to be processed.
- maxLength
- Int32
Maximum phrase length to support.
Returns
Array of regular expressions to match subsequences in input.
Remarks
This function will call CamelCase(String) and then will generate sub-phrases up to maxLength. For example an enumeration of AngusBeefAndGarlicPizza would generate: 'angus?', 'beefs?', 'garlics?', 'pizzas?', 'angus? beefs?', 'garlics? pizzas?' and 'angus beef and garlic pizza'. You can call it directly, or it is used when FieldReflector<T> generates terms or when TermsAttribute is used with a MaxPhrase argument.