{
"fields": [
{
/* section group for 1st table */
"id": "_vehicles",
"type": "sections",
/* to get each row in vehicle table as a section,
use start and end to define the section group range
and .+ regex to match all rows as sections
(last section in group continues to end of doc unless forced)
*/
"range": {
/* avoid including the column headings as a section
using offsetY */
"offsetY": 0.2,
/* section group starts with 1st column heading in table */
"anchor": {
"start": {
"text": "Vehicle",
"type": "equals",
"isCaseSensitive": true
},
"match": {
/* Extract each row as a section. The underlying behavior is to
search for non-empty lines with regex ".+", then eliminate overlapping
horizontal sections and empty sections. */
"type": "regex",
"pattern": ".+"
},
/* to force the section group to end before "Schedule of coverages",
define identical matches for end and stop
(must define both to force the ".+" regex to end),
plus a stopOffsetY.
*/
"end": {
"type": "startsWith",
"text": "Schedule of coverages",
"isCaseSensitive": true
}
},
"stopOffsetY": -1.0,
"stop": {
"type": "startsWith",
"text": "Schedule of coverages",
"isCaseSensitive": true
},
},
"fields": [
{
"id": "vehicle_description",
"method": {
"id": "row",
"tiebreaker": 0
},
"anchor": {
"match": {
"type": "first"
}
}
},
/* to illustrate section range, print out all text in this section */
{
"id": "_everything_in_this_vehicle_row_section",
"method": {
"id": "documentRange",
"includeAnchor": true
},
"anchor": {
"match": {
"type": "first"
}
}
}
]
},
{
/* section group for 2nd table */
"id": "_coverages_per_vehicle",
"type": "sections",
"range": {
"direction": "vertical",
/* columnSelection specifies that each vertical section is a table slice that
combines the first two columns ("kept" columns) with one of the
numbered vehicle columns (3rd through last columns). */
"columnSelection": [
[
2,
-1
]
],
"anchor": {
"match": {
"type": "startsWith",
"text": "Schedule of coverages",
"isCaseSensitive": true
}
},
/* exclude "schedule of coverages" heading from section group
to avoid breaking column recognition */
"offsetY": 0.3
},
"fields": [
{
/* In each vertical section, the 2nd
cell to the right of "bodily injury liability"
is always the injury premium for that section's vehicle,
as configured by columnSelection */
"id": "bodily_liability_premium",
"type": "number",
"method": {
"id": "row",
"tiebreaker": "second"
},
"anchor": {
"match": {
"type": "includes",
"text": "bodily injury liability"
}
}
},
{
/* to illustrate section range, print out all text in this section */
"id": "_everything_in_this_coverage_vertical_section",
"method": {
"id": "documentRange",
"includeAnchor": true
},
"anchor": {
"match": {
"type": "first"
}
}
}
],
},
/* output a zipped section group that combines vehicle
info with coverage info */
{
"id": "zipped_vehicle_description_and_coverages",
"method": {
"id": "zip",
"source_ids": [
"_vehicles",
"_coverages_per_vehicle"
]
}
},
/* for cleaner output, remove the source
section groups. illustrates configurable field execution order nuances */
{
"id": "cleanup_raw_source_sections",
"method": {
"id": "suppressOutput",
"source_ids": [
/* remove these IDs to see section ranges displayed in the Sensible app */
"_vehicles",
"_coverages_per_vehicle"
]
}
}
]
}