mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
Update block docs for: text_decoder.md
This commit is contained in:
35
docs/content/platform/blocks/update/text_decoder.md
Normal file
35
docs/content/platform/blocks/update/text_decoder.md
Normal file
@@ -0,0 +1,35 @@
|
||||
|
||||
## Text Decoder
|
||||
|
||||
### What it is
|
||||
A specialized tool that converts text containing special escape sequences into their proper readable format.
|
||||
|
||||
### What it does
|
||||
This block takes text that contains special characters written in an escaped format (like '\n' for new lines or '\"' for quotation marks) and converts them into their actual readable representations. It transforms encoded special characters into their proper visual format.
|
||||
|
||||
### How it works
|
||||
The block processes the input text by identifying special character sequences (escape sequences) and replacing them with their actual intended characters. For example, when it sees '\n', it creates an actual line break in the text, and when it sees '\"', it creates an actual quotation mark.
|
||||
|
||||
### Inputs
|
||||
- Text: The input text that contains escaped characters. This can be any text string that includes special characters written in their escaped form (like \n for new lines or \" for quote marks).
|
||||
|
||||
### Outputs
|
||||
- Decoded Text: The final text with all escape sequences properly converted into their actual characters. The output shows the text as it was meant to be displayed, with proper formatting and special characters.
|
||||
|
||||
### Possible use cases
|
||||
1. Converting copied code comments into readable documentation
|
||||
2. Processing user input that contains special formatting
|
||||
3. Cleaning up text exported from various systems where special characters were escaped
|
||||
4. Converting formatted strings from programming languages into human-readable text
|
||||
5. Processing JSON or other data format strings where special characters are escaped
|
||||
|
||||
For example, if you have text copied from a programming file that looks like:
|
||||
"Hello\nWorld!\nThis is a \"quoted\" string"
|
||||
The block will convert it to display as:
|
||||
```
|
||||
Hello
|
||||
World!
|
||||
This is a "quoted" string
|
||||
```
|
||||
|
||||
This block is particularly useful when working with text that comes from technical sources or programming environments and needs to be converted into a human-readable format.
|
||||
Reference in New Issue
Block a user