473,473 Members | 1,692 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

algorithm to highlight required words in a paragraph

hi,

i have a paragraph where i have to insert <markand </marktags 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..

Sep 16 '07 #1
3 2327
gomsi wrote:
hi,

i have a paragraph where i have to insert <markand </marktags 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.
js*******@attglobal.net
==================
Sep 16 '07 #2
On Sep 16, 5:26 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
gomsi wrote:
hi,
i have a paragraph where i have to insert <markand </marktags 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

Sep 17 '07 #3
gomsi wrote:
On Sep 16, 5:26 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
>gomsi wrote:
>>hi,
i have a paragraph where i have to insert <markand </marktags 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.
js*******@attglobal.net
==================
Sep 17 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jack Smith | last post by:
Hello, any help appreciated with following problem. I figured out the algorithm (I think), just having trouble proving it is optimal. Suppose we are given n tasks each of which takes 1 unit...
13
by: David Morgan | last post by:
Hello I have a little function to highlight text if it exists. Function Highlight(vFind, vSearch) Dim RegEx Set RegEx = New RegExp RegEx.Pattern = vFind RegEx.IgnoreCase = True Highlight =...
2
by: KP | last post by:
I want to automatically highlight parts of a webpage (make them standout from the rest of the contents). These parts could be as small as single image tags, and as large as complex tables, parts of...
3
by: gdogg1587 | last post by:
Greetings. I'm working on a program that will "descramble" words. Think of a word scramble game where there is a list of characters, and several blank spaces to denote the word(s) that you are...
113
by: Bonj | last post by:
I was in need of an encryption algorithm to the following requirements: 1) Must be capable of encrypting strings to a byte array, and decyrpting back again to the same string 2) Must have the same...
2
by: Dan Schumm | last post by:
I'm relatively new to regular expressions and was looking for some help on a problem that I need to solve. Basically, given an HTML string, I need to highlight certain words within the text of the...
3
by: Nicky | last post by:
hi, all I have an iframe in my page. Actually what I want is just like the google search. When user clicks search, I will load the a page from another URL into iframe and then highlight the key...
5
by: Atara | last post by:
I am trying to convert the following code to VB .Net, I still have some gaps (the lines that are marked with (*)) and also I need an ending condition for the while loop. any help would be...
6
by: pj | last post by:
Hi, I 'm currently writing a program that performs transliteration (i.e., converts greek text written using the english alphabet to "pure" greek text using the greek alphabet) as part of my...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.