78bceca9f73e03e9c4fb156ce44fa6d010720704,theanolm/scoring/slflattice.py,SLFLattice,__init__,#SLFLattice#Any#,62

Before Change


            if self.initial_node is None:
                raise InputError("Could not find initial node in SLF lattice.")

        if self._final_node_id is not None:
            self.final_node = self.nodes[self._final_node_id]
        else:
            // Find the node with no outgoing links.
            self.final_node = None
            for node in self.nodes:
                if len(node.out_links) == 0:
                    self.final_node = node
                    break
            if self.final_node is None:
                raise InputError("Could not find final node in SLF lattice.")

        // If word identity information is not present in node definitions then
        // it must appear in link definitions.
        self._move_words_to_links()
        for link in self.links:
            if link.word is None:
                raise InputError("SLF lattice does not contain word identity "

After Change


                node.final = True
                final_nodes_found += 1

        if final_nodes_found == 0:
            raise InputError("Could not find final node in SLF lattice.")
        elif final_nodes_found > 1:
            // Peter: Not sure if multiple final nodes are allowed, but for now raise an input error. The
            // decoder supports multiple final nodes no problem
            raise InputError("More then one final node in SLF lattice.")


        // If word identity information is not present in node definitions then
        // it must appear in link definitions.
        self._move_words_to_links()
        for link in self.links:
            if link.word is None:
                raise InputError("SLF lattice does not contain word identity "
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: senarvi/theanolm
Commit Name: 78bceca9f73e03e9c4fb156ce44fa6d010720704
Time: 2017-06-06
Author: peter@smitmail.eu
File Name: theanolm/scoring/slflattice.py
Class Name: SLFLattice
Method Name: __init__


Project Name: probcomp/bayeslite
Commit Name: 0bb3b9b7482e37e894469fdd9b2e2a45c3fe5355
Time: 2016-10-21
Author: fsaad@mit.edu
File Name: src/bqlfn.py
Class Name:
Method Name: bayesdb_simulate


Project Name: elfi-dev/elfi
Commit Name: b19e3080dba989e2e7e08c74877f8396790f83d2
Time: 2016-12-05
Author: jarno.lintusaari@aalto.fi
File Name: elfi/graph.py
Class Name: Node
Method Name: remove_parent