x/text/search: Backwards
as an IndexOption not implemented
#59049
Labels
FeatureRequest
help wanted
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
x/text/search
has an explicit implementation todo panic if you attempt to search backwards in text. Presumably, this is to support RTL languages, but the utility isn't clear. It would be nice to implement it if it's useful, or at the very least document that it can't be used.For context, my use case involves query-driven scanning of string fields in streams of structured data for keywords in various languages, so I can see this being useful when combined with an appropriate language tag, though in my case it ends up being just a boolean match, so
start >= 0
is fine for now.As a side note, the package comments include the following todos:
I could see the last of these being useful to me in lieu of stemming or lemmatization, and the longstanding #16863 suggests that maybe
x/text/search
could use a little love. If @mpvl or anyone else would be willing to give me some guidance, I'd be willing to try and carve off some cycles to clear these out.What version of Go are you using (
go version
)?n/a
Does this issue reproduce with the latest release?
Yes, it is currently in the code here: https://github.com/golang/text/blob/master/search/search.go#L192-L193
What operating system and processor architecture are you using (
go env
)?n/a
What did you do?
attempted to use
Backwards
as anIndexOption
What did you expect to see?
Not a panic.
What did you see instead?
panic: TODO: implement
The text was updated successfully, but these errors were encountered: