memoryscope.core.utils.response_text_parser

class memoryscope.core.utils.response_text_parser.ResponseTextParser(response_text: str, language: LanguageEnum, logger_prefix: str = '')[source]

Bases: object

The ResponseTextParser class is designed to parse and process response texts. It provides methods to extract patterns from the text and filter out unnecessary information, while also logging the processing steps and outcomes.

PATTERN_V1 = re.compile('<(.*?)>')
__init__(response_text: str, language: LanguageEnum, logger_prefix: str = '')[source]
response_text: str
language: LanguageEnum
logger_prefix: str
logger: Logger
parse_v1() List[List[str]][source]

Extract specific patterns from the text which match content within angle brackets.

Returns:

Contents match the specific patterns.

parse_v2() List[str][source]

Extract lines which contain NONE_WORD.

Returns:

Contents match the specific patterns.