class SemanticType:
Known subclasses: bootstraparse.modules.syntax.AddFirstElementToLabel, bootstraparse.modules.syntax.AliasToken, bootstraparse.modules.syntax.BeAssignToken, bootstraparse.modules.syntax.BeValueToken, bootstraparse.modules.syntax.BlockQuoteAuthorToken, bootstraparse.modules.syntax.BlockQuoteToken, bootstraparse.modules.syntax.ClosedSemanticType, bootstraparse.modules.syntax.ExplicitSemanticType, bootstraparse.modules.syntax.FinalSemanticType, bootstraparse.modules.syntax.ImageToken, bootstraparse.modules.syntax.OpenedSemanticType, bootstraparse.modules.syntax.OptionalClassToken, bootstraparse.modules.syntax.OptionalInsertToken, bootstraparse.modules.syntax.OptionalToken, bootstraparse.modules.syntax.OptionalVarToken, bootstraparse.modules.syntax.TableCellToken, bootstraparse.modules.syntax.TableRowToken, bootstraparse.modules.syntax.TableSeparatorToken, bootstraparse.modules.syntax.TableToken, bootstraparse.modules.syntax.TokensToMatch, bootstraparse.modules.syntax.UnimplementedToken
Allows us to access basic operations and identify each token parsed.
| Method | __eq__ |
Undocumented |
| Method | __init__ |
Initialises the token. :param content: The content of the token. :type content: list[pp.ParseResults] |
| Method | __ne__ |
Undocumented |
| Method | __repr__ |
Undocumented |
| Method | __str__ |
Undocumented |
| Method | counterpart |
Function called by the context manager to know how to deal with the encapsulation of the token. Will return the counterpart of the token (the previous token to look for). :return: The counterpart of the token... |
| Method | to |
Function called by the context manager to know how to deal with the encapsulation of the token. :param filter_func: A function that will be used to filter the content of the token. :type filter_func: (callable| None) :return: Self if containable, the expected replacement token if it can, raises an error otherwise... |
| Method | to |
Function used for testing and readability purposes. Replaces matched markup with html-like tags. :return: The markup of the token. :rtype: str |
| Method | to |
Return the original string of the token. :return: The original string of the token. :rtype: str |
| Class Variable | label |
Undocumented |
| Instance Variable | content |
Undocumented |
| Instance Variable | file |
Undocumented |
| Instance Variable | label |
Undocumented |
| Instance Variable | line |
Undocumented |
bootstraparse.modules.syntax.AddFirstElementToLabel, bootstraparse.modules.syntax.LinebreakInitialises the token. :param content: The content of the token. :type content: list[pp.ParseResults]
bootstraparse.modules.syntax.ExplicitSemanticType, bootstraparse.modules.syntax.FinalSemanticType, bootstraparse.modules.syntax.StructuralElementEndToken, bootstraparse.modules.syntax.StructuralElementEndTokenFunction called by the context manager to know how to deal with the encapsulation of the token. Will return the counterpart of the token (the previous token to look for). :return: The counterpart of the token. :rtype: str | None
bootstraparse.modules.syntax.ExplicitSemanticType, bootstraparse.modules.syntax.FinalSemanticType, bootstraparse.modules.syntax.OpenedSemanticTypeFunction called by the context manager to know how to deal with the encapsulation of the token. :param filter_func: A function that will be used to filter the content of the token. :type filter_func: (callable| None) :return: Self if containable, the expected replacement token if it can, raises an error otherwise. :rtype: SemanticType | context_mngr.BaseContainer :raises CannotBeContainedError: Raises error if the token we were trying to encapsulate cannot be (probably mismatched).
bootstraparse.modules.syntax.EmptySemanticType, bootstraparse.modules.syntax.ExplicitSemanticTypeFunction used for testing and readability purposes. Replaces matched markup with html-like tags. :return: The markup of the token. :rtype: str
Return the original string of the token. :return: The original string of the token. :rtype: str
bootstraparse.modules.syntax.AliasToken, bootstraparse.modules.syntax.BeAssignToken, bootstraparse.modules.syntax.BeValueToken, bootstraparse.modules.syntax.BlockQuoteAuthorToken, bootstraparse.modules.syntax.BlockQuoteToken, bootstraparse.modules.syntax.CodeToken, bootstraparse.modules.syntax.CodeToken, bootstraparse.modules.syntax.DisplayToken, bootstraparse.modules.syntax.EtCustomSpanToken, bootstraparse.modules.syntax.EtCustomSpanToken, bootstraparse.modules.syntax.EtCustomSpanToken, bootstraparse.modules.syntax.EtEmToken, bootstraparse.modules.syntax.EtEmToken, bootstraparse.modules.syntax.EtOlistToken, bootstraparse.modules.syntax.EtStrikethroughToken, bootstraparse.modules.syntax.EtStrikethroughToken, bootstraparse.modules.syntax.EtStrongToken, bootstraparse.modules.syntax.EtStrongToken, bootstraparse.modules.syntax.EtUlistToken, bootstraparse.modules.syntax.EtUnderlineToken, bootstraparse.modules.syntax.EtUnderlineToken, bootstraparse.modules.syntax.HeaderToken, bootstraparse.modules.syntax.HyperlinkToken, bootstraparse.modules.syntax.ImageToken, bootstraparse.modules.syntax.Linebreak, bootstraparse.modules.syntax.OptionalClassToken, bootstraparse.modules.syntax.OptionalInsertToken, bootstraparse.modules.syntax.OptionalToken, bootstraparse.modules.syntax.OptionalVarToken, bootstraparse.modules.syntax.StructuralElementEndToken, bootstraparse.modules.syntax.StructuralElementEndToken, bootstraparse.modules.syntax.StructuralElementStartToken, bootstraparse.modules.syntax.StructuralElementStartToken, bootstraparse.modules.syntax.StructuralElementStartToken, bootstraparse.modules.syntax.TableCellToken, bootstraparse.modules.syntax.TableRowToken, bootstraparse.modules.syntax.TableSeparatorToken, bootstraparse.modules.syntax.TableToken, bootstraparse.modules.syntax.TextToken, bootstraparse.modules.syntax.UnimplementedTokenUndocumented