TEXT_CONCAT
The TEXT_CONCAT node takes in two TextBlob DataContainer type and concatenates the text string.Inputs
------
a: TextBlob
The input text to be concatenated to input b
b: TextBlob
The input text to be concatenated to input aParams:delimiter : "space" | "comma" | "semicolon" | "colon" | "new line" | "none", default="space"Select the delimiter to place between two text.Returns:out : TextBlobThe text result from concatenation.
Python Code
from flojoy import TextBlob, flojoy
from typing import Literal
@flojoy
def TEXT_CONCAT(
a: TextBlob,
b: TextBlob,
delimiter: Literal[
"space", "comma", "semicolon", "colon", "new line", "none"
] = "space",
) -> TextBlob:
"""The TEXT_CONCAT node takes in two TextBlob DataContainer type and concatenates the text string.
Inputs
------
a: TextBlob
The input text to be concatenated to input b
b: TextBlob
The input text to be concatenated to input a
Parameters
----------
delimiter: "space" | "comma" | "semicolon" | "colon" | "new line" | "none", default="space"
Select the delimiter to place between two text.
Returns
-------
TextBlob
The text result from concatenation.
"""
delim: str = None
match delimiter:
case "space":
delim = " "
case "comma":
delim = ","
case "semicolon":
delim = ";"
case "colon":
delim = ":"
case "new line":
delim = "\n"
case "none":
delim = ""
return TextBlob(text_blob=delim.join([a.text_blob, b.text_blob]))
Example
Having problem with this example app? Join our Discord community and we will help you out!
In this example, we generate two texts using TEXT
node. Then the texts are concatenated using the TEXT_CONCAT
node with a delimiter specified that has space set as the default. The new text is visualized with TEXT_VIEW
node.