Open-EO / openeo-processes

Interoperable processes for openEO's big Earth observation cloud processing.
https://processes.openeo.org
Apache License 2.0
49 stars 14 forks source link

Add text_position #505

Open m-mohr opened 1 month ago

soxofaan commented 1 month ago

This process is pretty similar to array_find, so it might be good to align with that one:

m-mohr commented 1 month ago

Good point.

text_find instead of test_position

Sounds good. +1

array_find returns null when not found instead of -1

I don't have strong preferences here. +0

rename pattern arg to value too?

pattern is coming from text_contains, textbegins, ... I think having it consistent in text* is more important than having it consistent with array_find. -1

Edit: Updated the PR accordingly.

soxofaan commented 1 month ago

pattern is coming from text_contains, text_begins, ...

good point

Another thing that is worth mentioning is that the returned position is a zero-based index (as mentioned in array_find)

m-mohr commented 1 month ago

Isn't that captured by the description of the return value?

A value >= 0 that indicates the position of the text

If not, happy to accept proposals how to improve.

soxofaan commented 1 month ago

I just mentioned it because I noticed it's the first statement in the description of array_find

Returns the zero-based index of ...

while it's not explicitly mentioned in current PR of text_find