To summarize, I am working on parsing sentences of documents into single sentences. I need this for a bigger cause.
What I have is a table 'Position' which gives me the document id (ID) and the sentence number of a sentence in that document (NUM). I also have a column to display the sentence parsed (SENTENCE).
So an example table would be:
ID NUM SENTENCE
1 3 Hello
1 2 How are you
1 1 Fine
2 2 Thank you
2 1 You're Welcome
3 1 Nice Weather
What this means is that there were three sentences identified in document 1, two in document 2 and so on.
The problem is that (ID, NUM) = (1,3) or "Hello", refers to the third sentence in document 1, and (ID, NUM) = (1, 1) or "Fine", refers to the first sentence in document 1,and that's how the pattern continues for all other documents as well.
I'd like to reverse the order of NUM per ID, to give better clarity of the sentence order. This is also needed for feeding into other parts of my program.
Essentially, I'd like my output table to look like:
ID NUM SENTENCE
1 1 Hello
1 2 How are you
1 3 Fine
2 1 Thank you
2 2 You're Welcome
3 1 Nice Weather
I would greatly appreciate any assistance on how to perform this.
EDIT:
I would like to change the output to reflect the interchanging of sentence numbers in the output table. The order of the sentences would remain the same. This is so 'Hello' would be represented as sentence 1, as opposed to 3.
So hence, I would like only the 'NUM' variable interchanged within each 'ID' variable value in the output table.