public static Dictionary read(URL dictURL) throws IOException {
    final URL expectedMetadataURL;
    try {
      String external = dictURL.toExternalForm();
      expectedMetadataURL = new URL(DictionaryMetadata.getExpectedMetadataFileName(external));
    } catch (MalformedURLException e) {
      throw new IOException("Couldn't construct relative feature map URL for: " + dictURL, e);
    }

    try (InputStream fsaStream = dictURL.openStream();
         InputStream metadataStream = expectedMetadataURL.openStream()) {
      return read(fsaStream, metadataStream);
    }
  }
public static Dictionary read ( URL dictURL ) throws IOException { final URL expectedMetadataURL ; try { String external = dictURL . toExternalForm ( ) ; expectedMetadataURL = new URL ( DictionaryMetadata . getExpectedMetadataFileName ( external ) ) ; } catch ( MalformedURLException e ) { throw new IOException ( "Couldn't construct relative feature map URL for: " + dictURL , e ) ; } try ( InputStream fsaStream = dictURL . openStream ( ) ; InputStream metadataStream = expectedMetadataURL . openStream ( ) ) { return read ( fsaStream , metadataStream ) ; } }
Attempts to load a dictionary using the URL to the FSA file and the
expected metadata extension.

@param dictURL The URL pointing to the dictionary file (<code>*.dict</code>).
@return An instantiated dictionary.
@throws IOException if an I/O error occurs.