NO TITLE FOUND
- Last Updated: October 30, 2026
- 1 minute read
- Semaphore
- Documentation
Often you will have several facts that COULD be returned and where you DO NOT want them all returned, only a specific one.
This can be because either you have multiple facts firing within the same context, or because you have several contexts that are firing within the document, or both.
The assumption behind all of this “there could be more than one context / fact firing” is that you cannot discriminate any more than you have already using the patterns in your contexts - and that to extract the fact you want, you have to open yourself up to perhaps matching on more than one fact or context
It is usually better to discriminate using a tighter more discriminatory pattern. However, if that is not possible, then the final trick in FACTS’ armoury is to use indexes, or counts, to count:
- from either the start or end of a context WHICH fact to extract
- from either the start or end of the document WHICH content to use / fact to extract.
We can set indexes both on a context - which is that case will select, or index, a particular context should more than one be firing in a document - and a fact.