Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add text_position #505

Open
wants to merge 2 commits into
base: draft
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased / Draft

### Added

- `text_position`

### Changed

- `clip`: Throw an exception if min > max [#472](https://github.com/Open-EO/openeo-processes/issues/472)
Expand Down
93 changes: 93 additions & 0 deletions proposals/text_find.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"id": "text_find",
"summary": "First position of a text in another text",
"description": "Checks where the text (also known as *string*) specified for `pattern` is positioned in the text specified for `data` for the first time. No-data values are passed through.",
"categories": [
"texts"
],
"experimental": true,
"parameters": [
{
"name": "data",
"description": "Text in which to find something in.",
"schema": {
"type": [
"string",
"null"
]
}
},
{
"name": "pattern",
"description": "Text to find in `data`. Regular expressions are not supported.",
"schema": {
"type": "string"
}
},
{
"name": "case_sensitive",
"description": "Case sensitive comparison can be disabled by setting this parameter to `false`.",
"schema": {
"type": "boolean"
},
"default": true,
"optional": true
}
],
"returns": {
"description": "A value >= 0 that indicates the position of the text, `null` if the text was not found.",
"schema": {
"type": [
"integer",
"null"
],
"minimum": 0
}
},
"examples": [
{
"arguments": {
"data": "Lorem ipsum dolor sit amet",
"pattern": "openEO"
},
"returns": null
},
{
"arguments": {
"data": "Lorem ipsum dolor sit amet",
"pattern": "ipsum dolor"
},
"returns": 6
},
{
"arguments": {
"data": "Lorem ipsum dolor sit amet",
"pattern": "Ipsum Dolor"
},
"returns": null
},
{
"arguments": {
"data": "Lorem ipsum dolor sit amet",
"pattern": "SIT",
"case_sensitive": false
},
"returns": 18
},
{
"arguments": {
"data": "ÄÖÜ",
"pattern": "ö",
"case_sensitive": false
},
"returns": 1
},
{
"arguments": {
"data": null,
"pattern": "null"
},
"returns": null
}
]
}
Loading