Closed tuetschek closed 8 years ago
@michnov What about moving all alignment-related methods to a role Treex::Core::Node::Aligned
and adding there (as node methods) also the three documented functions from Treex::Tool::Align::Utils
?
(This is not really related to this PR, sorry.)
Thanks, I will check this out, it could make my code much nicer. Always having to take care about the direction of the links used to bother me a lot, and has been source of errors multiple times. Actually, @varisd may be affected, as he is the one playing with Depfix/MLFix now.
@martinpopel : Are there types of nodes that wouldn't have the role Aligned
, if we created it?
@tuetschek: I think all kinds of nodes can be aligned (although no one used it for n-nodes as fas as I know). So the role can be consumed by Treex::Core::Node
. I though that having all the alignment-related methods in a separate file could be handy.
@martinpopel: OK, you are probably right.
This uses the
Treex::Tool::Align::Utils
module by @michnov to provide bidirectional alignment – i.e. all nodes aligned from and to the current node will be returned foraligned->
.It works for me and I think it's better like this, but perhaps @ptakopysk may have a problem with it? Actually, @ptakopysk, could you use this to get rid of the
$alignment_hash
variable? It would make the code much nicer...