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

32 characters limit: 64bit? #21

Open
jbarth-ubhd opened this issue Feb 17, 2023 · 5 comments
Open

32 characters limit: 64bit? #21

jbarth-ubhd opened this issue Feb 17, 2023 · 5 comments

Comments

@jbarth-ubhd
Copy link

jbarth-ubhd commented Feb 17, 2023

Would it be possible to surpass the ~32 characters limit of agrep by using 64 bit unsigned long instead of unsigned?

Tried a bit with using unsigned long and doubling some agrep.h defines and replacing (unsigned)037777777777 to the 64 bit equivalent etc. But didn't work.

@Wikinaut
Copy link
Owner

As far as I know (since many years), this appears to be impossible, unfortunately!

@jbarth-ubhd
Copy link
Author

jbarth-ubhd commented Feb 17, 2023

Just tried it with the Fuzzy searching example code (substitutions only) here: https://en.wikipedia.org/wiki/Bitap_algorithm : 64 bit unsigned long works with 63 character long queries.

@Wikinaut
Copy link
Owner

Ah, sounds good. However please keep in mind, that agrep uses (offers to use) a circus of algorithms, so for this case it might be valid.

Looking forward to a(your) formal patch/pull request; please as a distinct feature branch, so that others can decide what to use - just in case.

Thanks for your message/issue.

@Wikinaut
Copy link
Owner

PS.
off-topic

Just found your perspective-correction scripts, I am also trying to find a working version of ShiftN.

See https://github.com/Wikinaut/shiftn and https://github.com/Wikinaut/Perspective-Transformation

@jbarth-ubhd
Copy link
Author

jbarth-ubhd commented Feb 17, 2023

quote from https://github.com/heyimalex/bitap : »Pattern size is limited to system word size (mem::size_of::() - 1), so you can't search for anything longer than 31/63 characters, depending on architecture.«

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants