From 0cdb571c50ab0a39e665e66a866b05cf2255783c Mon Sep 17 00:00:00 2001 From: imilinovic Date: Wed, 16 Aug 2023 13:55:03 +0200 Subject: [PATCH 1/2] text query module docs --- mage/query-modules/cpp/text.md | 59 +++++++++++++++++++++++++++++++++ mage/templates/_mage_spells.mdx | 1 + sidebars/sidebarsMAGE.js | 1 + 3 files changed, 61 insertions(+) create mode 100644 mage/query-modules/cpp/text.md diff --git a/mage/query-modules/cpp/text.md b/mage/query-modules/cpp/text.md new file mode 100644 index 00000000000..3c076d1d589 --- /dev/null +++ b/mage/query-modules/cpp/text.md @@ -0,0 +1,59 @@ +--- +id: text +title: text +sidebar_label: texxt +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import RunOnSubgraph from '../../templates/_run_on_subgraph.mdx'; + +export const Highlight = ({children, color}) => ( + +{children} + +); + +The `text` module offers a toolkit for manipulating strings. + +[![docs-source](https://img.shields.io/badge/source-map-FB6E00?logo=github&style=for-the-badge)](https://github.com/memgraph/mage/tree/main/cpp/map_module) + +| Trait | Value | +| ------------------- | ----------------------------------------------------- | +| **Module type** | **algorithm** | +| **Implementation** | **C++** | +| **Parallelism** | **sequential** | + +### Procedures + +### `join(strings, delimiter)` + +Joins all the strings into a single one with the given delimiter between them. +#### Input: + +- `strings: List[string]` ➡ list of strings to be joined +- `delimiter: string` ➡ string to be inserted between the given strings + +#### Output: + +- `string: string` ➡ the joined string + +#### Usage: + +```cypher +CALL text.join(["idora", " ", "ivan", "", "matija"], ",") YIELD string RETURN string; +``` + +```plaintext ++----------------------------+ +| string | ++----------------------------+ +| "idora, ,ivan,,matija" | ++----------------------------+ +``` \ No newline at end of file diff --git a/mage/templates/_mage_spells.mdx b/mage/templates/_mage_spells.mdx index 83634d4a33b..cbaa3f91d7d 100644 --- a/mage/templates/_mage_spells.mdx +++ b/mage/templates/_mage_spells.mdx @@ -19,6 +19,7 @@ | [node_similarity](/mage/query-modules/cpp/node-similarity) | C++ | A module that contains similarity measures for calculating the similarity between two nodes. | | [pagerank](/mage/query-modules/cpp/pagerank) | C++ | Algorithm that yields the influence measurement based on the recursive information about the connected nodes influence. | | [set_cover](/mage/query-modules/python/set-cover) | Python | An algorithm for finding the minimum cost subcollection of sets that covers all elements of a universe. | +| [text](/mage/query-modules/cpp/text) | C++ | A module for manipulating strings. | | [tsp](/mage/query-modules/python/tsp) | Python | An algorithm for finding the shortest possible route that visits each vertex exactly once. | | [union_find](/mage/query-modules/python/union-find) | Python | A module with an algorithm that enables the user to check whether the given nodes belong to the same connected component. | | [vrp](/mage/query-modules/python/vrp) | Python | Algorithm for finding the shortest route possible between the central depot and places to be visited. The algorithm can be solved with multiple vehicles that represent a visiting fleet. | diff --git a/sidebars/sidebarsMAGE.js b/sidebars/sidebarsMAGE.js index 3d940c7c061..d80dbecd8d5 100644 --- a/sidebars/sidebarsMAGE.js +++ b/sidebars/sidebarsMAGE.js @@ -62,6 +62,7 @@ module.exports = { "query-modules/cpp/periodic", "query-modules/python/set-cover", "query-modules/python/temporal-graph-networks", + "query-modules/cpp/text", "query-modules/python/tsp", "query-modules/python/union-find", "query-modules/cpp/uuid-generator", From 16f229307530e721f934f094ab9e9fae3f49cae9 Mon Sep 17 00:00:00 2001 From: Vlasta <95473291+vpavicic@users.noreply.github.com> Date: Thu, 17 Aug 2023 08:44:19 +0200 Subject: [PATCH 2/2] Update mage/query-modules/cpp/text.md --- mage/query-modules/cpp/text.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mage/query-modules/cpp/text.md b/mage/query-modules/cpp/text.md index 3c076d1d589..6eac44b1406 100644 --- a/mage/query-modules/cpp/text.md +++ b/mage/query-modules/cpp/text.md @@ -37,12 +37,12 @@ The `text` module offers a toolkit for manipulating strings. Joins all the strings into a single one with the given delimiter between them. #### Input: -- `strings: List[string]` ➡ list of strings to be joined -- `delimiter: string` ➡ string to be inserted between the given strings +- `strings: List[string]` ➡ list of strings to be joined. +- `delimiter: string` ➡ string to be inserted between the given strings. #### Output: -- `string: string` ➡ the joined string +- `string: string` ➡ the joined string. #### Usage: