zhujiangang / wikixmlj

Automatically exported from code.google.com/p/wikixmlj
0 stars 0 forks source link

StringIndexOutOfBoundsException in parseInfoBox in class WikiTextParser #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Once in a while, WikiTextParser (line 132) throws an exception. I assume this 
is whenever the InfoBox isn't properly closed, so I guess it's not actually a 
problem of WikiTextParser, but it could be handled more gracefully, e.g. by 
testing that (endPos+1 < wikiText.length()).

Stacktrace:

java.lang.StringIndexOutOfBoundsException: String index out of range: 4877
        at java.lang.String.substring(String.java:1934)
        at edu.jhu.nlp.wikipedia.WikiTextParser.parseInfoBox(WikiTextParser.java:132)
        at edu.jhu.nlp.wikipedia.WikiTextParser.getInfoBox(WikiTextParser.java:110)
        at edu.jhu.nlp.wikipedia.WikiPage.getInfoBox(WikiPage.java:136)

Original issue reported on code.google.com by paal.dra...@gmail.com on 30 Jun 2010 at 9:08

GoogleCodeExporter commented 9 years ago
Sorry about this delay. I have not been able to replicate this. Can you point 
me to some small example where this happens?

Original comment by delip...@gmail.com on 12 Nov 2010 at 1:41

GoogleCodeExporter commented 9 years ago
This is now fixed in r44.

Original comment by delip...@gmail.com on 26 Nov 2010 at 5:53