COUNT
- Last Updated: May 13, 2026
- 1 minute read
- Semaphore
- Documentation
Specifies the number of words that a skip rule may skip over or the number of words a near rule will skip over (NB where punctuation is not ignored then a punctuation element will be considered as a word).
Applies to
Values
- “[NN]”
- “[NN]:[MM]” minimum match - Since Semaphore 3.7
- “[NN]?” non-greedy match - Since Semaphore 3.7
- “[NN]:[MM]?” non-greedy minimum match - Since Semaphore 3.7
Where [NN] or [MM] is some number
Examples
test, data
Would be found by a phrase rule like:
<phrase punctuation="none">
<text data="test"/>
<skip count="1"/>
<text data="data"/>
</phrase>
Since Semaphore 3.7 a minimum count can be specified on the SKIP rule using “minimum:maximum” syntax
<phrase>
<skip count="1:5" />
<text data="some" />
<text data="data" />
</phrase>
This will only match “some data” when there is at least one word skipped from the start of the sentence (since the phrase rule is using sentence scope which is its default). This can be very useful when used in combination with the capture attribute when doing entity extraction.
Since Semaphore 3.7<staffonly> r55999</staffonly> a non-greedy behaviour may be specified for the SKIP rule by appending ?
<phrase extract="1" >
<phrase data="Start" />
<skip count="10?" extract_name="data"/>
<phrase data="stop"/>
</phrase>
Run on the following :-
Start A B stop C stop
Will capture “A B” rather than the greedy behaviour of capturing “A B stop C”