Fork me on GitHub
  • 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 Lucene.Net.Util.Fst.Builder<T>.Add(Lucene.Net.Util.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 Lucene.Net.Util.Fst.Builder<T>.Add(Lucene.Net.Util.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).

    Note

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

    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 float output, Nullable<T> is returned; else, UpToTwoPositiveInt64Outputs.TwoInt64s. Order is preserved in the UpToTwoPositiveInt64Outputs.TwoInt64s case, ie .first is the first input/output added to Lucene.Net.Util.Fst.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 Lucene.Net.Util.Fst.Builder<T>.Add(Lucene.Net.Util.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 Lucene.Net.Util.Fst.Builder<T>.

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

    Note

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

    UpToTwoPositiveInt64Outputs.TwoInt64s

    Holds two long outputs.

    NOTE: This was TwoLongs in Lucene
    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.