Interface ICharTermAttribute
The term text of a Token.
Inherited Members
Namespace: Lucene.Net.Analysis.TokenAttributes
Assembly: Lucene.Net.dll
Syntax
public interface ICharTermAttribute : IAttribute, ICharSequence
Properties
| Improve this Doc View SourceBuffer
Returns the internal termBuffer character array which
you can then directly alter. If the array is too
small for your token, use Resize
NOTE: The returned buffer may be larger than the valid Length.
Declaration
char[] Buffer { get; }
Property Value
Type | Description |
---|---|
System. |
Item[Int32]
Declaration
char this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System. |
index |
Property Value
Type | Description |
---|---|
System. |
Length
Gets or Sets the number of valid characters (in
the termBuffer array.
Set
Declaration
int Length { get; set; }
Property Value
Type | Description |
---|---|
System. |
Methods
| Improve this Doc View SourceAppend(ICharTermAttribute)
Appends the contents of the other IChar
The characters of the ICharnull
, then the four
characters "null"
are appended.
Declaration
ICharTermAttribute Append(ICharTermAttribute termAtt)
Parameters
Type | Name | Description |
---|---|---|
IChar |
termAtt |
Returns
Type | Description |
---|---|
IChar |
Append(ICharSequence)
Appends the contents of the IChar
The characters of the ICharnull
, then the four
characters "null"
are appended.
Declaration
ICharTermAttribute Append(ICharSequence csq)
Parameters
Type | Name | Description |
---|---|---|
IChar |
csq |
Returns
Type | Description |
---|---|
IChar |
Append(ICharSequence, Int32, Int32)
Appends the contents of the IChar
The characters of the ICharnull
, then the four
characters "null"
are appended.
Declaration
ICharTermAttribute Append(ICharSequence csq, int start, int end)
Parameters
Type | Name | Description |
---|---|---|
IChar |
csq | The index of the first character in the subsequence. |
System. |
start | The start index of the IChar |
System. |
end | The index of the character following the last character in the subsequence. |
Returns
Type | Description |
---|---|
IChar |
Append(StringBuilder)
Appends the specified
The characters of the null
, then the four
characters "null"
are appended.
Declaration
ICharTermAttribute Append(StringBuilder sb)
Parameters
Type | Name | Description |
---|---|---|
String |
sb |
Returns
Type | Description |
---|---|
IChar |
Append(StringBuilder, Int32, Int32)
Appends the specified
The characters of the null
, then the four
characters "null"
are appended.
Declaration
ICharTermAttribute Append(StringBuilder s, int start, int end)
Parameters
Type | Name | Description |
---|---|---|
String |
s | |
System. |
start | |
System. |
end |
Returns
Type | Description |
---|---|
IChar |
Remarks
LUCENENET specific method, added because the .NET
Append(Char)
Appends the supplied
Declaration
ICharTermAttribute Append(char c)
Parameters
Type | Name | Description |
---|---|---|
System. |
c | The |
Returns
Type | Description |
---|---|
IChar |
Append(Char[])
Appends the contents of the char[] array to this character sequence.
The characters of the char[] argument are appended, in order, increasing the length of
this sequence by the length of the argument. If argument is null
, then the four
characters "null"
are appended.
Declaration
ICharTermAttribute Append(char[] csq)
Parameters
Type | Name | Description |
---|---|---|
System. |
csq | The char[] array to append. |
Returns
Type | Description |
---|---|
IChar |
Remarks
LUCENENET specific method, added to simulate using the CharBuffer class in Java.
Append(Char[], Int32, Int32)
Appends the contents of the char[] array to this character sequence, beginning and ending at the specified indices.
The characters of the char[] argument are appended, in order, increasing the length of
this sequence by the length of the argument. If argument is null
, then the four
characters "null"
are appended.
Declaration
ICharTermAttribute Append(char[] csq, int start, int end)
Parameters
Type | Name | Description |
---|---|---|
System. |
csq | The char[] array to append. |
System. |
start | The start index of the char[] to begin copying characters. |
System. |
end | The index of the character following the last character in the subsequence. |
Returns
Type | Description |
---|---|
IChar |
Remarks
LUCENENET specific method, added to simulate using the CharBuffer class in Java. Note that
the Copy
Append(String)
Appends the specified
The characters of the null
, then the four
characters "null"
are appended.
Declaration
ICharTermAttribute Append(string s)
Parameters
Type | Name | Description |
---|---|---|
System. |
s |
Returns
Type | Description |
---|---|
IChar |
Remarks
LUCENENET specific method, added because the .NET
Append(String, Int32, Int32)
Appends the contents of the
The characters of the null
, then the four
characters "null"
are appended.
Declaration
ICharTermAttribute Append(string csq, int start, int end)
Parameters
Type | Name | Description |
---|---|---|
System. |
csq | The index of the first character in the subsequence. |
System. |
start | The start index of the |
System. |
end | The index of the character following the last character in the subsequence. |
Returns
Type | Description |
---|---|
IChar |
Remarks
LUCENENET specific method, added because the .NET
CopyBuffer(Char[], Int32, Int32)
Copies the contents of buffer, starting at offset for length characters, into the termBuffer array.
Declaration
void CopyBuffer(char[] buffer, int offset, int length)
Parameters
Type | Name | Description |
---|---|---|
System. |
buffer | the buffer to copy |
System. |
offset | the index in the buffer of the first character to copy |
System. |
length | the number of characters to copy |
ResizeBuffer(Int32)
Grows the termBuffer to at least size newSize
, preserving the
existing content.
Declaration
char[] ResizeBuffer(int newSize)
Parameters
Type | Name | Description |
---|---|---|
System. |
newSize | minimum size of the new termBuffer |
Returns
Type | Description |
---|---|
System. |
newly created termBuffer with length >= newSize |
SetEmpty()
Sets the length of the termBuffer to zero. Use this method before appending contents.
Declaration
ICharTermAttribute SetEmpty()
Returns
Type | Description |
---|---|
IChar |
SetLength(Int32)
Set number of valid characters (length of the term) in
the termBuffer array. Use this to truncate the termBuffer
or to synchronize with external manipulation of the termBuffer.
Note: to grow the size of the array,
use Resize
obj.SetLength(30).Append("hey you");
Declaration
ICharTermAttribute SetLength(int length)
Parameters
Type | Name | Description |
---|---|---|
System. |
length | the truncated length |
Returns
Type | Description |
---|---|
IChar |