Near Unordered Across Phrases In Document
- Last Updated: July 24, 2026
- 3 minute read
- Semaphore
- Documentation
Summary
The Near Unordered Across Phrases In Document Context looks for facts and / or anchors each in different phrases in the same document where those phrases are unordered and separated by at most a specified number of words, which is set by the near count metadata.
Usage notes
The count on this extractor refers to the number of tokens (that is, words, and, if you choose to not ignore punctuation, punctuation marks as well) between the words (that is, phrase ranges) that each independently contain an anchor or a fact within the single document. That is, phrase ranges are enforced to be non-overlapping.
Example model and tests
For an example model of this context extracting facts, please go to the near_unordered_contexts page. The example given there can be applied to phrases, sentences or paragraphs equally.
Positive test content
A near unordered across phrases in document fact, with child concept facts of ‘apple’ and ‘pear’ and a near count set to ‘3’ will fire for both:
apple and pear stew
Negative test content
A near unordered across phrases in document fact, with child concept facts of ‘apple’ and ‘pear’ and a near count set to ‘3’ will not fire for either:
Apple and some more words here pear stew
Near Unordered Across Phrases In Document Context Properties
Mandatory hierarchical relationships
| Label | Range | Constraints |
|---|---|---|
| fact | Context Elements | one or more allowed |
| or | ||
| not anchor | Context Elements | one or more allowed |
| or | ||
| anchor | Context Elements | one or more allowed |
| or | ||
| not fact | Context Elements | one or more allowed |
Optional hierarchical relationships
| Label | Range | Constraints |
|---|---|---|
| anchor | Context Elements | one or more allowed |
| not anchor | Context Elements | one or more allowed |
| not fact | Context Elements | one or more allowed |
| optional anchor | Context Elements | one or more allowed |
| optional fact | Context Elements | one or more allowed |
Mandatory associative relationships
| Label | Range | Constraints |
|---|---|---|
| (none) |
Optional associative relationships
| Label | Range | Constraints |
|---|---|---|
| depended on by context | Contexts | only one allowed |
| depends on context | Contexts | only one allowed |
| extract fact as | Fact Name | only one allowed |
| group fact as | Fact Name | only one allowed |
| location | Locations | only one allowed |
| precluded by context | Contexts | only one allowed |
| precludes_context | Contexts | only one allowed |
| punctuation | Punctuation rules | only one allowed |
Mandatory alternative labels
| Label | Range | Constraints |
|---|---|---|
| (none) |
Optional alternative labels
| Label | Range | Constraints |
|---|---|---|
| (none) |
Mandatory metadata
| Label | Range | Constraints |
|---|---|---|
| near count | Integer | only one allowed |
Optional metadata
| Label | Range | Constraints |
|---|---|---|
| context position from document end | Integer | only one allowed |
| context position from document start | Integer | only one allowed |
| fact position from context end | Integer | only one allowed |
| fact position from context start | Integer | only one allowed |
| field | String | only one allowed |
| return group fact ID | Boolean | only one allowed |
| return raw text also | Boolean | only one allowed |
| return value using regex | String | only one allowed |
| {1-10} greedy repeat | Integer | one or more allowed |
| {1-10} non-greedy repeat | Integer | one or more allowed |
| debug | Boolean | only one allowed |
