• API

    Show / Hide Table of Contents

    Namespace Lucene.Net.Util.Fst

    Misc FST classes.

    Classes

    ListOfOutputs<T>

    Wraps another Outputs implementation and encodes one or more of its output values. You can use this when a single input may need to map to more than one output, maintaining order: pass the same input with a different output by calling Add(Int32sRef, T) multiple times. The builder will then combine the outputs using the Lucene.Net.Util.Fst.Outputs<T>.Merge(T, T) method.

    The resulting FST may not be minimal when an input has more than one output, as this requires pushing all multi-output values to a final state.

    NOTE: the only way to create multiple outputs is to add the same input to the FST multiple times in a row. This is how the FST maps a single input to multiple outputs (e.g. you cannot pass a List<Object> to Add(Int32sRef, T)). If your outputs are longs, and you need at most 2, then use UpToTwoPositiveInt64Outputs instead since it stores the outputs more compactly (by stealing a bit from each long value).

    NOTE: this cannot wrap itself (ie you cannot make an FST with List<List<Object>> outputs using this). @lucene.experimental

    UpToTwoPositiveInt64Outputs

    An FST Lucene.Net.Util.Fst.Outputs<T> implementation where each output is one or two non-negative long values. If it's a System.Single output, System.Nullable<T> is returned; else, TwoLongs. Order is preserved in the TwoLongs case, ie .first is the first input/output added to Builder<T>, and .second is the second. You cannot store 0 output with this (that's reserved to mean "no output")!

    NOTE: the only way to create a TwoLongs output is to add the same input to the FST twice in a row. This is how the FST maps a single input to two outputs (e.g. you cannot pass a UpToTwoPositiveInt64Outputs.TwoInt64s to Add(Int32sRef, T). If you need more than two then use ListOfOutputs<T>, but if you only have at most 2 then this implementation will require fewer bytes as it steals one bit from each long value.

    NOTE: the resulting FST is not guaranteed to be minimal! See Builder<T>.

    NOTE: This was UpToTwoPositiveIntOutputs in Lucene - the data type (int) was wrong there - it should have been long

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk

    UpToTwoPositiveInt64Outputs.TwoInt64s

    Holds two long outputs.

    NOTE: This was TwoLongs in Lucene

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