<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://www.lensovet.net/~sysadmin/w/index.php?action=history&amp;feed=atom&amp;title=Trellis</id>
	<title>Trellis - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://www.lensovet.net/~sysadmin/w/index.php?action=history&amp;feed=atom&amp;title=Trellis"/>
	<link rel="alternate" type="text/html" href="http://www.lensovet.net/~sysadmin/w/index.php?title=Trellis&amp;action=history"/>
	<updated>2026-05-03T21:15:18Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.16</generator>
	<entry>
		<id>http://www.lensovet.net/~sysadmin/w/index.php?title=Trellis&amp;diff=3864&amp;oldid=prev</id>
		<title>192.168.1.134: Created page with '        /**          * Builds a Trellis over a sentence, by starting at the state State, and          * advancing through all legal extensions of each state already in the       …'</title>
		<link rel="alternate" type="text/html" href="http://www.lensovet.net/~sysadmin/w/index.php?title=Trellis&amp;diff=3864&amp;oldid=prev"/>
		<updated>2010-04-30T06:48:10Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;#039;        /**          * Builds a Trellis over a sentence, by starting at the state State, and          * advancing through all legal extensions of each state already in the       …&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;        /**&lt;br /&gt;
         * Builds a Trellis over a sentence, by starting at the state State, and&lt;br /&gt;
         * advancing through all legal extensions of each state already in the&lt;br /&gt;
         * trellis.  You should not have to modify this code (or even read it,&lt;br /&gt;
         * really).&lt;br /&gt;
         */&lt;br /&gt;
        private Trellis&amp;lt;State&amp;gt; buildTrellis(List&amp;lt;String&amp;gt; sentence) {&lt;br /&gt;
            Trellis&amp;lt;State&amp;gt; trellis = new Trellis&amp;lt;State&amp;gt;();&lt;br /&gt;
            trellis.setStartState(State.getStartState());&lt;br /&gt;
            State stopState = State.getStopState(sentence.size() + 2);&lt;br /&gt;
            trellis.setStopState(stopState);&lt;br /&gt;
            Set&amp;lt;State&amp;gt; states = Collections.singleton(State.getStartState());&lt;br /&gt;
            for (int position = 0; position &amp;lt;= sentence.size() + 1; position++) {&lt;br /&gt;
                Set&amp;lt;State&amp;gt; nextStates = new HashSet&amp;lt;State&amp;gt;();&lt;br /&gt;
                for (State state : states) {&lt;br /&gt;
                    if (state.equals(stopState))&lt;br /&gt;
                        continue;&lt;br /&gt;
                    LocalTrigramContext localTrigramContext = new LocalTrigramContext(sentence, position, state.getPreviousPreviousTag(), state.getPreviousTag());&lt;br /&gt;
                    Counter&amp;lt;String&amp;gt; tagScores = localTrigramScorer.getLogScoreCounter(localTrigramContext);&lt;br /&gt;
                    boolean skipper = false;&lt;br /&gt;
                    if (tagScores.totalCount() != 0) skipper = true;&lt;br /&gt;
                    for (String tag : tagScores.keySet()) {&lt;br /&gt;
                        double score = tagScores.getCount(tag);&lt;br /&gt;
                        if (skipper &amp;amp;&amp;amp; Math.abs(score) &amp;lt; 1) continue;&lt;br /&gt;
                        State nextState = state.getNextState(tag);&lt;br /&gt;
                        trellis.setTransitionCount(state, nextState, score);&lt;br /&gt;
                        nextStates.add(nextState);&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
                //        System.out.println(&amp;quot;States: &amp;quot;+nextStates);&lt;br /&gt;
                states = nextStates;&lt;br /&gt;
            }&lt;br /&gt;
            //System.out.println(&amp;quot;trellis size: bt = &amp;quot; + trellis.btsize() + &amp;quot;; ft = &amp;quot; + trellis.ftsize());&lt;br /&gt;
            return trellis;&lt;br /&gt;
        }&lt;/div&gt;</summary>
		<author><name>192.168.1.134</name></author>
		
	</entry>
</feed>