Skip to content

Commit

Permalink
docs(fuzzy): exact match
Browse files Browse the repository at this point in the history
  • Loading branch information
kazhala committed Jan 28, 2022
1 parent a829a4c commit 35c879e
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions docs/pages/prompts/fuzzy.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,48 @@ choices = [
]
```

## Exact Sub-String Match

This prompt uses the [fzy](https://github.com/jhawthorn/fzy) fuzzy match algorithm by default. You can enable exact sub-string match
by using the parameter `match_exact`.

<details>
<summary>Classic Syntax (PyInquirer)</summary>

```{code-block} python
from InquirerPy import prompt
questions = [
{
"type": "fuzzy",
"message": "Select actions:",
"choices": ["hello", "weather", "what", "whoa", "hey", "yo"],
"match_exact": True,
"exact_symbol": " E", # indicator of exact match
},
]
result = prompt(questions=questions)
```

</details>

<details open>
<summary>Alternate Syntax</summary>

```{code-block} python
from InquirerPy import inquirer
result = inquirer.fuzzy(
message="Select actions:",
choices=["hello", "weather", "what", "whoa", "hey", "yo"],
match_exact=True,
exact_symbol=" E", # indicator of exact match
).execute()
```

</details>

## Reference

```{eval-rst}
Expand Down

0 comments on commit 35c879e

Please sign in to comment.