Package com.googlecode.gaal.data.impl

Examples of com.googlecode.gaal.data.impl.ArraySequence


            for (int i = 0; i < indices.size(); i++) {
                if (!removedIndices.get(i)) {
                    newIndices[counter++] = indices.get(i);
                }
            }
            return new ArraySequence(newIndices);
        }
    }
View Full Code Here


            return interval;
        }

        @Override
        public IntSequence embeddingIndices() {
            return new ArraySequence(embeddingSuffixTable, left, right + 1);
        }
View Full Code Here

            return right - left + 1;
        }

        @Override
        public IntSequence indices() {
            return new ArraySequence(suffixTable, left, right + 1);
        }
View Full Code Here

            } // right half
        }

        // recurse if names are not yet unique
        if (name < n02) {
            sort(new ArraySequence(s12), sa12, n02, name);
            // store unique names in s12 using the suffix array
            for (int i = 0; i < n02; i++)
                s12[sa12[i]] = i + 1;
        } else
            // generate the suffix array of s12 directly
View Full Code Here

    private LinearizedSuffixTree lpt;

    @Before
    public void setUp() throws Exception {

        IntSequence sequence = new ArraySequence(text);
        lst = new LinearizedSuffixTreeImpl(sequence, alphabet.length - 1);
        lpt = new LinearizedSuffixTreeImpl(sequence.reverse(), alphabet.length - 1);
    }
View Full Code Here

    @Test
    public void testSearch() {
        IntSequence pattern;
        Interval interval;
        pattern = new ArraySequence(new int[] { 3, 4 });
        interval = lst.search(pattern);
        System.out.printf("%s\t->%s\n", interval, interval.label());
        assertTrue(seqEquals(interval.label(), pattern));
        pattern = new ArraySequence(new int[] { 3, 4, 2, 1 });
        interval = lst.search(pattern);
        System.out.printf("%s\t->%s\n", interval, interval.label());
        assertTrue(seqEquals(interval.label(), pattern));
        pattern = new ArraySequence(new int[] { 3, 4, 1 });
        interval = lst.search(pattern);
        assertNull(interval);
    }
View Full Code Here

   
    @Test
    public void testLongestSearch() {
        int[] patternToFind = { 2, 1, 4 };
        int[] expectedArray = {2, 1};
        IntSequence pattern = new ArraySequence(patternToFind);
        IntSequence expected = new ArraySequence(expectedArray);
        System.out.println("Looking for : " + pattern);
        System.out.println("Expected: " + expected);
        Interval result = lst.longestSearch(pattern);
        System.out.println("Longest found: " + result.label());
        assertEquals(expected, result.label());
View Full Code Here

    private EnhancedSuffixArray esa;
    private EnhancedSuffixArray epa;

    @Before
    public void setUp() throws Exception {
        IntSequence sequence = new ArraySequence(text);
        esa = new EnhancedSuffixArrayImpl(sequence, alphabet.length - 1);
        epa = new EnhancedSuffixArrayImpl(sequence.reverse(), alphabet.length - 1);
    }
View Full Code Here

        String[] stringArray = string.split(" ");
        int[] intArray = new int[stringArray.length];
        for (int i = 0; i < intArray.length; i++) {
            intArray[i] = corpus.toInt(stringArray[i]);
        }
        return new ArraySequence(intArray);
    }
View Full Code Here

TOP

Related Classes of com.googlecode.gaal.data.impl.ArraySequence

Copyright © 2018 www.massapicom. 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.