macro (PDL)
Arguments
The function requires a macro_name and takes it from the list of configured macros. The optional parameter argument is a special named argument or value that can be passed to a macro expression.
Examples
If a user wants to find a phrase containing the words "director" followed by a verb and the word "project" and a phrase containing the word "manager" followed by a verb and the word "contract", one can write the following queries:
As these queries contain the same pattern, instead of copy-pasting the same part multiple times, one can declare a macro that holds these repeated queries.
A user can create a macro called my_macro containing arguments x and y. Then he should set a macro expansion phrase(x, lemma(verb), y).
To call this macro, a user can write the following query expression:
-
If you have created a PDL macro named my_macro with the expression annual sales, then query macro(MyMacro) will be equivalent to the query annual sales.
-
The user can configure user macros, project macros or server macros and use them in text analysis nodes like Search Query or Taxonomy. It is also possible to create macros directly in Search Query and Taxonomy nodes. For more information about macros, see the Using Macros section.