We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
decode
Span
1 parent 9f5653e commit bc41468Copy full SHA for bc41468
1 file changed
src/isaacus/types/ilgs/v1/span.py
@@ -26,3 +26,15 @@ class Span(BaseModel):
26
The zero-based end index of the half-open span (i.e., the end is exclusive) of
27
Unicode code points in the input text.
28
"""
29
+
30
+ def decode(self, text: str) -> str:
31
+ """Decode the span from the given text.
32
33
+ Args:
34
+ text (str): The input text from which to decode the span.
35
36
+ Returns:
37
+ str: The substring of the input text corresponding to the span.
38
+ """
39
40
+ return text[self.start:self.end]
0 commit comments