Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Boyer-Moore Search (https://www.delphipraxis.net/128015-boyer-moore-search.html)

mohfa 22. Jan 2009 19:10


Boyer-Moore Search
 
Hi , is there any version of Boyer-Moore search function that deals with the WildCards feature ?


Thank you all

3_of_8 22. Jan 2009 19:30

Re: Boyer-Moore Search
 
Well, I don't think so. What do you need it for? Are regular expressions not sufficient?

mohfa 22. Jan 2009 19:34

Re: Boyer-Moore Search
 
Thank you 3_of_8 ,
Zitat:

Are regular expressions not sufficient
No , but it doesn't do what i'm looking for , and i'm looking for a Fast pos function like the One used in the FastStrings ( But even FastStrings doesn't support the WildCard ).


Is there any other alternative ?

alzaimar 22. Jan 2009 19:39

Re: Boyer-Moore Search
 
BM is by definition not suitable for wildcards. It uses good and bad suffix tables which are based on exact characters. So the algorithm just won't fit.
You might try looking for a variation of the Knuth-Morris-Pratt algorithm which uses wildcard characters. The KMP uses a DEA which supports wildcards.

3_of_8 22. Jan 2009 19:42

Re: Boyer-Moore Search
 
What do you mean, doesn't do what you're looking for? If by wildcards you mean placeholders, why would regular expressions not be able to do that?

alzaimar 22. Jan 2009 20:33

Re: Boyer-Moore Search
 
@3_of_8:Regular Expressions 'might' be too slow, but I would suggest giving it a try. I would think that the TRegExpr-Implementation is not that bad. However, an optimized KMP* (or something similar) might be much faster, but to be honest, I am too lazy to find that out right now. There should be oodles of implementations out there.

RWarnecke 22. Jan 2009 21:58

Re: Boyer-Moore Search
 
Look at this Link

3_of_8 22. Jan 2009 22:05

Re: Boyer-Moore Search
 
Zitat:

Zitat von alzaimar
@3_of_8:Regular Expressions 'might' be too slow, but I would suggest giving it a try. I would think that the TRegExpr-Implementation is not that bad. However, an optimized KMP* (or something similar) might be much faster, but to be honest, I am too lazy to find that out right now. There should be oodles of implementations out there.

Aye, but he said regular expressions "don't do what he wants", he did not say they were just not doing it fast enough. And I think that if I don't have a completely different concept of wildcards, regular expressions should be more that enough to do what he wants to do. The speed, well, as you said, it's best to just try it out.


Alle Zeitangaben in WEZ +1. Es ist jetzt 01:22 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz