Re: StringIndexOutOfBoundException while parsing msword

2006-12-02 Thread Rainer Schwarze
At 03:48 20.11.2006, TKDD wrote:
>hi,Rainer,
[...]
>by the way, what is fast-saved word files? thanks

Sorry for my late reply - I was strongly focused on the private part
of my life.

In Word one can switch between "fast saving" and the normal way (I
believe fast save is activated by default, but that may have changed
with the newer versions). If fast saving is off, Word creates a nice
structured file when the document is saved. If fast saving is on,
Word appends new data and changed data to the file (simply speaking).
So in fast saved files information is distributed all over the file
and the text and the formatting information is stored in "arbitrary"
order. The setting is in the "Save"(?)-tab in the options window of
Word (I don't know how it looks like after Word2000).

best wishes,
Rainer


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/



Re: StringIndexOutOfBoundException while parsing msword

2006-11-17 Thread Rainer Schwarze
Hi,

At 02:04 17.11.2006, TKDD wrote:
[...]
>but it comes StringIndexOutOfBoundException when the doc(only one page) 
>is written in Chinese characters.

Document with 2-byte characters (that's how Chinese characters are
probably stored) are not correctly handled by HWPF.
There are a lot of places in the code which need to be adjusted to
let that work well.

One more thing you need to consider: HWPF cannot handle "fast saved"
Word files. If the documents you need to parse are "fast saved" this
adds an extra level of complexity.

Which information from the Word files do you need to parse?

Best wishes,
Rainer


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/



StringIndexOutOfBoundException while parsing msword

2006-11-16 Thread TKDD

hi,list

i am using nutch-0.8.1 which use poi as its msword parsing solution.
it works well while dealing with English doc, even the doc file is 
pretty large.


but it comes StringIndexOutOfBoundException when the doc(only one page) 
is written in Chinese characters.


i try to isolate the problem, and find out that if i use 
HWPFDocument.getRange().text() to read a local Chinese file, it's ok. 
But in nutch's way, 
DocumentInputStream->CHPBinTable->ComplexFileTable->TextPieceTable...,finally 
it will meet StringIndexOutOfBoundException because the parameter in 
TextPiece.substring() is negative.


I am going to do some futher study on this but wonder if anyone else has 
had similar

experiences?

thanks


TKDD

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/