Class HTMLStripCharFilter
A Lucene.Net.Analysis.CharFilter that wraps another TextReader and attempts to strip out HTML constructs.
Implements
Inherited Members
Namespace: Lucene.Net.Analysis.CharFilters
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
public sealed class HTMLStripCharFilter : BaseCharFilter, IDisposable
Constructors
HTMLStripCharFilter(TextReader)
Creates a new HTMLStripCharFilter over the provided TextReader.
Declaration
public HTMLStripCharFilter(TextReader source)
Parameters
Type | Name | Description |
---|---|---|
TextReader | source | TextReader to strip html tags from. |
HTMLStripCharFilter(TextReader, ICollection<string>)
Creates a new HTMLStripCharFilter over the provided TextReader with the specified start and end tags.
Declaration
public HTMLStripCharFilter(TextReader source, ICollection<string> escapedTags)
Parameters
Type | Name | Description |
---|---|---|
TextReader | source | TextReader to strip html tags from. |
ICollection<string> | escapedTags | Tags in this set (both start and end tags) will not be filtered out. |
Methods
Dispose(bool)
Closes the underlying input stream.
NOTE: The default implementation closes the input TextReader, so be sure to callbase.Dispose(disposing)
when overriding this method.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing |
Overrides
Read()
Reads the next character from the text reader and advances the character position by one character.
Declaration
public override int Read()
Returns
Type | Description |
---|---|
int | The next character from the text reader, or -1 if no more characters are available. The default implementation returns -1. |
Overrides
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The TextReader is closed. |
IOException | An I/O error occurs. |
Read(char[], int, int)
Reads a specified maximum number of characters from the current reader and writes the data to a buffer, beginning at the specified index.
Declaration
public override int Read(char[] cbuf, int off, int len)
Parameters
Type | Name | Description |
---|---|---|
char[] | cbuf | |
int | off | |
int | len |
Returns
Type | Description |
---|---|
int | The number of characters that have been read. The number will be less than or equal to |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentException | The buffer length minus |
ArgumentOutOfRangeException |
|
ObjectDisposedException | The TextReader is closed. |
IOException | An I/O error occurs. |