> ## Documentation Index
> Fetch the complete documentation index at: https://fossabot.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Phrase Groups

Phrase groups allow you to define a set of phrases that must be matched in order to trigger a keyword. Every single phrase within a given phrase group **must** match, else Fossabot will continue to match other groups.

You can have multiple phrase groups per keyword, which act as "OR" statements for triggering a keyword. Phrase groups are by default fuzzy-matched and case-insensitive, but there are optional flags that allow you to customize the matching behaviour of a given phrase:

## Adding a phrase to a group

To add a phrase to a phrase group, simply click inside a phrase group:

<img src="https://mintcdn.com/fossadev/CPTmXSRcXIGlG-eS/img/keywords/adding-phrase-step-1.png?fit=max&auto=format&n=CPTmXSRcXIGlG-eS&q=85&s=55401f9e3a63e3780ab138a25ef2fc90" alt="First step to adding a phrase" width="753" height="179" data-path="img/keywords/adding-phrase-step-1.png" />

Then type the phrase into the input:

<img src="https://mintcdn.com/fossadev/CPTmXSRcXIGlG-eS/img/keywords/adding-phrase-step-2.png?fit=max&auto=format&n=CPTmXSRcXIGlG-eS&q=85&s=adabdaf78911c3e9d5713dc7dd403391" alt="Second step to adding a phrase" width="748" height="186" data-path="img/keywords/adding-phrase-step-2.png" />

Finally, hit the **return key on your keyboard** to add it to the phrase:

<img src="https://mintcdn.com/fossadev/CPTmXSRcXIGlG-eS/img/keywords/adding-phrase-step-3.png?fit=max&auto=format&n=CPTmXSRcXIGlG-eS&q=85&s=87cb8054cf65786ae16e05440d9d56b9" alt="Third step to adding a phrase" width="744" height="181" data-path="img/keywords/adding-phrase-step-3.png" />

You should see the phrase in a blue tag, this means it has been added to the keyword phrase group.

## Using phrase groups

Consider the following phrase group:

<img src="https://mintcdn.com/fossadev/CPTmXSRcXIGlG-eS/img/keywords/example-1.png?fit=max&auto=format&n=CPTmXSRcXIGlG-eS&q=85&s=8f52ec5b6c820717900af4d193a193ef" alt="First example" width="784" height="239" data-path="img/keywords/example-1.png" />

This phrase group will trigger if `you`, `are` and `awesome` appear **anywhere** in the message content. So `you are awesome` could match, but so could `awesome are you` or even `you are not awesome`. This also ignores spaces, so `you're aren't awesomest` would also be matched by Fossabot.

However, you could combine these phrases into a single phrase:

<img src="https://mintcdn.com/fossadev/CPTmXSRcXIGlG-eS/img/keywords/example-2.png?fit=max&auto=format&n=CPTmXSRcXIGlG-eS&q=85&s=1d2039d89183ad5d978b33f44465867a" alt="Second example" width="760" height="235" data-path="img/keywords/example-2.png" />

Then Fossabot would match `you are awesome!!`, but **not** `you are not awesome` - as the entire phrase block is not able to be matched **anywhere** in `you are not awesome`.

## Multiple phrase groups

Assuming a use case where you would like to match `you are awesome` or `you are cool`, it may be your first instinct to do something like this:

<img src="https://mintcdn.com/fossadev/CPTmXSRcXIGlG-eS/img/keywords/incorrect-phrase-group.png?fit=max&auto=format&n=CPTmXSRcXIGlG-eS&q=85&s=54ac34afe3220a8e5248765e60d380e9" alt="Example of an incorrect phrase group" width="748" height="237" data-path="img/keywords/incorrect-phrase-group.png" />

However, **this is incorrect!** You are asking Fossabot to only match content that contains **both** `you are cool` **AND** `you are awesome`. You will want to create multiple phrase groups to create an `OR` condition, where instead you ask Fossabot to match if **either** phrase exists.

Click the `Add Phrase Group` button, it will add another input, and move `you are cool` into the below phrase group like so:

<img src="https://mintcdn.com/fossadev/CPTmXSRcXIGlG-eS/img/keywords/correct-phrase-group.png?fit=max&auto=format&n=CPTmXSRcXIGlG-eS&q=85&s=2633fff5be080d1b9ee4fb590f4c4a21" alt="Example of a correct phrase group" width="759" height="282" data-path="img/keywords/correct-phrase-group.png" />

This will then match if **either** `you are cool` OR `you are awesome` is contained within the message content!


## Related topics

- [Creating a Lookalike](/docs/lookalikes/creating-lookalikes.md)
- [Variables](/docs/keywords/variables.md)
- [$(autoreason)](/docs/keywords/autoreason.md)
- [Keywords](/docs/keywords/index.md)
- [Flags](/docs/keywords/flags.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.