public static DepType getDepType(DependencyTree tree, int pIdx, int aIdx) { Bunsetsu pBun = tree.getBunsetsuFromNodeId(pIdx); Bunsetsu aBun = tree.getBunsetsuFromNodeId(aIdx); Bunsetsu pBunHeadBun = tree.getBunsetsuFromId(pBun.getHead()); Bunsetsu aBunHeadBun = tree.getBunsetsuFromId(aBun.getHead()); if (pBun.getId() == aBun.getId()) { return DepType.SAME_PHRASE; } else if (pBun.getId() == aBunHeadBun.getId()) { return DepType.DEP; } else if (pBunHeadBun.getId() == aBunHeadBun.getId()) { return DepType.DEP; } else { return DepType.ZERO_INTRA; } }