1

I'm looking for a reference \ algorithm \ tool that can convert a syntax tree to text.

The intention is to parse a sentence, apply some rules on the tree, and generate the output from the modified tree.

Ophir Yoktan
  • 111
  • 1
  • 2
    The obvious answer is to remove the tree structure, leaving only the words. Since that is very obvious, there must be something you're not telling us. – user6726 Mar 15 '21 at 16:33
  • I assumed the tree represents only the logical structure of the sentence, and may not preserve the original word order - but I maybe wrong – Ophir Yoktan Mar 16 '21 at 06:52
  • In languages with free word order, like Russian, sentences are not linear. In fact, it's impossible (or call it rather problematic) to write down a Russian sentence. E.g. Я тебя люблю (“I love you”) is not a sentence, it's an utterance which is just 1 out of the 6 possible sequences in which those 3 words can be arranged. To be consistent, we've got to write all those 6 sequences as a matrix, and that's what a Russian sentence is. By analyzing a syntax tree of a sentence of this kind it's impossible to infer which exactly word order variant was used in the original text. – Yellow Sky Mar 16 '21 at 13:46
  • @OphirYoktan, that's why you need to me explicit about what kind of tree you mean (where do these trees come from?). Traditionally, a tree is the words of an utterance in their order, adding constituent structure. Derivational theories have a sequence of such trees starting with a hypothetical "deep structure", so only the last tree is the actual utterance. – user6726 Mar 16 '21 at 15:33

0 Answers0