Examples of PerfectHashDictionary


Examples of eu.danieldk.dictomaton.PerfectHashDictionary

        /**
         * Construct a {@link ImmutableStringShortMap}.
         */
        public synchronized ImmutableStringShortMap build() throws DictionaryBuilderException {
            PerfectHashDictionary dict = new DictionaryBuilder().addAll(d_map.keySet()).buildPerfectHash(false);

            short[] values = new short[d_map.size()];

            int i = 0;
            for (short value : d_map.values())
View Full Code Here

Examples of eu.danieldk.dictomaton.PerfectHashDictionary

        /**
         * Construct a {@link ImmutableStringShortMap}.
         */
        public synchronized ImmutableStringShortMap build() throws DictionaryBuilderException {
            PerfectHashDictionary dict = dictionaryBuilder.buildPerfectHash(false);

            short[] arr = new short[values.size()];

            for (int i = 0; i < values.size(); ++i)
                arr[i] = values.get(i);
View Full Code Here

Examples of eu.danieldk.dictomaton.PerfectHashDictionary

        /**
         * Construct a {@link ImmutableStringIntMap}.
         */
        public synchronized ImmutableStringObjectMap<V> build() throws DictionaryBuilderException {
            PerfectHashDictionary dict = new DictionaryBuilder().addAll(d_map.keySet()).buildPerfectHash(false);

            @SuppressWarnings("unchecked")
            V[] values = (V[]) new Object[d_map.size()];

            int i = 0;
View Full Code Here

Examples of eu.danieldk.dictomaton.PerfectHashDictionary

        /**
         * Construct a {@link ImmutableStringIntMap}.
         */
        public synchronized ImmutableStringObjectMap build() throws DictionaryBuilderException {
            PerfectHashDictionary dict = dictionaryBuilder.buildPerfectHash(false);

            @SuppressWarnings("unchecked")
            V[] arr = (V[]) new Object[values.size()];

            for (int i = 0; i < values.size(); ++i)
View Full Code Here

Examples of eu.danieldk.dictomaton.PerfectHashDictionary

        /**
         * Construct a {@link ImmutableStringDoubleMap}.
         */
        public synchronized ImmutableStringDoubleMap build() throws DictionaryBuilderException {
            PerfectHashDictionary dict = new DictionaryBuilder().addAll(d_map.keySet()).buildPerfectHash(false);

            double[] values = new double[d_map.size()];

            int i = 0;
            for (double value : d_map.values())
View Full Code Here

Examples of eu.danieldk.dictomaton.PerfectHashDictionary

        /**
         * Construct a {@link ImmutableStringDoubleMap}.
         */
        public synchronized ImmutableStringDoubleMap build() throws DictionaryBuilderException {
            PerfectHashDictionary dict = dictionaryBuilder.buildPerfectHash(false);

            double[] arr = new double[values.size()];

            for (int i = 0; i < values.size(); ++i)
                arr[i] = values.get(i);
View Full Code Here

Examples of eu.danieldk.dictomaton.PerfectHashDictionary

    /**
     * Construct a {@link ImmutableStringStringMap}.
     */
    public synchronized ImmutableStringStringMap build() throws DictionaryBuilderException
    {
      PerfectHashDictionary keyDict = new DictionaryBuilder().addAll(d_map.keySet()).buildPerfectHash(false);
      PerfectHashDictionary valueDict = new DictionaryBuilder().addAll(new TreeSet<String>(d_map.values()))
          .buildPerfectHash(false);

      int links[] = new int[keyDict.size()];

      for (Map.Entry<String, String> entry : d_map.entrySet())
      {
        int keyHashCode = keyDict.number(entry.getKey());
        int valueHashCode = valueDict.number(entry.getValue());

        links[keyHashCode - 1] = valueHashCode;
      }

      return new ImmutableStringStringMap(keyDict, valueDict, links);
View Full Code Here

Examples of eu.danieldk.dictomaton.PerfectHashDictionary

        /**
         * Construct a {@link ImmutableStringCharMap}.
         */
        public synchronized ImmutableStringCharMap build() throws DictionaryBuilderException {
            PerfectHashDictionary dict = new DictionaryBuilder().addAll(d_map.keySet()).buildPerfectHash(false);

            char[] values = new char[d_map.size()];

            int i = 0;
            for (char value : d_map.values())
View Full Code Here

Examples of eu.danieldk.dictomaton.PerfectHashDictionary

        /**
         * Construct a {@link ImmutableStringCharMap}.
         */
        public synchronized ImmutableStringCharMap build() throws DictionaryBuilderException {
            PerfectHashDictionary dict = dictionaryBuilder.buildPerfectHash(false);

            char[] arr = new char[values.size()];

            for (int i = 0; i < values.size(); ++i)
                arr[i] = values.get(i);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.