Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class PartOfSpeechAttribute

    Attribute for GetPartOfSpeech().

    Inheritance
    object
    Attribute
    PartOfSpeechAttribute
    Implements
    IPartOfSpeechAttribute
    IAttribute
    Inherited Members
    Attribute.ReflectAsString(bool)
    Attribute.ToString()
    Attribute.Clone()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    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
    ReflectAsString(bool)

    SetToken(Token)

    Attribute for GetPartOfSpeech().

    Declaration
    public virtual void SetToken(Token token)
    Parameters
    Type Name Description
    Token token

    Implements

    IPartOfSpeechAttribute
    Lucene.Net.Util.IAttribute
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.