Ooh, crossing dependencies, interesting!
So as I understand it, if you've got crossing dependency branches,
then that really cannot be represented with trees (or equivalently,
nested phrases) -- it sounds like more of a problem with trees in
general than with NLTK trees particularly! A more expert syntax person
can maybe correct/clarify if I'm misremembering.
You might be able to do something that works in practice, but the
formalism seems wrong for your problem...
On Fri, Jun 2, 2017 at 4:40 AM, Peter Bekins <
peter....@gmail.com> wrote:
> Right. So a dependency tree would be better, but as I said, I have a corpus
> already tagged according to phase structure. This works fine, *if* branches
> can cross, but I don't see any way in the nltk tree object to accommodate
> crossing branches. So for the example I gave earlier:
>
> [N w [P1 yamr ] [S yhwh ] [P1 [C l nj ]]]
> 'And said the Lord to Noah'
>
> I need to be able to read the structure as if it were:
>
> [N w 'And'
> [P yamr [C l nj ]] 'He said to Noah'
> [S yhwh]] 'The Lord'
> ]
>
> Does this make sense? For now, I wrote a script to treat two P1 subtrees as
> a single tree if they are at the same height. This seems to work okay, but I
> haven't worked through whether there might be problems as the trees start to
> get more complicated (i.e., with multiple embedded clauses).
--
-- alexr