File: automaton_keys.rst

package info (click to toggle)
python-pyahocorasick 1.4.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 748 kB
  • sloc: ansic: 4,554; python: 2,823; sh: 312; makefile: 242
file content (20 lines) | stat: -rw-r--r-- 833 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
keys([prefix, [wildcard, [how]]])
----------------------------------------------------------------------

Return an iterator on keys.
If the optional ``prefix`` string is provided, only yield keys starting
with this prefix.

If the optional ``wildcard`` is provided as a single character string,
then the prefix is treated as a simple pattern using this character
as a wildcard.

The optional ``how`` argument is used to control how strings are matched
using one of these possible values:

- **ahocorasick.MATCH_EXACT_LENGTH** (default)
  Yield matches that have the same exact length as the prefix length.
- **ahocorasick.MATCH_AT_LEAST_PREFIX**
  Yield matches that have a length greater or equal to the prefix length.
- **ahocorasick.MATCH_AT_MOST_PREFIX**
  Yield matches that have a length lesser or equal to the prefix length.