[
https://issues.apache.org/jira/browse/LUCENE-3690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13186127#comment-13186127
]
Steven Rowe commented on LUCENE-3690:
-------------------------------------
bq. some test docs that contain almost no HTML at all
I used the following to test the zero-markup case in both test classes (the
{{JFlexHTMLStripParser}} version is given below):
{code:java}
public void testRandomText() throws Exception {
StringBuilder text = new StringBuilder();
int minNumWords = 10;
int maxNumWords = 10000;
int minWordLength = 3;
int maxWordLength = 20;
int numWords = _TestUtil.nextInt(random, minNumWords, maxNumWords);
switch (_TestUtil.nextInt(random, 0, 4)) {
case 0: {
for (int wordNum = 0 ; wordNum < numWords ; ++wordNum) {
text.append(_TestUtil.randomUnicodeString(random, maxWordLength));
text.append(' ');
}
break;
}
case 1: {
for (int wordNum = 0 ; wordNum < numWords ; ++wordNum) {
text.append(_TestUtil.randomRealisticUnicodeString
(random, minWordLength, maxWordLength));
text.append(' ');
}
break;
}
default: { // ASCII 50% of the time
for (int wordNum = 0 ; wordNum < numWords ; ++wordNum) {
text.append(_TestUtil.randomSimpleString(random));
text.append(' ');
}
}
}
Reader reader = new JFlexHTMLStripCharFilter
(CharReader.get(new StringReader(text.toString())));
while (reader.read() != -1);
}
{code}
The results for 10K iterations (best/worst of 5):
* {{HTMLStripCharFilter}}: best: 23.7 sec, worst: 24.8 sec
* {{JFlexHTMLStripCharFilter}}: best: 22.0 sec, worst: 24.7 sec
> JFlex-based HTMLStripCharFilter replacement
> -------------------------------------------
>
> Key: LUCENE-3690
> URL: https://issues.apache.org/jira/browse/LUCENE-3690
> Project: Lucene - Java
> Issue Type: New Feature
> Components: modules/analysis
> Affects Versions: 3.5, 4.0
> Reporter: Steven Rowe
> Assignee: Steven Rowe
> Fix For: 3.6, 4.0
>
> Attachments: LUCENE-3690.patch, LUCENE-3690.patch, LUCENE-3690.patch
>
>
> A JFlex-based HTMLStripCharFilter replacement would be more performant and
> easier to understand and maintain.
--
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
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]