Example #1
0
def extract(
    id 			="text",
    content 	="text",
    part_index  ="int",
    chap_index 	="int",
    chap_start 	="int",
    chap_end 	="int"

    ):
	rs = divlaw.divPart(content)
	chap = divlaw.getChapter(rs,part_index,chap_index)
	totalSec = chap['totalSec']
	if totalSec > 0:
		for i in range(0,totalSec):
			yield [
				id,
				part_index,
				chap_index,
				totalSec,
				i,
				chap['secs'][i]['start'],
				chap['secs'][i]['end'],
				chap['secs'][i]['name']
			]
	else :
		yield [
			id,
			part_index,
			chap_index,
			0,
			0,
			chap_start,
			chap_end,
			None
		]
def extract(id="text",
            content="text",
            part_index="int",
            chap_index="int",
            sec_index="int",
            sec_start="int",
            sec_end="int"):

    rs = divlaw.divPart(content)
    sec = divlaw.getSection(rs, part_index, chap_index, sec_index)
    totalLaw = sec['totalLaw']
    if totalLaw > 0:
        for i in range(0, totalLaw):
            start = sec['laws'][i]['start']
            end = sec['laws'][i]['end']
            title_end = end
            list_items = divlaw.newDivItem(content[start:end], start)
            if list_items[1] > 0:
                title_end = list_items[0][0]['start']
            yield [
                id, part_index, chap_index, sec_index, totalLaw, i, start, end,
                sec['laws'][i]['name'], content[start:end], title_end
            ]
    else:
        yield [
            id, part_index, chap_index, sec_index, 0, 0, sec_start, sec_end,
            "", "", sec_end
        ]
Example #3
0
def extract(
    id="text",
    content="text",
    part_index="int",
    chap_index="int",
    sec_index="int",
    law_index="int",
    law_start="int",
    law_end="int",
):

    result = divlaw.divPart(content)
    law = divlaw.getLaw(result, part_index, chap_index, sec_index, law_index)
    totalItem = law['totalItem']
    if totalItem > 0:
        for i in range(0, totalItem):
            start = law['items'][i]['start']
            end = law['items'][i]['end']
            yield [
                id, part_index, chap_index, sec_index, law_index, totalItem, i,
                start, end, law['items'][i]['name'], content[start:end]
            ]
    else:
        yield [
            id, part_index, chap_index, sec_index, law_index, 0, 0, law_start,
            law_end, None, None
        ]
def extract(doc_id="text", law_structor="text[]"):

    a = divlaw.divPart(content)
    yield [
        doc_id,
        a,
    ]
Example #5
0
def extract(
    id="text",
    content="text",
    part_index="int",
    chap_index="int",
    sec_index="int",
    law_index="int",
    item_index="int",
    item_start="int",
    item_end="int",
):

    result = divlaw.divPart(content)
    item = divlaw.getItem(result, part_index, chap_index, sec_index, law_index,
                          item_index)
    totalPoint = item['totalPoint']
    if totalPoint > 0:
        for i in range(0, totalPoint):
            start = item['points'][i]['start']
            end = item['points'][i]['end']
            yield [
                id, part_index, chap_index, sec_index, law_index, item_index,
                totalPoint, i, start, end, item['points'][i]['name'],
                content[start:end]
            ]
    else:
        yield [
            id, part_index, chap_index, sec_index, law_index, item_index, 0, 0,
            item_start, item_end, None, None
        ]
def extract(id="text",
            content="text",
            part_index="int",
            part_start="int",
            part_end="int"):

    rs = divlaw.divPart(content)
    part = divlaw.getPart(rs, part_index)
    totalChap = part['totalChap']

    if totalChap > 0:
        for i in range(0, totalChap):
            yield [
                id, part_index, totalChap, i, part['chaps'][i]['start'],
                part['chaps'][i]['end'], part['chaps'][i]['name']
            ]
    else:
        yield [id, part_index, 0, 0, part_start, part_end, None]
Example #7
0
def extract(id="text", content="text"):

    a = divlaw.divPart(content)
    totalPart = divlaw.getTotalPart(a)
    if totalPart > 0:
        for i in range(0, totalPart):
            yield [
                id,
                totalPart,
                i,
                divlaw.getPart(a, i)['start'],
                divlaw.getPart(a, i)['end'],
                divlaw.getPart(a, i)['name'],
            ]
    else:
        yield [
            id,
            0,
            0,
            divlaw.getPart(a, 0)['start'],
            divlaw.getPart(a, 0)['end'],
            None,
        ]