Class PartOfSpeechAttribute
Attribute for GetPartOfSpeech().
Inherited Members
Attribute.ToString()
Attribute.Clone()
Namespace: Lucene.Net.Analysis.Ja.TokenAttributes
Assembly: Lucene.Net.Analysis.Kuromoji.dll
Syntax
public class PartOfSpeechAttribute : Attribute, IPartOfSpeechAttribute, IAttribute
Methods
Clear()
Clears the values in this Lucene.Net.Util.Attribute and resets it to its default value. If this implementation implements more than one Lucene.Net.Util.Attribute interface it clears all.
Declaration
public override void Clear()
Overrides
Lucene.Net.Util.Attribute.Clear()
CopyTo(IAttribute)
Copies the values from this Lucene.Net.Util.Attribute into the passed-in
target
attribute. The target
implementation must support all the
Lucene.Net.Util.IAttributes this implementation supports.
Declaration
public override void CopyTo(IAttribute target)
Parameters
Type | Name | Description |
---|---|---|
IAttribute | target |
Overrides
Lucene.Net.Util.Attribute.CopyTo(Lucene.Net.Util.IAttribute)
GetPartOfSpeech()
Attribute for GetPartOfSpeech().
Declaration
public virtual string GetPartOfSpeech()
Returns
Type | Description |
---|---|
string |
ReflectWith(IAttributeReflector)
This method is for introspection of attributes, it should simply add the key/values this attribute holds to the given Lucene.Net.Util.IAttributeReflector.
The default implementation calls Reflect(Type, string, object) for all non-static fields from the implementing class, using the field name as key and the field value as value. The Lucene.Net.Util.IAttribute class is also determined by Reflection. Please note that the default implementation can only handle single-Attribute implementations. Custom implementations look like this (e.g. for a combined attribute implementation):public void ReflectWith(IAttributeReflector reflector)
{
reflector.Reflect(typeof(ICharTermAttribute), "term", GetTerm());
reflector.Reflect(typeof(IPositionIncrementAttribute), "positionIncrement", GetPositionIncrement());
}
If you implement this method, make sure that for each invocation, the same set of Lucene.Net.Util.IAttribute
interfaces and keys are passed to Reflect(Type, string, object) in the same order, but possibly
different values. So don't automatically exclude e.g. null
properties!
Declaration
public override void ReflectWith(IAttributeReflector reflector)
Parameters
Type | Name | Description |
---|---|---|
IAttributeReflector | reflector |
Overrides
Lucene.Net.Util.Attribute.ReflectWith(Lucene.Net.Util.IAttributeReflector)
See Also
SetToken(Token)
Attribute for GetPartOfSpeech().
Declaration
public virtual void SetToken(Token token)
Parameters
Type | Name | Description |
---|---|---|
Token | token |
Implements
Lucene.Net.Util.IAttribute