index of head child, or -1 on miss
(Since version ) see corresponding Javadoc for more information.
Based on Aria's comments:
Basically, you're looking for the head label by searching in Dir for each parent -> rule expansion.
Dir is whether or not to look left to right or right to left Dis determines whether you are looking for the first match of any of the categories, or if you're looking for any match of the first category, then the second, etc. etc.