|
Boost : |
Subject: Re: [boost] [gsoc 2013] Approximate string matching
From: Michael Marcin (mike.marcin_at_[hidden])
Date: 2013-04-17 14:00:53
On 4/17/2013 12:40 PM, Jan Strnad wrote:
>
> Finally, I would implement functions
> template <typename TRange>
> find_iterator<TRange> approximate_find
> (TRange text, TRange pattern, approximate_distance<TRange>& distance);
>
> template <typename TRange>
> find_iterator<std::size_t> approximate_find_index
> (TRange text, TRange pattern, approximate_distance<TRange>& distance);
>
> These would return all approximate matches of pattern int text. The
> first one return the approximate string itself, the later one returns
> its index.
>
These functions are for finding substrings in the text?
This seems to me like how the regex_search interface works. Is it
possible to make the interface similar?
Something like
string pattern = "acbdef";
string text = "aacdefbcdefabccef";
boost::amatch m;
boost::approx e( hamming_distance, pattern, 1 );
while( boost::approx_search( text, m, e )
{
cout << m.str() << endl;
text = m.suffix().str();
}
// prints aacdef, fbcdef abccef
Although I could be seeing similarities where they don't exist.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk