GP
Size: a a a
GP
SМ
SМ
SМ
GP
SМ
GP
SМ
SМ
SМ
DD
MK
match.fact.spans
[[138, 157), [161, 163), [164, 166), [167, 171), [172, 180)]
match.fact
Документ(
нпа=НПА(
тип='федеральный закон',
принят=[Принятие(
принявший_орган=None,
дата=Date(
year=1996,
month=4,
day=1
),
номер='No 27-ФЗ'
)]
),
кодекс=None
)
M
MK
MK
ИГ
ИГ
def extract_subfacts(fact):
def rec_parse(attributes: Dict, prefix: str, accumulator: OrderedDict):
for name, value in attributes.items():
if isinstance(value, Chain):
accumulator[prefix + name] = {
'value': value.as_json,
'span': list(value.spans)[0],
}
elif isinstance(value, FactResult):
rec_parse(value.fact.attributes, prefix+name+'-', accumulator)
d = OrderedDict()
rec_parse(fact._raw.attributes, '', d)
return d