This section describes the implementation of text constraints used in LAPIS. Among the interesting features of the implementation is a novel region set representation, the region interval. Region intervals are particularly good at representing the result of a region relation operator. By a simple transformation, region intervals may be regarded as rectangles in two-dimensional space, allowing LAPIS to draw on earlier research in computational geometry to find a data structure suitable for storing and combining collections of region intervals.