However, I feel like LinkGrammar4R need more higher-level API that free us for checking these index. It may be an iterator?
iterateLinkage(sent, opt).each{|linkage|
.....
}
or
parsedSentence.eachLinkage(opt) {|linkage|
......
}
Vee Satayamas's Personal BLOG.
iterateLinkage(sent, opt).each{|linkage|
.....
}
or
parsedSentence.eachLinkage(opt) {|linkage|
......
}
2 comments:
Vee, thanks for working through that bug in less than a few hours! lol
Great idea for more interface designs, and yes - I think we need some sort of way to interface better with a parsed sentence. The OO approach that is currently used isn't bad, but Ruby provides such beautiful iterators that it'd be a shame not to utilize them in a more complete way.
Maybe something like:
parsedSentence.linkages.each
... could work as well (in addition to your ideas)...
It was filed as feature request here
Post a Comment