Package org.apache.lucene.analysis.ja.dict

## Class UnknownDictionary

- java.lang.Object
- - org.apache.lucene.analysis.ja.dict.BinaryDictionary
  - - org.apache.lucene.analysis.ja.dict.UnknownDictionary

- All Implemented Interfaces:
    `Dictionary`

      public final class UnknownDictionary
      extends BinaryDictionary

  Dictionary for unknown-word handling.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.lucene.analysis.ja.dict.BinaryDictionary

      `BinaryDictionary.ResourceScheme`

  - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.analysis.ja.dict.BinaryDictionary

      `DICT_FILENAME_SUFFIX, DICT_HEADER, HAS_BASEFORM, HAS_PRONUNCIATION, HAS_READING, POSDICT_FILENAME_SUFFIX, POSDICT_HEADER, TARGETMAP_FILENAME_SUFFIX, TARGETMAP_HEADER, VERSION`

    - ### Fields inherited from interface org.apache.lucene.analysis.ja.dict.Dictionary

      `INTERNAL_SEPARATOR`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `UnknownDictionary​(URL targetMapUrl, URL posDictUrl, URL dictUrl)` | Create a `UnknownDictionary` from an external resource URL (e.g.
    `UnknownDictionary​(Path targetMapFile, Path posDictFile, Path dictFile)` | Create a `UnknownDictionary` from an external resource path.
    `UnknownDictionary​(BinaryDictionary.ResourceScheme scheme, String path)` | Deprecated, for removal: This API element is subject to removal in a future version. replaced by `UnknownDictionary(Path, Path, Path)` for files and `UnknownDictionary(URL, URL, URL)` for classpath/module resources

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `CharacterDefinition` | `getCharacterDefinition()` |
    `String` | `getInflectionForm​(int wordId)` | Get inflection form of tokens
    `String` | `getInflectionType​(int wordId)` | Get inflection type of tokens
    `static UnknownDictionary` | `getInstance()` |
    `String` | `getReading​(int wordId, char[] surface, int off, int len)` | Get reading of tokens
    `int` | `lookup​(char[] text, int offset, int len)` |

    - ### Methods inherited from class org.apache.lucene.analysis.ja.dict.BinaryDictionary

      `getBaseForm, getLeftId, getPartOfSpeech, getPronunciation, getResource, getRightId, getWordCost, lookupWordIds`

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

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

- - ### Constructor Detail

    - #### UnknownDictionary

          @Deprecated(forRemoval=true,
                      since="9.1")
          public UnknownDictionary​(BinaryDictionary.ResourceScheme scheme,
                                   String path)
                            throws IOException

      Deprecated, for removal: This API element is subject to removal in a future version.
      replaced by `UnknownDictionary(Path, Path, Path)` for files and `UnknownDictionary(URL, URL, URL)` for classpath/module resources
      Parameters:
        `scheme` - scheme for loading resources (FILE or CLASSPATH).
        `path` - where to load resources from; a path, including the file base name without extension; this is used to match multiple files with the same base name.
      Throws:
        `IOException`

    - #### UnknownDictionary

          public UnknownDictionary​(Path targetMapFile,
                                   Path posDictFile,
                                   Path dictFile)
                            throws IOException

      Create a `UnknownDictionary` from an external resource path.
      Parameters:
        `targetMapFile` - where to load target map resource
        `posDictFile` - where to load POS dictionary resource
        `dictFile` - where to load dictionary entries resource
      Throws:
        `IOException` - if resource was not found or broken

    - #### UnknownDictionary

          public UnknownDictionary​(URL targetMapUrl,
                                   URL posDictUrl,
                                   URL dictUrl)
                            throws IOException

      Create a `UnknownDictionary` from an external resource URL (e.g. from Classpath with `ClassLoader.getResource(String)`).
      Parameters:
        `targetMapUrl` - where to load target map resource
        `posDictUrl` - where to load POS dictionary resource
        `dictUrl` - where to load dictionary entries resource
      Throws:
        `IOException` - if resource was not found or broken

  - ### Method Detail

    - #### lookup

          public int lookup​(char[] text,
                            int offset,
                            int len)

    - #### getCharacterDefinition

          public CharacterDefinition getCharacterDefinition()

    - #### getReading

          public String getReading​(int wordId,
                                   char[] surface,
                                   int off,
                                   int len)

      Description copied from interface: `Dictionary`
      Get reading of tokens
      Specified by:
        `getReading` in interface `Dictionary`
      Overrides:
        `getReading` in class `BinaryDictionary`
      Parameters:
        `wordId` - word ID of token
      Returns:
        Reading of the token

    - #### getInflectionType

          public String getInflectionType​(int wordId)

      Description copied from interface: `Dictionary`
      Get inflection type of tokens
      Specified by:
        `getInflectionType` in interface `Dictionary`
      Overrides:
        `getInflectionType` in class `BinaryDictionary`
      Parameters:
        `wordId` - word ID of token
      Returns:
        inflection type, or null

    - #### getInflectionForm

          public String getInflectionForm​(int wordId)

      Description copied from interface: `Dictionary`
      Get inflection form of tokens
      Specified by:
        `getInflectionForm` in interface `Dictionary`
      Overrides:
        `getInflectionForm` in class `BinaryDictionary`
      Parameters:
        `wordId` - word ID of token
      Returns:
        inflection form, or null

    - #### getInstance

          public static UnknownDictionary getInstance()