Interface Sense<V>

  • Type Parameters:
    V - the type of value
    All Superinterfaces:
    Supplier<V>
    All Known Implementing Classes:
    IndexedSense

    public interface Sense<V>
    extends Supplier<V>
    A monad that provides the wrapped value with a sense identifier.
    • Method Detail

      • disambiguate

        static <V> Map<Sense<V>,​Number> disambiguate​(Map<V,​Map<Sense<V>,​Map<V,​Number>>> inventory,
                                                           ContextSimilarity<V> similarity,
                                                           Map<V,​Number> context,
                                                           Collection<V> ignored)
        Disambiguate each element of the context by maximizing its similarity to the senses in the inventory.

        The method skips context keys marked as ignored.

        Type Parameters:
        V - the context element class
        Parameters:
        inventory - the sense inventory
        similarity - the similarity measure
        context - the context to disambiguate
        ignored - the ignored elements of context
        Returns:
        the disambiguated context