Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

[master < MAGE-text] Add MAGE text query module docs #997

Merged
merged 2 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
59 changes: 59 additions & 0 deletions mage/query-modules/cpp/text.md
Original file line number Diff line number Diff line change
@@ -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}) => (
<span
style={{
backgroundColor: color,
borderRadius: '2px',
color: '#fff',
padding: '0.2rem',
}}>
{children}
</span>
);

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** | <Highlight color="#FB6E00">**algorithm**</Highlight> |
| **Implementation** | <Highlight color="#FB6E00">**C++**</Highlight> |
| **Parallelism** | <Highlight color="#FB6E00">**sequential**</Highlight> |

### 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
vpavicic marked this conversation as resolved.
Show resolved Hide resolved

#### Usage:

```cypher
CALL text.join(["idora", " ", "ivan", "", "matija"], ",") YIELD string RETURN string;
```

```plaintext
+----------------------------+
| string |
+----------------------------+
| "idora, ,ivan,,matija" |
+----------------------------+
```
1 change: 1 addition & 0 deletions mage/templates/_mage_spells.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
1 change: 1 addition & 0 deletions sidebars/sidebarsMAGE.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down