lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dawid Weiss <dawid.we...@cs.put.poznan.pl>
Subject Fst - arc output?
Date Fri, 30 Mar 2012 18:13:50 GMT
I'm doing this on trunk:


        WFSTCompletionLookup cl = new WFSTCompletionLookup();
        TermFreq [] input = new TermFreq [] {
            new TermFreq("cat",   0),
            new TermFreq("chat",  2),
            new TermFreq("fat",   3),
            new TermFreq("feat",  1),
            new TermFreq("sea",   0),
            new TermFreq("seat",  3),
            new TermFreq("swat",  0),
            new TermFreq("sweat", 3),
        };
        cl.build(new TermFreqArrayIterator(input));

        StringWriter sw = new StringWriter();
        Field f = cl.getClass().getDeclaredField("fst");
        f.setAccessible(true);
        FST<?> fst = (FST<?>) f.get(cl);
        Util.toDot(fst, sw, false, true);

        for (TermFreq tf : input) {
            List<LookupResult> lookup =
cl.lookup(tf.term.utf8ToString(), true, 1);
            System.out.println(lookup.get(0));
        }

        System.out.println(sw.toString());

The output is attached. How come the first arcs have such high outputs?

Dawid

Mime
View raw message