Giter Site home page Giter Site logo

Comments (2)

pjwilliams avatar pjwilliams commented on August 22, 2024

Hi,

the ConnectNodes function requires that the SyntaxTree's nodes describe a complete tree (i.e. it doesn't assume that there is an implicit node for each word of the associated sentence or anything like that). If you add a couple of extra nodes to cover the gaps then it should work as expected:

SyntaxTree st;
st.AddNode(0, 2, "X2"); // add a node cover 0 and 2
st.AddNode(0, 3, "X3");
st.AddNode(1, 2, "X1");
st.AddNode(0, 0, "Y");
st.AddNode(3, 3, "Z");
st.ConnectNodes();

Please let me know if it doesn't...

Phil

On 16 Jan 2015, at 10:21, RyanLiu1900 [email protected] wrote:

Hi, this code has some bug, may it get the syntax structure wrong.
For example, use this SyntaxTree, I build this syntax tree.

SyntaxTree st;
st.AddNode(0, 2, "X2"); // add a node cover 0 and 2
st.AddNode(0, 3, "X3");
st.AddNode(1, 2, "X1");
st.ConnectNodes();

But after it construct the tree, I find that the parent of "X1" is "X3" !!


Reply to this email directly or view it on GitHub.

from mosesdecoder.

 avatar commented on August 22, 2024

Got it! Thanks very much.

from mosesdecoder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.