MCPcopy Index your code
hub / github.com/FSoft-AI4Code/HyperAgent / get_text

Function get_text

src/hyperagent/utils.py:245–256  ·  view source on GitHub ↗

Retrieves the text within the specified range in the given document. Args: doc (str): The document to extract text from. range (dict): The range object specifying the start and end positions. Returns: str: The extracted text within the specified range.

(doc, range)

Source from the content-addressed store, hash-verified

243 return None
244
245def get_text(doc, range):
246 """
247 Retrieves the text within the specified range in the given document.
248
249 Args:
250 doc (str): The document to extract text from.
251 range (dict): The range object specifying the start and end positions.
252
253 Returns:
254 str: The extracted text within the specified range.
255 """
256 return doc[offset_at_position(doc, range["start"]):offset_at_position(doc, range["end"])]
257
258def offset_at_position(doc, position):
259 """

Callers 3

get_definitionMethod · 0.90
get_symbolsMethod · 0.90
get_referencesMethod · 0.90

Calls 1

offset_at_positionFunction · 0.85

Tested by

no test coverage detected