TypePathExtractor implements NamedFeatureExtractor1<T> { private boolean isValidPath(JCas view) { if (!pathChecked) { boolean validPath = isValidPath(type, path, view); if (validPath) pathChecked = true; return validPath; } else return true; } TypePathExtractor(
      Class<T> focusClass,
      String typePath,
      boolean traverseAllPaths,
      boolean returnAllValues,
      boolean uniqueValues);  TypePathExtractor(Class<T> focusClass, String typePath); static String createName(String namePrefix, String typePath); @Override String getFeatureName(); @Override List<org.cleartk.ml.Feature> extract(JCas view, Annotation focusAnnotation); static boolean isValidPath(Type type, String path, JCas view); static boolean isValidType(Type type, TypeSystem typeSystem); boolean isAllPaths(); boolean isAllValues(); Class<? extends Annotation> getFocusClass(); String getPath(); boolean isUniqueValues();  }
@Test public void testIsValidatePath() { assertTrue(TypePathExtractor.isValidPath(jCas.getCasType(PosTag.type), "value", jCas)); assertTrue(TypePathExtractor.isValidPath(jCas.getCasType(Header.type), "authors/lastName", jCas)); assertTrue(!TypePathExtractor.isValidPath( jCas.getCasType(Header.type), "authors/lastNames", jCas)); assertTrue(TypePathExtractor.isValidPath(jCas.getCasType(Token.type), "posTag/language", jCas)); assertTrue(TypePathExtractor.isValidPath(jCas.getCasType(Token.type), "posTag", jCas)); assertTrue(TypePathExtractor.isValidPath( jCas.getCasType(Token.type), "depRel/head/depRel/projective", jCas)); assertTrue(!TypePathExtractor.isValidPath( jCas.getCasType(Token.type), "depRel/head/projective", jCas)); assertTrue(TypePathExtractor.isValidPath( jCas.getCasType(Token.type), "depRel/head/orthogr", jCas)); assertTrue(TypePathExtractor.isValidPath(jCas.getCasType(Token.type), "depRel/projective", jCas)); assertTrue(TypePathExtractor.isValidPath( jCas.getCasType(Token.type), "depRel/head/depRel/projective", jCas)); }