0

I have texts (Paragraphs) and I want to replace each of annotated wrong word in the paragraph with the correct word indicated by the position (index) number of the wrong word and i need to do it for each paragraph... So, what method should I use to search by index number? thank you

Example:

In the input file you have the following paragraph:

Computer Science are the study of principles applications, and technologies of computing & computers. It involve the studyof data and data structures...

The above text should be replaced by the following paragraph in the output file:

Computer Science is the study of principles, applications, and technologies of computing and computers. It involves the study of data and data structures...

**Note that the numbers (e.g:2 3) indicate the position (index) of the wrong word

A 2 3|||Edit||| is |||REQUIRED|||-NONE-|||0

A 12 13|||Edit||| and |||REQUIRED|||-NONE-|||0

A 15 16|||Edit||| involves |||REQUIRED|||-NONE-|||0

A 18 19|||Split|||study of|||REQUIRED|||-NONE-|||0

A 29 29|||Add_before|||.|||REQUIRED|||-NONE-|||0

2
Contributors
2
Replies
24
Views
2 Years
Discussion Span
Last Post by JamesCherrill
1

If you split the para by white space you will get an array of al the words, so each word will have its own array index (ignoring puncuation for the moment!).

You may have problems with the subsequent index numbers changing when you split add or remove words

Votes + Comments
ok thanks for explaining, can you tell me how do i search by index? what's the syntax?
-1

After using String's split method (read the API doc) you have an ordinary array of Strings, which you can search with a for loop just like any other array

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.