buildingmotif.label_parsing#
- analyze_failures(failures: Dict[str, List[TokenResult]])[source]#
Analyze the failures of a parser.
- parse_list(parser, target_list) Tuple[Dict[str, List[TokenResult]], Dict[str, List[TokenResult]]] [source]#
Parse a list of strings using the given parser.
- Parameters:
parser (Parser) – the parsing combinator function
target_list (List[str]) – the list of strings to parse
- Returns:
a tuple of the results and failures
- class TokenResult(value: Optional[str], token: Token, length: int, error: Optional[str] = None, id: Optional[str] = None)[source]#
A token result. Contains a token, the type of the token, the length of the token, and a possible error.
- value: Optional[str]#
- length: int#
- error: Optional[str] = None#
- id: Optional[str] = None#
- class Constant(value: URIRef)[source]#
A constant token. Contains a URI, probably some sort of Class
- value: URIRef#
Modules