You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@opennlp.apache.org by "Joern Kottmann (JIRA)" <ji...@apache.org> on 2012/08/03 12:33:03 UTC
[jira] [Closed] (OPENNLP-489) endMarker never checked when parsing
wikinews page
[ https://issues.apache.org/jira/browse/OPENNLP-489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Joern Kottmann closed OPENNLP-489.
----------------------------------
> endMarker never checked when parsing wikinews page
> --------------------------------------------------
>
> Key: OPENNLP-489
> URL: https://issues.apache.org/jira/browse/OPENNLP-489
> Project: OpenNLP
> Issue Type: Bug
> Components: Wikinews Importer
> Reporter: Prokopis Prokopidis
> Assignee: Joern Kottmann
> Priority: Minor
> Attachments: OPENNLP-489.patch
>
>
> Hi,
> I am testing the Wikinews Importer, thanks for making it available.
> I think that in the following code of WikinewsConverter.java
> int cutIndex = -1;
> for (String endMarker : endOfArtilceMarkers) {
> int endMarkerIndex = pageText.indexOf(endMarker);
> if (endMarkerIndex != -1) {
> cutIndex = endMarkerIndex;
> break;
> }
> }
>
> if (cutIndex == -1)
> cutIndex = pageText.length();
> if an endMarker1 has already been detected, another endMarker2 from the endOfArtilceMarkers list will not be checked, even if it appears before endMarker1 in the wiki text. Perhaps this check can be rewritten like
> int cutIndex = pageText.length();
> for (String endMarker : endOfArtilceMarkers) {
> int endMarkerIndex = pageText.indexOf(endMarker);
> if (endMarkerIndex != -1 && endMarkerIndex < cutIndex) {
> cutIndex = endMarkerIndex;
> }
> }
> if (cutIndex < pageText.length()) {
> pageText = pageText.substring(0, cutIndex);
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira