String processing algorithms

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

String processing algorithms

Aggelidis Nikos
hi to all,i am interested in implementing some string processing
algorithms{eg boyer-moore , knuth morris prat} for educational purposes.


This is the first "real" exposure i will have with boost. I've done a
bit of searching and i think Xpressive is the corresponding library
of boost, for string processing. From what i read Xpressive is a
header-only template library, so i will have to study xpressive.hpp .

Any other directions i should follow?

thanks in advance for your trouble,

nicolas
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: String processing algorithms

OvermindDL1
On Sat, Mar 28, 2009 at 11:08 AM, Aggelidis Nikos
<[hidden email]> wrote:

> hi to all,i am interested in implementing some string processing
> algorithms{eg boyer-moore , knuth morris prat} for educational purposes.
>
>
> This is the first "real" exposure i will have with boost. I've done a
> bit of searching and i think Xpressive is the corresponding library
> of boost, for string processing. From what i read Xpressive is a
> header-only template library, so i will have to study xpressive.hpp .
>
> Any other directions i should follow?
>
> thanks in advance for your trouble,


If you are wanting to do string searching and matching and all such,
yep, boost.xpressive is designed for that.  If you are interesting in
PEG grammars, can do the same stuff as xpressive, but xpressive is a
regex style, Spirit2(x) can do the same stuff, but of a PEG syntax.  A
PEG syntax has no ambiguities and is capable of recursively calling
itself (that is the one main thing that regex style grammars cannot
do).  Boost.Xpressive will be perfect if you are more comfortable with
regex, but Boost.Spirit2(x) is more powerful for compile time language
constructs.  If you are interested in Boost.Spirit2(x), feel free to
join the mailing list, lot of helpful people there too.

However, both Xpressive and Spirit2(x) already do string searches as
part of their very language, from what you said (the boyer-moore
method and so forth), it sounds like just doing a standalone thing
might work best.  If you were to implement it as a C++ grammar, then
Spirit2x might fit better (you can get a link to the ltaest in the
Spirit mailing list) as it can do matching styles exactly that of what
you stated.  Still though, might be better to do it manually since
those are more low-level ways...
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: String processing algorithms

Eric Niebler
In reply to this post by Aggelidis Nikos
Aggelidis Nikos wrote:
> hi to all,i am interested in implementing some string processing
> algorithms{eg boyer-moore , knuth morris prat} for educational purposes.

This is a worthwhile endeavor, IMO.

> This is the first "real" exposure i will have with boost. I've done a
> bit of searching and i think Xpressive is the corresponding library
> of boost, for string processing.

There are lots of libraries in boost for string processing. There are:

Boost.Regex
Boost.Xpressive
Boost.Spirit
Boost.String_algo
Boost.Lexical_cast
Boost.IOStream
Boost.Tokenizer

... and more.

> From what i read Xpressive is a
> header-only template library, so i will have to study xpressive.hpp .

Xpressive is probably not the best place to start. It's too big. My
suggestion: sit down with a copy of Knuth and try to implement generic
algorithms by emulating the style of the std algorithms and
Boost.String_algo.

HTH,

--
Eric Niebler
BoostPro Computing
http://www.boostpro.com
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: String processing algorithms

Michael Olea

On Mar 29, 2009, at 9:08 PM, Eric Niebler wrote:

> Aggelidis Nikos wrote:
>> hi to all,i am interested in implementing some string processing
>> algorithms{eg boyer-moore , knuth morris prat} for educational  
>> purposes.
>
> This is a worthwhile endeavor, IMO.
>
>> This is the first "real" exposure i will have with boost. I've done a
>> bit of searching and i think Xpressive is the corresponding library
>> of boost, for string processing.
>
> There are lots of libraries in boost for string processing. There are:
>
> Boost.Regex
> Boost.Xpressive
> Boost.Spirit
> Boost.String_algo
> Boost.Lexical_cast
> Boost.IOStream
> Boost.Tokenizer
>
> ... and more.
>
>> From what i read Xpressive is a
>> header-only template library, so i will have to study xpressive.hpp .
>
> Xpressive is probably not the best place to start. It's too big. My  
> suggestion: sit down with a copy of Knuth and try to implement  
> generic algorithms by emulating the style of the std algorithms and  
> Boost.String_algo.

http://www.amazon.com/Algorithms-Strings-Trees-Sequences- 
Computational/dp/0521585198/ref=sr_1_6?
ie=UTF8&s=books&qid=1238390781&sr=1-6

>
> HTH,
>
> --
> Eric Niebler
> BoostPro Computing
> http://www.boostpro.com
> _______________________________________________
> Boost-users mailing list
> [hidden email]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users

_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users