Class ConnectionCosts


  • public final class ConnectionCosts
    extends java.lang.Object
    n-gram connection cost data
    • Field Detail

      • buffer

        private final java.nio.ByteBuffer buffer
      • forwardSize

        private final int forwardSize
    • Constructor Detail

      • ConnectionCosts

        @Deprecated(forRemoval=true,
                    since="9.1")
        public ConnectionCosts​(BinaryDictionary.ResourceScheme scheme,
                               java.lang.String path)
                        throws java.io.IOException
        Deprecated, for removal: This API element is subject to removal in a future version.
        replaced by ConnectionCosts(Path) for files and ConnectionCosts(URL) for classpath/module resources.
        Parameters:
        scheme - - scheme for loading resources (FILE or CLASSPATH).
        path - - where to load resources from, without the ".dat" suffix
        Throws:
        java.io.IOException
      • ConnectionCosts

        public ConnectionCosts​(java.nio.file.Path connectionCostsFile)
                        throws java.io.IOException
        Create a ConnectionCosts from an external resource path.
        Parameters:
        connectionCostsFile - where to load connection costs resource
        Throws:
        java.io.IOException - if resource was not found or broken
      • ConnectionCosts

        public ConnectionCosts​(java.net.URL connectionCostsUrl)
                        throws java.io.IOException
        Create a ConnectionCosts from an external resource URL (e.g. from Classpath with ClassLoader.getResource(String)).
        Parameters:
        connectionCostsUrl - where to load connection costs resource
        Throws:
        java.io.IOException - if resource was not found or broken
      • ConnectionCosts

        private ConnectionCosts()
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • ConnectionCosts

        private ConnectionCosts​(IOSupplier<java.io.InputStream> connectionCostResource)
                         throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • getClassResource

        private static java.io.InputStream getClassResource()
                                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • get

        public int get​(int forwardId,
                       int backwardId)