File size: 639 Bytes
5374a2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from .module import BaseModule


class Parser(BaseModule):

    @classmethod
    def parse(cls, content: str, **kwargs):
        """
        the method used to parse text into a Parser object. Use Parser.from_str to parse input by default. 
        Args:
            content: The content to parse
            **kwargs: Additional keyword arguments
        Returns:
            Parser: The parsed Parser object
        """
        return cls.from_str(content, **kwargs)
    
    def save(self, path: str, **kwargs)-> str:
        """
        Save the Parser object to a file.
        """
        super().save_module(path, **kwargs)