.. _sdk_cli_wow_grep: ``wow.grep`` -- Semantic Grep ***************************** Semantic Grep -- or ``wow.grep`` -- is the command line utility provided by the ``eot-wowool-sdk`` Python package allowing you to easily use the functionality of the :ref:`Semantic Grep application `. Example ------- .. code-block:: console wow.grep -p "english,entity" -e "Adj Nn" -i "i have a green house." Your output shows how many times we have encountered that pattern in your texts/ .. code-block:: console Match: 1 | green house Another example using capture groups to capture persons' names and their descriptions: .. code-block:: console wow.grep -p "english,entity" \ -e "{Person}=MyPerson 'be' (Det)? {Adj (Nn)?}=Description" \ -i "John Doe is a good person but he is a terrible liar" The default output looks like this: .. code-block:: console Match: 1 | John Doe is a good person 1 | John Doe is a terrible liar Group: MyPerson 2 | John Doe Group: Description 1 | good person 1 | terrible liar Collocations: {Person}=MyPerson 'be' (Det)? {Adj (Nn)?}=Description cnt | MyPerson | Description -------+------------+--------------- 1 | John Doe | good person 1 | John Doe | terrible liar Where: * **Match** shows the matches of the whole expression preceded by the total number of occurrences in the corpus. * **Group** shows the matches of the capture groups preceded by the total number of occurrences in the corpus. * **Collocations** shows the collocations of the capture groups preceded by the total number of occurrences in the corpus. For more information on the json output, refer to the :ref:`JSON schema `. Usage ----- .. argparse:: :module: eot.wowool.tools.grep.argument_parser :func: ArgumentParser :prog: wow.grep