Table Text Function
Description
Section titled “Description”The Table: Text Function step applies a text function to the columns of each row that the function reads and writes the result to a new column of a copy of the source table. A NULL in any column the function reads gives NULL.
Source & Options
Section titled “Source & Options”- Source Table and Output Table — the table to read and the table to write.
- Function — the function to apply. The form offers the functions in the two tables below and shows one column field, labeled for its role, for each argument the selected function reads.
- Argument columns — the columns the function reads, in the order the table lists them. Each is required.
- Output column — the name of the column added to the copy of the source.
| Function | Arguments | Result |
|---|---|---|
levenshtein |
First column, Second column | Case-sensitive edit distance, as a whole number |
soundex |
Text | Text |
json_format |
JSON | Pretty-printed JSON text |
json_field |
JSON, Path | Text |
json_set_text, json_set_number, json_set_boolean |
JSON, Path, Value | JSON text with the value set |
regex_match |
Text, Pattern, Match case | True or false |
regex_search |
Text, Pattern, Occurrence, Match case | Position, as a whole number |
regex_extract |
Text, Pattern, Occurrence, Match case | Text |
regex_replace |
Text, Pattern, Replacement, Match case | Text |
to_text_number |
Number, Pattern | Text: the number written with a DecimalFormat-style pattern |
to_text_datetime |
Date/time, Pattern | Text: the date written with a date-time pattern |
parse_date |
Text, Pattern | The text read as a date |
parse_datetime |
Text, Pattern | The text read as a date-time |
A converted Savant analysis can carry any of these functions, and they run the same way. A function the form does not offer shows its stored columns and is kept exactly as saved.
More Functions
Section titled “More Functions”The Function list also offers these functions. Converted KNIME workflows use them too.
| Function | Arguments | Result |
|---|---|---|
damerau_levenshtein, hamming, lcs |
First column, Second column | The matching edit distance, as a whole number |
jaro, jaro_winkler |
First column, Second column | 1 minus the similarity, 0 for equal texts |
ngram_distance |
First column, Second column | 1 minus the Dice coefficient of the character bigrams |
jaccard_tokens, dice_tokens, cosine_tokens |
First column, Second column | 1 minus the set similarity of the words of the two texts, 1 when either has none |
java_compare |
First column, Second column | The difference of the first differing characters, as Java’s compareTo gives it, as a whole number |
java_regex |
Text, Pattern, Replacement (replace mode only) | A Java regular expression read from a column: true or false in the matches and find modes, text in extract and replace |
knime_count |
Text, Search text | How many times the search text occurs, as a whole number |
knime_binomial, long_pow |
Two numbers | The binomial coefficient, or the integer power, in 64-bit arithmetic that wraps |
encode, decode |
Text | The text as base64 bytes in a character set, and back |
url_encode |
Text | The text percent-encoded as a form value, a space written + |
list_sort_numeric |
Text | A list held as separated text, sorted by numeric value |
geojson_to_wkt |
JSON, Path | The GeoJSON geometry at a path such as $.a[0], or $ for the text itself, as WKT |
json_patch_apply |
JSON | The document with a JSON Patch or Merge Patch applied |
json_diff |
First JSON, Second JSON | The JSON Patch that turns the first document into the second |
json_schema_check |
JSON | The errors the document has against a JSON Schema, as JSON; NULL when it has none |
json_normalize |
JSON | The document as normalized JSON text |
json_to_xml, xml_to_json |
Document | The document converted to XML, or to JSON |
xml_well_formed |
XML | The text when it is well-formed XML, else NULL |
xslt |
XML, Stylesheet | The document transformed by the XSLT stylesheet |
message_text, message_tool_calls |
JSON | The text of an AI message, or its tool calls as JSON |
Set a function’s options in function_options:
java_regex—mode:matches(default, the whole text),find(anywhere),extract(groupgroupof the first match, default 0) orreplace(every match);flagsiignores case.knime_count—modifiers:iignores case,wcounts whole words between whitespace.encodeanddecode—charset, a Java character set name; the default is UTF-8.json_patch_apply—patch, the JSON Patch array or Merge Patch object;mergeis true for a Merge Patch;keepkeeps the document when a patch test fails.json_schema_check—schema;failstops the step at the first error instead of returning it.json_normalize—commentsallows/* */and//comments;fail(default true) stops the step on text that is not JSON, and false gives NULL.json_to_xml—root,item,typed,parent_keys,namespace,text_keyandtext_key_enabled.xml_to_json—text_key,commentsandpis.list_sort_numeric—separator;empty, the text written for a list with no elements; andmissing, the text of a missing element, sorted last.
By default the step reads every column of the source and writes every source column followed by the output column. Set source_columns to read only some columns, and target_columns (each {source, target, dtype}) to choose and order the written columns. A target column named like the output column takes its place, with the data type given.
Related
Section titled “Related”- Table Extract — expressions for other text work
- Table Fuzzy Match