algorithm to highlight required words in a paragraph

algorithm to highlight required words in a paragraph

am 16.09.2007 14:24:14 von gomsi

hi,

i have a paragraph where i have to insert and tags to
highlight the required words.i am implementing it in c++ i am
currently doing it as follows..

i take the corresponding position at which the word occurs within the
paragraph and the word length and store it in a map(STL)..and start
inserting the tags after i scan the paragraph for the words....
although it works fine for larger words problem occurs when the word
to be marked are like "bidder dd d"..the tags start overlapping and
become mixed up within the paragraph.. can someone provide a good
algorithm and help please... asap..

Re: algorithm to highlight required words in a paragraph

am 16.09.2007 14:26:03 von Jerry Stuckle

gomsi wrote:
> hi,
>
> i have a paragraph where i have to insert and tags to
> highlight the required words.i am implementing it in c++ i am
> currently doing it as follows..
>
> i take the corresponding position at which the word occurs within the
> paragraph and the word length and store it in a map(STL)..and start
> inserting the tags after i scan the paragraph for the words....
> although it works fine for larger words problem occurs when the word
> to be marked are like "bidder dd d"..the tags start overlapping and
> become mixed up within the paragraph.. can someone provide a good
> algorithm and help please... asap..
>

If you're doing this in C++, why are you asking in a PHP newsgroup?

Try a C++ newsgroup.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: algorithm to highlight required words in a paragraph

am 17.09.2007 06:33:27 von gomsi

On Sep 16, 5:26 am, Jerry Stuckle wrote:
> gomsi wrote:
> > hi,
>
> > i have a paragraph where i have to insert and tags to
> > highlight the required words.i am implementing it in c++ i am
> > currently doing it as follows..
>
> > i take the corresponding position at which the word occurs within the
> > paragraph and the word length and store it in a map(STL)..and start
> > inserting the tags after i scan the paragraph for the words....
> > although it works fine for larger words problem occurs when the word
> > to be marked are like "bidder dd d"..the tags start overlapping and
> > become mixed up within the paragraph.. can someone provide a good
> > algorithm and help please... asap..
>
> If you're doing this in C++, why are you asking in a PHP newsgroup?
>
> Try a C++ newsgroup.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================

sorry. but all that i need is an algorithm not the exact implementation

Re: algorithm to highlight required words in a paragraph

am 17.09.2007 13:46:26 von Jerry Stuckle

gomsi wrote:
> On Sep 16, 5:26 am, Jerry Stuckle wrote:
>> gomsi wrote:
>>> hi,
>>> i have a paragraph where i have to insert and tags to
>>> highlight the required words.i am implementing it in c++ i am
>>> currently doing it as follows..
>>> i take the corresponding position at which the word occurs within the
>>> paragraph and the word length and store it in a map(STL)..and start
>>> inserting the tags after i scan the paragraph for the words....
>>> although it works fine for larger words problem occurs when the word
>>> to be marked are like "bidder dd d"..the tags start overlapping and
>>> become mixed up within the paragraph.. can someone provide a good
>>> algorithm and help please... asap..
>> If you're doing this in C++, why are you asking in a PHP newsgroup?
>>
>> Try a C++ newsgroup.
>>
>> --
>> ==================
>> Remove the "x" from my email address
>> Jerry Stuckle
>> JDS Computer Training Corp.
>> jstuck...@attglobal.net
>> ==================
>
> sorry. but all that i need is an algorithm not the exact implementation
>

Try a C++ newsgroup. C++ has different features, and the algorithm may
be different.

This group is for asking about how to code in PHP - not trying to find
an algorithm for C++.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================