Package com.googlecode.gaal.suffix.impl

Examples of com.googlecode.gaal.suffix.impl.LinearizedSuffixTreeImpl


    }

    private void visualizeEmbeddedSuffixesInWindow(String fileName, String caption, String label) throws IOException {
        buffer.append(String.format(LATEX_INPUT, fileName));
        Writer out = new FileWriter(DOC_PATH + fileName);
        LinearizedSuffixTree lst = new LinearizedSuffixTreeImpl(corpus.sequence(), corpus.alphabetSize());
        int windowSize = 5;
        Interval interval = findInterval(lst, "in");
        LaTeXVisualizer.visualizeEmbeddedSuffixesInWindow(out, caption, label, lst, interval, windowSize, corpus);
        out.flush();
        out.close();
View Full Code Here


    }

    private void visualizeEmbeddedSuffixTable(String fileName, String caption, String label) throws IOException {
        buffer.append(String.format(LATEX_INPUT, fileName));
        Writer out = new FileWriter(DOC_PATH + fileName);
        LinearizedSuffixTree lst = new LinearizedSuffixTreeImpl(corpus.sequence(), corpus.alphabetSize());
        int windowSize = 5;
        Interval interval = findInterval(lst, "in");
        EmbeddedSuffixTree est = EmbeddedSuffixTreeImpl.create(lst, interval, windowSize, corpus);
        LaTeXVisualizer.visualizeEmbeddedSuffixTable(out, caption, label, est, corpus);
        out.flush();
View Full Code Here

    }

    private void visualizeEmbeddedLcpTable(String fileName, String caption, String label) throws IOException {
        buffer.append(String.format(LATEX_INPUT, fileName));
        Writer out = new FileWriter(DOC_PATH + fileName);
        LinearizedSuffixTree lst = new LinearizedSuffixTreeImpl(corpus.sequence(), corpus.alphabetSize());
        int windowSize = 5;
        Interval interval = findInterval(lst, "in");
        EmbeddedSuffixTree est = EmbeddedSuffixTreeImpl.create(lst, interval, windowSize, corpus);
        LaTeXVisualizer.visualizeLcpInSuffixTable(out, caption, label, est, corpus, true);
        out.flush();
View Full Code Here

    }

    private void visualizeEmbeddedSuffixTree(String fileName, String caption, String label) throws IOException {
        buffer.append(String.format(LATEX_INPUT, fileName));
        Writer out = new FileWriter(DOC_PATH + fileName);
        LinearizedSuffixTree lst = new LinearizedSuffixTreeImpl(corpus.sequence(), corpus.alphabetSize());
        int windowSize = 5;
        Interval interval = findInterval(lst, "in");
        EmbeddedSuffixTree est = EmbeddedSuffixTreeImpl.create(lst, interval, windowSize, corpus);
        LaTeXVisualizer.visualizeEmbeddedSuffixTree(out, caption, label, est, corpus);
        out.flush();
View Full Code Here

    }

    private void visualizeEmbeddedIntervalTree(String fileName, String caption, String label) throws IOException {
        buffer.append(String.format(LATEX_INPUT, fileName));
        Writer out = new FileWriter(DOC_PATH + fileName);
        LinearizedSuffixTree lst = new LinearizedSuffixTreeImpl(corpus.sequence(), corpus.alphabetSize());
        int windowSize = 5;
        Interval interval = findInterval(lst, "in");
        EmbeddedSuffixTree est = EmbeddedSuffixTreeImpl.create(lst, interval, windowSize, corpus);
        LaTeXVisualizer.visualizeIntervalTree(out, caption, label, est, null, corpus);
        out.flush();
View Full Code Here

        srcCorpus = new TreeMapCorpus(srcTokenizer, SEPARATORS);
        dstCorpus = new TreeMapCorpus(dstTokenizer, SEPARATORS);
        // IntervalSetBuilder intervalSetBuilder = new SupermaximalSetBuilder();
        srcSequence = srcCorpus.sequence();
        dstSequence = dstCorpus.sequence();
        srcLST = new LinearizedSuffixTreeImpl(srcSequence, srcCorpus.alphabetSize());
        dstLST = new LinearizedSuffixTreeImpl(dstSequence, dstCorpus.alphabetSize());
        srcVectors = new ArrayList<Vector>();
        dstVectors = new ArrayList<Vector>();
        srcObjects = new ArrayList<Interval>();
        dstObjects = new ArrayList<Interval>();
        VectorBuilder<Interval> vectorBuilder = new IntervalVectorBuilder<Interval>();
View Full Code Here

        }

        Runnable srcLSTBuilder = new Runnable() {
            @Override
            public void run() {
                srcLST = new LinearizedSuffixTreeImpl(srcSequence, srcCorpus.alphabetSize());
            }
        };

        Thread srcThread = new Thread(srcLSTBuilder);
        srcThread.start();

        if (dstCorpus != null) {
            Runnable dstLSTBuilder = new Runnable() {
                @Override
                public void run() {
                    dstLST = new LinearizedSuffixTreeImpl(dstSequence, dstCorpus.alphabetSize());
                }
            };

            Thread dstThread = new Thread(dstLSTBuilder);
            dstThread.start();
View Full Code Here

        if (Aligner.isVerbose()) {
            stopwatch = new Stopwatch();
            stopwatch.start();
        }
        if (buildLST) {
            srcLST = new LinearizedSuffixTreeImpl(srcSequence, srcCorpus.alphabetSize());
            if (stopwatch != null) {
                System.out.printf("constructed source suffix arrays in %s\n", stopwatch);
            }
        }
        if (dstCorpus != null) {
            dstSequence = dstCorpus.sequence();
            if (buildLST) {
                if (stopwatch != null) {
                    stopwatch.reset();
                }
                dstLST = new LinearizedSuffixTreeImpl(dstSequence, dstCorpus.alphabetSize());
                if (stopwatch != null) {
                    System.out.printf("constructed target suffix arrays in %s\n", stopwatch);
                }
            }
        } else {
View Full Code Here

    private final IntervalSet<BinaryInterval> lptMaximalSet;
    private final Map<Context, Map<Interval, Integer>> envMap = new TreeMap<Context, Map<Interval, Integer>>();
    private final boolean maximalOnly;

    public NestedMaximalityContextExtractor(Corpus<S> corpus, boolean maximalOnly) {
        this.lst = new LinearizedSuffixTreeImpl(corpus.sequence(), corpus.alphabetSize());
        this.lpt = new LinearizedSuffixTreeImpl(corpus.sequence().reverse(), corpus.alphabetSize());
        lstMaximalSet = new LocalMaximumSetBuilder().buildIntervalSet(lst);
        lstBwtSet = new SingletonBwtSetBuilder().buildIntervalSet(lst);
        lptMaximalSet = new LocalMaximumSetBuilder().buildIntervalSet(lpt);
        this.maximalOnly = maximalOnly;
        traverseLeft(lst.top(), 0, new HashSet<Interval>());
View Full Code Here

    @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

TOP

Related Classes of com.googlecode.gaal.suffix.impl.LinearizedSuffixTreeImpl

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.