Hi,

I am trying to read ThisDocument.Range.Sentences, to process all the
sentences in a document. But when the text contains a ".," that is a full
stop followed by a comma, as in the following situations - "ABC & Co.," Word
object model does not recognize the text properly. For example,

Thank you for contacting ABC &Co., and we hope that our association will be
mutually profitable and beneficial.

Now when I read the sentences, I find that "," and ", and we hope that our
association will be mutually profitable and beneficial." are returned as the
two sentences contained. I presume this is a bug with the Object model. Have
anybody else encountered a similar situation?? Can somebody help me out
here.

Note: I am using Word 2003.

Thanks in advance,

Thanks and Regards,
Laks

Re: Word Object model does not recognize ".," dot followed by comma by Jean-Guy

Jean-Guy
Tue May 10 09:55:15 CDT 2005

cameo007_2k@hotmail.com was telling us:
cameo007_2k@hotmail.com nous racontait que :

> Hi,
>
> I am trying to read ThisDocument.Range.Sentences, to process all the
> sentences in a document. But when the text contains a ".," that is a
> full stop followed by a comma, as in the following situations - "ABC
> & Co.," Word object model does not recognize the text properly. For
> example,
>
> Thank you for contacting ABC &Co., and we hope that our association
> will be mutually profitable and beneficial.
>
> Now when I read the sentences, I find that "," and ", and we hope
> that our association will be mutually profitable and beneficial." are
> returned as the two sentences contained. I presume this is a bug with
> the Object model. Have anybody else encountered a similar situation??
> Can somebody help me out here.
>
> Note: I am using Word 2003.
>

It is probably due to the fact that Word uses ". " to delimit sentences.

Have you tried doing a "Find/Replace all" ".," by a generic string, like §.
Do your stuff, and then "Find/Replace all" § by ".,"

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org




Re: Word Object model does not recognize ".," dot followed by comma by Jezebel

Jezebel
Tue May 10 17:07:28 CDT 2005

Hardly a bug in the object model. Bug in the algorithm for finding sentences
perhaps; but then sentences are not really well-defined in English either.
Do bullet points count as separate sentences? -- or constructions like this
one?





<cameo007_2k@hotmail.com> wrote in message
news:uY$ynPSVFHA.1796@TK2MSFTNGP15.phx.gbl...
> Hi,
>
> I am trying to read ThisDocument.Range.Sentences, to process all the
> sentences in a document. But when the text contains a ".," that is a full
> stop followed by a comma, as in the following situations - "ABC & Co.,"
> Word
> object model does not recognize the text properly. For example,
>
> Thank you for contacting ABC &Co., and we hope that our association will
> be
> mutually profitable and beneficial.
>
> Now when I read the sentences, I find that "," and ", and we hope that our
> association will be mutually profitable and beneficial." are returned as
> the
> two sentences contained. I presume this is a bug with the Object model.
> Have
> anybody else encountered a similar situation?? Can somebody help me out
> here.
>
> Note: I am using Word 2003.
>
> Thanks in advance,
>
> Thanks and Regards,
> Laks
>
>



Re: Word Object model does not recognize ".," dot followed by comma by cameo007_2k

cameo007_2k
Wed May 11 02:45:37 CDT 2005

Hi,

>> "." as delimiter

Word treats '.' followed by space as a delimiter for normal sentences. Apart
from these, a '? ', '! ' and paragraph break are also delimiters

>> Replacing ., by §

This sounds like a good idea. Will try it.

> Hardly a bug in the object model. Bug in the algorithm for finding
sentences
> perhaps; but then sentences are not really well-defined in English either.

Well well, I am using Word's Range.Sentences to get the sentences. This
surely is a bug in the algo, but the algo used by the object model
internally!!

>Do bullet points count as separate sentences? -- or constructions like this
>one?

Yes. They do. Both bullet points and sentences like the one given above are
recognized as sentences.

Thanks and Regards,
Laks


"Jezebel" <warcrimes@whitehouse.gov> wrote in message
news:eoTmoyaVFHA.3152@TK2MSFTNGP12.phx.gbl...
>
>
>
>
>
> <cameo007_2k@hotmail.com> wrote in message
> news:uY$ynPSVFHA.1796@TK2MSFTNGP15.phx.gbl...
> > Hi,
> >
> > I am trying to read ThisDocument.Range.Sentences, to process all the
> > sentences in a document. But when the text contains a ".," that is a
full
> > stop followed by a comma, as in the following situations - "ABC & Co.,"
> > Word
> > object model does not recognize the text properly. For example,
> >
> > Thank you for contacting ABC &Co., and we hope that our association will
> > be
> > mutually profitable and beneficial.
> >
> > Now when I read the sentences, I find that "," and ", and we hope that
our
> > association will be mutually profitable and beneficial." are returned as
> > the
> > two sentences contained. I presume this is a bug with the Object model.
> > Have
> > anybody else encountered a similar situation?? Can somebody help me out
> > here.
> >
> > Note: I am using Word 2003.
> >
> > Thanks in advance,
> >
> > Thanks and Regards,
> > Laks
> >
> >
>
>