Package com.googlecode.gaal.suffix.api.LinearizedSuffixTree

Examples of com.googlecode.gaal.suffix.api.LinearizedSuffixTree.BinaryInterval


    private void visualizeChild(LinearizedSuffixTree lst, BinaryInterval node, int depth) {
        if (maxDepth == 0) {
            visualizeCell(lst, lst.top(), false);
        } else {
            if (!node.isTerminal()) {
                BinaryInterval left = node.leftChild();
                BinaryInterval right = node.rightChild();
                if (depth == maxDepth) {
                    visualizeCell(lst, left, true);
                    visualizeCell(lst, right, false);
                } else if (depth < maxDepth) {
                    visualizeChild(lst, left, depth + 1);
View Full Code Here


            traverseLeft(interval.rightChild(), lcp, new HashSet<Interval>(fillSet));
        }
    }

    private void extendToRight(Interval interval, Set<Interval> fillSet) {
        BinaryInterval lptInterval = lpt.search(interval.label().reverse());
        assert (lptInterval != null);
        assert (interval.label().size() == lptInterval.label().size());
        if (!lptMaximalSet.contains(lptInterval)) {
            collectLeftMaximal(lptInterval, lptInterval, interval, lptInterval.lcp(), fillSet);
        }
    }
View Full Code Here

    @Test
    public void testMaximal() {
        System.out.println("Maximality Test");
        Iterator<BinaryInterval> iter = lst.preorderIterator();
        while (iter.hasNext()) {
            BinaryInterval interval = iter.next();
            if (!interval.isTerminal()) {
                if (maximalSet.contains(interval) != isMaximal(interval)) {
                    System.err.printf("%s - got:%s, expected:%s\n", interval, maximalSet.contains(interval),
                            isMaximal(interval));
                    int[] lcpTable = lst.getLcpTable();
                    for (int i = interval.left(); i <= interval.right(); i++) {
                        System.err.print(lcpTable[i]);
                    }
                    System.err.println();
                    fail("maximality mismatch");
                }
View Full Code Here

    @Test
    public void testSupermaximal() {
        System.out.println("Supermaximality Test");
        Iterator<BinaryInterval> iter = lst.preorderIterator();
        while (iter.hasNext()) {
            BinaryInterval interval = iter.next();
            if (!interval.isTerminal()) {
                if ((distinctBwtSet.contains(interval) && maximalSet.contains(interval)) != isSupermaximal(interval)) {
                    System.err.printf("%s - got:%s, expected:%s\n", interval, distinctBwtSet.contains(interval),
                            isSupermaximal(interval));
                    int[] suffixTable = lst.getSuffixTable();
                    IntSequence sequence = corpus.sequence();
                    for (int i = interval.left(); i <= interval.right(); i++) {
                        System.err.print(corpus.toToken(sequence.get(suffixTable[i] - 1, sequence.size() - 1)) + " ");
                    }
                    System.err.println();
                    fail("supermaximality mismatch");
                }
View Full Code Here

    @Test
    public void testBwtSingleton() {
        System.out.println("Bwt Singleton Test");
        Iterator<BinaryInterval> iter = lst.preorderIterator();
        while (iter.hasNext()) {
            BinaryInterval interval = iter.next();
            if (!interval.isTerminal()) {
                if (singletonBwtSet.contains(interval) != isBwtSingleton(interval)) {
                    System.err.printf("%s - got:%s, expected:%s\n", interval, singletonBwtSet.contains(interval),
                            isBwtSingleton(interval));
                    int[] suffixTable = lst.getSuffixTable();
                    IntSequence sequence = corpus.sequence();
                    for (int i = interval.left(); i <= interval.right(); i++) {
                        System.err.print(corpus.toToken(sequence.get(suffixTable[i] - 1, sequence.size() - 1)) + " ");
                    }
                    System.err.println();
                    fail("bwt singleton mismatch");
                }
View Full Code Here

        }
        System.out.printf("total contexts: %d\n", counter);
    }

    private Multiset<IntSequence> fillerSet(IntSequence left, IntSequence right) {
        BinaryInterval leftInterval = lst.search(left);
        Multiset<IntSequence> expectedSet = null;
        if (leftInterval == null) {
            System.err.printf("left context not found: %s\n", left);
            fail("left context not found");
        } else {
View Full Code Here

TOP

Related Classes of com.googlecode.gaal.suffix.api.LinearizedSuffixTree.BinaryInterval

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.