| 
    Formatron v0.4.11
     
     
    
   Formatron empowers everyone to control the output format of language models with minimal overhead. 
   | 
 
An abstract extractor that extracts data from a string and offers its KBNF rules definition. More...
  
Public Member Functions | |
| __init__ (self, typing.Optional[str] capture_name=None) | |
| Initialize an extractor.   | |
| typing.Optional[tuple[str, typing.Any]] | extract (self, str input_str) | 
Extract data from the input string, or None if the extraction failed.   | |
| str | kbnf_reference (self) | 
| __str__ (self) | |
| str | kbnf_definition (self) | 
Protected Attributes | |
| _capture_name | |
Properties | |
| typing.Optional[str] | capture_name (self) | 
Get the name of the capture, or None if the extractor does not capture.   | |
An abstract extractor that extracts data from a string and offers its KBNF rules definition.
Definition at line 14 of file extractor.py.
| formatron.extractor.Extractor.__init__ | ( | self, | |
| typing.Optional[str] | capture_name = None ) | 
Initialize an extractor.
| capture_name | The name of the capture, or None if the extractor does not capture.  | 
Reimplemented in formatron.extractor.ChoiceExtractor, formatron.extractor.LiteralExtractor, formatron.extractor.NonterminalExtractor, formatron.extractor.SubstringExtractor, formatron.formats.json.JsonExtractor, formatron.formats.regex.RegexComplementExtractor, and formatron.formats.regex.RegexExtractor.
Definition at line 21 of file extractor.py.
| formatron.extractor.Extractor.__str__ | ( | self | ) | 
Definition at line 69 of file extractor.py.
| typing.Optional[str] formatron.extractor.Extractor.capture_name | ( | self | ) | 
Get the name of the capture, or None if the extractor does not capture. 
Definition at line 35 of file extractor.py.
| typing.Optional[tuple[str, typing.Any]] formatron.extractor.Extractor.extract | ( | self, | |
| str | input_str ) | 
Extract data from the input string, or None if the extraction failed. 
| input_str | The input string. | 
None if the extraction failed. Reimplemented in formatron.extractor.ChoiceExtractor, formatron.extractor.LiteralExtractor, formatron.extractor.SubstringExtractor, formatron.formats.json.JsonExtractor, formatron.formats.regex.RegexComplementExtractor, and formatron.formats.regex.RegexExtractor.
Definition at line 48 of file extractor.py.
| str formatron.extractor.Extractor.kbnf_definition | ( | self | ) | 
Reimplemented in formatron.extractor.ChoiceExtractor, formatron.extractor.LiteralExtractor, formatron.extractor.SubstringExtractor, formatron.formats.json.JsonExtractor, formatron.formats.regex.RegexComplementExtractor, and formatron.formats.regex.RegexExtractor.
Definition at line 92 of file extractor.py.
| str formatron.extractor.Extractor.kbnf_reference | ( | self | ) | 
Reimplemented in formatron.extractor.LiteralExtractor, and formatron.extractor.NonterminalExtractor.
Definition at line 67 of file extractor.py.
      
  | 
  protected | 
Definition at line 22 of file extractor.py.