prefix_function
Computes the KMP prefix/failure function array for an input string and optionally counts pattern occurrences to support string matching and failure-link analysis.
Instructions
Compute the KMP prefix/failure function array, with optional pattern occurrence counting.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"text": "<text>"
},
"name": "prefix_function"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Input string (max 1,000,000 chars) | |
| pattern | No | Optional pattern to count occurrences of |