Package org.apache.lucene.analysis.synonym.word2vec

## Class Word2VecModel

- java.lang.Object
- - org.apache.lucene.analysis.synonym.word2vec.Word2VecModel

- All Implemented Interfaces:
    `RandomAccessVectorValues<float[]>`

      public class Word2VecModel
      extends Object
      implements RandomAccessVectorValues<float[]>

  Word2VecModel is a class representing the parsed Word2Vec model containing the vectors for each word in dictionary
  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Word2VecModel​(int dictionarySize, int vectorDimension)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addTermAndVector​(TermAndVector modelEntry)` |
    `RandomAccessVectorValues<float[]>` | `copy()` |
    `int` | `dimension()` |
    `int` | `size()` |
    `BytesRef` | `termValue​(int targetOrd)` |
    `float[]` | `vectorValue​(int targetOrd)` |
    `float[]` | `vectorValue​(BytesRef term)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.lucene.util.hnsw.RandomAccessVectorValues

      `getAcceptOrds, ordToDoc`

- - ### Constructor Detail

    - #### Word2VecModel

          public Word2VecModel​(int dictionarySize,
                               int vectorDimension)

  - ### Method Detail

    - #### addTermAndVector

          public void addTermAndVector​(TermAndVector modelEntry)

    - #### vectorValue

          public float[] vectorValue​(int targetOrd)

      Specified by:
        `vectorValue` in interface `RandomAccessVectorValues<float[]>`

    - #### vectorValue

          public float[] vectorValue​(BytesRef term)

    - #### termValue

          public BytesRef termValue​(int targetOrd)

    - #### dimension

          public int dimension()

      Specified by:
        `dimension` in interface `RandomAccessVectorValues<float[]>`

    - #### size

          public int size()

      Specified by:
        `size` in interface `RandomAccessVectorValues<float[]>`

    - #### copy

          public RandomAccessVectorValues<float[]> copy()
                                                 throws IOException

      Specified by:
        `copy` in interface `RandomAccessVectorValues<float[]>`
      Throws:
        `IOException`