private static boolean isConjWithNoPrep ( TreeGraphNode node , Collection < TypedDependency > list ) { for ( TypedDependency td : list ) { if ( td . gov ( ) == node && td . reln ( ) == CONJUNCT ) { // we have a conjunct // check the POS of the dependent String tdDepPOS = td . dep ( ) . parent ( ) . value ( ) ; if ( ! ( tdDepPOS . equals ( "IN" ) || tdDepPOS . equals ( "TO" ) ) ) { return true ; } } } return false ; }
Given a list of typedDependencies returns true if the node node is the governor of a conj relation with a dependent which is not a preposition