compass.utilities.parsing#

COMPASS ordinance parsing utilities

Functions

clean_backticks_from_llm_response(content)

Remove markdown-style backticks from an LLM response

extract_ord_year_from_doc_attrs(doc_attrs)

Extract the ordinance year stored in document attributes

llm_response_as_json(content)

Parse a raw LLM response into JSON-compatible data

load_config(config_fp)

Load configuration data from JSON or JSON5 sources

merge_overlapping_texts(text_chunks[, n])

Merge text chunks while trimming overlapping boundaries

num_ordinances_dataframe(data[, ...])

Count ordinance rows contained in a DataFrame

num_ordinances_in_doc(doc[, exclude_features])

Count the number of ordinance entries on a document

ordinances_bool_index(data)

Compute a boolean mask indicating ordinance rows