Text Sequences¶
- class anchorpoint.textsequences.TextPassage(text)¶
A contiguous passage of text.
Can be used to compare passages while disregarding end punctuation.
- means(other)¶
Test if passages have the same text, disregarding end puncutation.
- Parameters
other (
Optional
[TextPassage
]) – the other passage to test against- Return type
- Returns
True if the two passages have the same text, False otherwise
>>> TextPassage("Hello, world.").means(TextPassage("Hello, world")) True >>> TextPassage("Hello world").means(TextPassage("Hello, world")) False
- class anchorpoint.textsequences.TextSequence(passages=None)¶
Sequential passages of text that need not be consecutive.
Unlike a Legislice Enactment, a TextSequence does not preserve the tree structure of the quoted document.
- __add__(other)¶
Combine TextSequences by merging their selected
TextPassage
s.- Return type
- __ge__(other)¶
Return self>=value.
- __gt__(other)¶
Return self>value.
- __init__(passages=None)¶
Make new TextSequence from
TextPassage
list.- Parameters
passages (
Optional
[List
[Optional
[TextPassage
]]]) – the text passages included in the TextSequence, which should be chosen to express a coherent idea. “None”s in the sequence represent spans of text that exist in the source document, but that haven’t been chosen to be part of the TextSequence.
- __repr__()¶
Return repr(self).
- __str__()¶
Return str(self).
- __weakref__¶
list of weak references to the object (if defined)
- means(other)¶
Test if all the passages in self and other correspond with each other.
- Return type
- strip()¶
Remove symbols representing missing text from the beginning and end.
- Return type