PatternNode

PatternNode(pattern: Pattern)

Class representing a node in a StringTree.

Attributes:

  • right (PatternNode) –

    Node with matching strings.

  • left (PatternNode) –

    Node with non-matching strings.

  • pattern (Pattern) –

    Attributed Pattern object.

  • matches

    Strings which match a Pattern object attributed to the PatternNode.

  • strings

    All strings attributed to the PatternNode.

  • labels

    Labels of all strings attributed to the PatternNode.

  • scores

    Scores of an attributed pattern applied to the attributed strings.

Initialize a PatternNode.

Parameters:

  • pattern (Pattern) –

    A Pattern object attributed to a node.

get_labels

get_labels()

Get PatternNode.labels attribute

get_matches

get_matches()

Get PatternNode.matches attribute

get_pattern

get_pattern()

Get PatternNode.pattern attribute

get_scores

get_scores()

Get PatternNode.scores attribute

get_strings

get_strings()

Get PatternNode.strings attribute

set_labels

set_labels(labels)

Set PatternNode.labels attribute

set_matches

set_matches(matches)

Set PatternNode.matches attribute

set_pattern

set_pattern(pattern)

Set PatternNode.pattern attribute

set_scores

set_scores(scores)

Set PatternNode.scores attribute

set_strings

set_strings(strings)

Set PatternNode.strings attribute