What you will get
| You say | You get |
|---|---|
| PR four seven eight is ready | [#478](https://github.com/OWNER/REPO/pull/478) is ready |
| Can you look at PR four seven eight? | Can you look at [#478](https://github.com/OWNER/REPO/pull/478)? |
| can you review PR four hundred seventy eight | can you review [#478](https://github.com/OWNER/REPO/pull/478) |
OWNER/REPO becomes your repository. In Slack the Markdown link arrives as a real link that reads #478. Every other app gets the Markdown text as it is.
How it works
Two steps of the pipeline do the work, in this order:
numbers_enturns the spoken number into digits. “PR four seven eight” becomes “PR 478”. It ships in the pipeline of a new install.github_refsfinds “PR” followed by digits and writes the link. This is the rule you add.
Steps
-
Open
~/.config/parrotflow/config.yaml. From the menu bar, use Settings, then Edit Config. -
Add the rule under the
transforms:key that is already in the file. Put your repository in place ofOWNER/REPO.transforms: - name: github_refs description: spoken PR numbers as links replace: '[#$1](https://github.com/OWNER/REPO/pull/$1)': ['/\bPR\s*#?(\d+)\b/']A source between slashes is a regular expression.
$1in the target is the number it captured.A new install already defines a
github_refstransform with a wider pattern. If yours has one, do not add a second. EditOWNER/REPOin the one that is there. See the rule a new config ships. -
Add
github_refsto the pipeline, on the line afternumbers_en. This is the default pipeline with the new step:transcription: pipeline: - transform: fillers - transform: fillers_fr when: language == "fr" - transform: dates_en - transform: numbers_en - transform: github_refs - transform: money_en - transform: disfluencyThe order matters. Put
github_refsabovenumbers_enand it sees “PR four seven eight”, which has no digits. The sentence then comes out as “PR 478 is ready”, with no link. -
Save the file. The app reloads it at once.
Check that it worked
The commands below use the full path to the app. If you installed with Homebrew, parrotflow runs the same binary.
Ask the app what it loaded:
/Applications/ParrotFlow.app/Contents/MacOS/ParrotFlow --check-config
The pipeline line has numbers_en right before github_refs:
· pipeline sentence_repair → vocabulary → transform fillers → transform fillers_fr when language == "fr" → transform dates_en → transform numbers_en → transform github_refs → transform money_en → transform disfluency
Then run one sentence through your pipeline. --replace uses your config and skips the steps that call a model.
/Applications/ParrotFlow.app/Contents/MacOS/ParrotFlow --replace "PR four seven eight is ready"
[#478](https://github.com/OWNER/REPO/pull/478) is ready
Last, dictate “PR four seven eight is ready” into a Slack message.
The rule a new config ships
A config written by a recent install defines github_refs with no step in the pipeline. It also matches “pull request”, “PR number” and issues. The words allowed between “PR” and the number come from ref_words under lists:, which ships in the same file.
lists:
ref_words: ["number", "nr", "no", "num", "hash", "numéro"]
transforms:
- name: github_refs
description: spoken PR and issue numbers as links
replace:
'[#$1](https://github.com/OWNER/REPO/pull/$1)':
['/\b(?:pull request|PR|P\.R\.)\s*(?:(?:{{ref_words}})\s+)?#?(\d+)\b/']
'[#$1](https://github.com/OWNER/REPO/issues/$1)':
['/\bissues?\s+(?:(?:{{ref_words}})\s+)?#?(\d+)\b/']
With your repository in both URLs and the same pipeline step, it gives:
| You say | You get |
|---|---|
| PR number four seven eight | [#478](https://github.com/OWNER/REPO/pull/478) |
| pull request four seven eight | [#478](https://github.com/OWNER/REPO/pull/478) |
| issue twelve is a duplicate | [#12](https://github.com/OWNER/REPO/issues/12) is a duplicate |
Limits
- The URL names one repository. Every PR number you say links there.
- “PR” needs its two letters together. If the recogniser writes “P R 123” with a space, the sentence is left alone.
- Only Slack gets a real link today. Other apps get the Markdown text.
- “the PR is ready” has no number, so nothing changes.
Related
- Programmable dictation, for rules, scripts and prompts.
- ParrotFlow for developers.
- Write your first rule, a plain table with no pattern.
- Pipelines, for step order, conditions and
app:.