biblicalhumanities / treedown

Markdown for syntax trees - see http://jonathanrobie.biblicalhumanities.org/blog/2017/05/12/lowfat-treebanks-visualizing/
Apache License 2.0
7 stars 0 forks source link

Initial indentation #32

Closed jonathanrobie closed 5 years ago

jonathanrobie commented 7 years ago

James Tauber wrote:

I'm just saying I aesthetically find multiple indentations at once (or an initial indentation) odd looking.

This occurs primarily with coordinating conjunctions:

        pc Ἐν ἀρχῇ
        v ἦν
        s  ὁ λόγος,
καὶ
        s ὁ λόγος
        v ἦν
        pc πρὸς τὸν θεόν,
καὶ
        pc θεὸς
        v ἦν
        s ὁ λόγος.

Which is equivalent to this bracket notation:

[S
    [ 
        [pc  Ἐν ἀρχῇ ]
        [v  ἦν]
        [s   ὁ λόγος,] 
    ]
    καὶ
    [ 
        [s  ὁ λόγος ]
        [v  ἦν]
        [pc  πρὸς τὸν θεόν,] 
    ]
    καὶ
    [ 
        [pc  θεὸς ]
        [v  ἦν]
        [s  ὁ λόγος.] 
    ] 
 ]

If we want to represent coordinating conjunctions this way, I see little advantage to introducing a symbol before the initial indentation. A sentence automatically introduces the S node.

There's an argument for saying that every sentence has a single main clause and the other clauses should be treated as adjuncts. The downside is that some analyses we like - including GBI - do not have that constraint, the upside is that this fits the sentence expansion model better and also a common definition of what a sentence is among linguists. Following that convention, we would have to express John 1:1 something like this:

pc Ἐν ἀρχῇ
v ἦν
s  ὁ λόγος,
+ καὶ
        s ὁ λόγος
        v ἦν
        pc πρὸς τὸν θεόν,
+ καὶ
        pc θεὸς
        v ἦν
        s ὁ λόγος.

I don't know that we can impose that constraint on everyone's analysis, though ...

jtauber commented 7 years ago

My issue isn't just the initial indentation but the double indentation that results when this sort of structure is itself embedded in another clause.

I'm not going to lie down on the tracks for it, just raising whatever issues I come across when treedowning that initially strike me as odd, ugly, or confusing. If you're -1 on it, though, I'm happy to let it go.

I agree that it's preferable to treat the first item in a coordination as being at the same indentation level as the subsequent items so I too dislike your final example above.

There is still the issue of not having a handle for collapsing but I can treat that as purely a UI issue (although that will mean likely introducing a symbol anyway)

jonathanrobie commented 7 years ago

There is still the issue of not having a handle for collapsing but I can treat that as purely a UI issue (although that will mean likely introducing a symbol anyway)

Is the S node sufficient? Treedown tries to be minimal, so the S node is implicit.

jonathanrobie commented 7 years ago

My issue isn't just the initial indentation but the double indentation that results when this sort of structure is itself embedded in another clause.

The double indentation is a result of (1) indentation plus (2) a label, which says that the given line is actually only one constituent among a set of related constituents. I think that's baked into the semantics of the language, and not just for initial constituents, so special casing initial constituents would make the language less orthogonal. You get the same double indentation when it is not initial, e.g.

+ 
    v.part διαγενομένου
    s τοῦ σαββάτου
s Μαρία ἡ Μαγδαληνὴ καὶ Μαρία ἡ τοῦ Ἰακώβου καὶ Σαλώμη
v ἠγόρασαν
o ἀρώματα
+ ἵνα
    v.part ἐλθοῦσαι
    v ἀλείψωσιν
    o αὐτόν.

which is equivalent to:

[S 
  [+  
    [ 
      [v.part  διαγενομένου]
      [s  τοῦ σαββάτου] 
    ] 
  ]
  [s  Μαρία ἡ Μαγδαληνὴ καὶ Μαρία ἡ τοῦ Ἰακώβου καὶ Σαλώμη]
  [v  ἠγόρασαν]
  [o  ἀρώματα ]
  [+  ἵνα
    [ 
      [v.part  ἐλθοῦσαι]
      [v  ἀλείψωσιν]
      [o  αὐτόν.] 
    ] 
  ] 
]

In my parser, I use two stacks to handle that, one for indent levels and one for labels - when I encounter a label, I push the indent level onto a stack, when I hit an outdent, I check to see if there is a matching indent on the labels stack.

jonathanrobie commented 5 years ago

@jtauber this has been open a long time, can I close it?

jtauber commented 5 years ago

Sure. I can re-open if I gain strong feelings about it at any point :-)