Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class SynonymMap.Builder

    Builds an FSTSynonymMap.

    Call Add(CharsRef, CharsRef, bool) until you have added all the mappings, then call Build() to get an FSTSynonymMap

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Inheritance
    object
    SynonymMap.Builder
    SynonymMap.Parser
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Analysis.Synonym
    Assembly: Lucene.Net.Analysis.Common.dll
    Syntax
    public class SynonymMap.Builder

    Constructors

    Builder(bool)

    If dedup is true then identical rules (same input, same output) will be added only once.

    Declaration
    public Builder(bool dedup)
    Parameters
    Type Name Description
    bool dedup

    Methods

    Add(CharsRef, CharsRef, bool)

    Add a phrase->phrase synonym mapping. Phrases are character sequences where words are separated with character zero (U+0000). Empty words (two U+0000s in a row) are not allowed in the input nor the output!

    Declaration
    public virtual void Add(CharsRef input, CharsRef output, bool includeOrig)
    Parameters
    Type Name Description
    CharsRef input

    input phrase

    CharsRef output

    output phrase

    bool includeOrig

    true if the original should be included

    Build()

    Builds an SynonymMap and returns it.

    Declaration
    public virtual SynonymMap Build()
    Returns
    Type Description
    SynonymMap

    Join(string[], CharsRef)

    Sugar: just joins the provided terms with WORD_SEPARATOR. reuse and its chars must not be null.

    Declaration
    public static CharsRef Join(string[] words, CharsRef reuse)
    Parameters
    Type Name Description
    string[] words
    CharsRef reuse
    Returns
    Type Description
    CharsRef
    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.