Show / Hide Table of Contents

    Interface IScorer

    A IScorer is responsible for scoring a stream of tokens. These token scores can then be used to compute TextFragment scores.

    Namespace: Lucene.Net.Search.Highlight
    Assembly: Lucene.Net.Highlighter.dll
    Syntax
    public interface IScorer

    Properties

    | Improve this Doc View Source

    FragmentScore

    Called when the Highlighter has no more tokens for the current fragment - the IScorer returns the weighting it has derived for the most recent fragment, typically based on the results of GetTokenScore().

    Declaration
    float FragmentScore { get; }
    Property Value
    Type Description
    System.Single

    Methods

    | Improve this Doc View Source

    GetTokenScore()

    Called for each token in the current fragment. The Highlighter will increment the passed to init on every call.

    Declaration
    float GetTokenScore()
    Returns
    Type Description
    System.Single

    a score which is passed to the Highlighter class to influence the mark-up of the text (this return value is NOT used to score the fragment)

    | Improve this Doc View Source

    Init(TokenStream)

    Called to init the Scorer with a . You can grab references to the attributes you are interested in here and access them from GetTokenScore().

    Declaration
    TokenStream Init(TokenStream tokenStream)
    Parameters
    Type Name Description
    TokenStream tokenStream

    the that will be scored.

    Returns
    Type Description
    TokenStream

    either a that the Highlighter should continue using (eg if you read the tokenSream in this method) or null to continue using the same that was passed in.

    | Improve this Doc View Source

    StartFragment(TextFragment)

    Called when a new fragment is started for consideration.

    Declaration
    void StartFragment(TextFragment newFragment)
    Parameters
    Type Name Description
    TextFragment newFragment

    the fragment that will be scored next

    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)