e2
attr / \ purpose
/ \
e1 e4
/\
attr / \ comment
e3 e5
Ambiguities:
e4 -> e3
ore4 -> e5
firste2 -> e1
ore2 -> e4
first?
-
First
e4 -attr-> e3
e2 / \ e1 +----------+ | attr | | S / \ N | | e3 e4 | +----------+ \ e5
-
Then
e4 -comment-> e5
e2 / \ e1 +-------------+ | comment | | N / \ S | | / \ | | e3..e4 e5 | +-------------+
-
Then
e2 -purpose-> e4
+--------------+ | purpose | | N / \ S | | / \ | / | e2 e3..e5 | e1 +--------------+
-
Finally,
e2 -attr-> e1
+--------------+ | attr | | S / \ N | | / \ | | e1 e2..e5 | +--------------+
So far so good, but were we just lucky?
-
Backing up to the result of step 2 above
e2 / \ / \ e1 +------+ |e3..e5| +------+
-
Now this time, we swing left first (
e2 -attr-> e1
):+--------------+ | attr | | S /\ N | | / \ | | e1 e2 | +--------------+ \ \ +------+ |e3..e5| +------+
-
And then do the
e2 - purpose -> e4
link+----------------+ | purpose | | N /\ S | | / \ | | / \ | | e1..e2 e3..e5 | +----------------+
So that worked out reasonably well too. Maybe we're OK so long as we don't have crossing dependencies. I seem to remember that I could blow up the converter just by changing the order I processed the nodes in these ambiguous cases though; will have to revisit next week
(maybe when there are 3 links, there's a way you can process them such that you create a crossing dependency and thereby be stuck in terms of how to build the RST tree, maybe I misremember)