1. How2: get count of sentence in mle from word selected in sentence there
- Posted by DanM Apr 29, 2009
- 838 views
Hope I can explain this well enough to make sense...
I have some source text, which I've parsed for individual sentences, and saved those sentences to individual places in a sequence, with the word count for each sentence attached to each sentences place in the var.
ie, {{"This is sentence one.", 4}, {"And this is the second sentence.", 6}}I then cause the sentences to be put into a mle, with, if useful, the number of the sentence displayed preceding it in the mle.
ie, 1*This is sentence one. 2*And this is the second sentence.I want to allow user to select a word in any sentence in the mle, and cause by a button click that the selected word be replaced with a tagged phrase which would contain more than one word.
I then want to insert the new, edited sentence containing the tagged phrase back into the sequence containing the sentences, deliberately retaining the original word count for each sentence.
ie, {"This is <tagged phrase> sentence one.", 4}
How do I make my program know which sentence it is that has had a word selected & replaced, so I can put that edited sentence back into the correct place in the sentences sequence, from whence it came?
btw, the "sentence count" (1*, 2*) preceding each sentence in the mle is not otherwise necessary for my app, just thought it might help in id-ing which sentence, since sentences some may span more than one line in the mle.
Dan
2. Re: How2: get count of sentence in mle from word selected in sentence there
- Posted by DanM Apr 29, 2009
- 818 views
Well, I'm thinking it can't be done the way I asked.
Looks like I'll have to do it by eliminating my "pre-processing" of parsing the original text, and instead let the user tag various words as they wish first, and then parse the result into sentences, handling the tags as needed in order to get an appropriate word count ignoring the added tag phrases.
I guess it's only a little bit harder than what I was intending to do.
Dan