Skip to content

Commit

Permalink
Updated docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
AlessioNar committed Dec 23, 2024
1 parent 5ad9064 commit 96ee062
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions tulit/parsers/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def get_preface(self, preface_xpath, paragraph_xpath) -> None:
"""
Extracts paragraphs from the preface section of the document.
Args
Parameters
----
preface_xpath : str
XPath expression to locate the preface element. For Akoma Ntoso, this is usually './/akn:preface', while for Formex it is './/TITLE'.
Expand All @@ -221,15 +221,19 @@ def get_preface(self, preface_xpath, paragraph_xpath) -> None:

def get_preamble(self, preamble_xpath, notes_xpath) -> None:
"""
Extracts complete preamble data from the document.
Extracts the preamble section from the document.
Parameters
----------
preamble_xpath : str
XPath expression to locate the preamble element. For Akoma Ntoso, this is usually './/akn:preamble', while for Formex it is './/PREAMBLE'.
notes_xpath : str
XPath expression to locate notes within the preamble. For Akoma Ntoso, this is usually './/akn:authorialNote', while for Formex it is './/NOTE'.
Returns
-------
dict
Dictionary containing preamble components with keys:
- 'formula': Formula text
- 'citations': List of citations
- 'recitals': List of recitals
None
Updates the instance's preamble attribute with the found preamble element, as well as the formula, citations, and recitals.
"""
self.preamble = self.root.find(preamble_xpath, namespaces=self.namespaces)

Expand All @@ -244,8 +248,8 @@ def get_body(self, body_xpath) -> None:
"""
Extracts the body element from the document.
Args
----
Parameters
----------
body_xpath : str
XPath expression to locate the body element. For Akoma Ntoso, this is usually './/akn:body', while for Formex it is './/ENACTING.TERMS'.
Expand Down

0 comments on commit 96ee062

Please sign in to comment.