MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / get_full_matched_text

Function get_full_matched_text

src/licensedcode/match.py:3170–3210  ·  view source on GitHub ↗

Yield strings corresponding to the full matched query text given a ``match`` LicenseMatch detected with an `idx` LicenseIndex in a query file at ``location`` or a ``query_string``. See get_full_qspan_matched_text() for other arguments documentation

(
    match,
    location=None,
    query_string=None,
    idx=None,
    whole_lines=False,
    highlight=True,
    highlight_matched='{}',
    highlight_not_matched='[{}]',
    only_matched=False,
    stopwords=STOPWORDS,
    _usecache=True,
    trace=TRACE_MATCHED_TEXT,
)

Source from the content-addressed store, hash-verified

3168
3169
3170def get_full_matched_text(
3171 match,
3172 location=None,
3173 query_string=None,
3174 idx=None,
3175 whole_lines=False,
3176 highlight=True,
3177 highlight_matched='{}',
3178 highlight_not_matched='[{}]',
3179 only_matched=False,
3180 stopwords=STOPWORDS,
3181 _usecache=True,
3182 trace=TRACE_MATCHED_TEXT,
3183):
3184 """
3185 Yield strings corresponding to the full matched query text given a ``match``
3186 LicenseMatch detected with an `idx` LicenseIndex in a query file at
3187 ``location`` or a ``query_string``.
3188
3189 See get_full_qspan_matched_text() for other arguments documentation
3190 """
3191 if trace:
3192 logger_debug('get_full_matched_text: match:', match)
3193
3194 return get_full_qspan_matched_text(
3195 match_qspan=match.qspan,
3196 match_query_start_line=match.query.start_line,
3197 match_start_line=match.start_line,
3198 match_end_line=match.end_line,
3199 location=location,
3200 query_string=query_string,
3201 idx=idx,
3202 whole_lines=whole_lines,
3203 highlight=highlight,
3204 highlight_matched=highlight_matched,
3205 highlight_not_matched=highlight_not_matched,
3206 only_matched=only_matched,
3207 stopwords=stopwords,
3208 _usecache=_usecache,
3209 trace=trace,
3210 )
3211
3212
3213def get_full_qspan_matched_text(

Calls 2

logger_debugFunction · 0.70