TypePathExtractor implements NamedFeatureExtractor1<T> { public static boolean isValidType(Type type, TypeSystem typeSystem) { String typeName = type.getName(); for (String handledType : HANDLED_TYPES) { if (typeName.equals(handledType)) return true; } if (typeSystem.subsumes(typeSystem.getType("uima.cas.String"), type)) return true; if (typeSystem.subsumes(typeSystem.getType("uima.tcas.Annotation"), type)) return true; return false; } 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 testIsValidType() { assertTrue(TypePathExtractor.isValidType(jCas.getCasType(PosTag.type), jCas.getTypeSystem())); assertTrue(TypePathExtractor.isValidType(jCas.getCasType(Token.type), jCas.getTypeSystem())); assertTrue(TypePathExtractor.isValidType( jCas.getTypeSystem().getType("org.cleartk.test.util.type.Language"), jCas.getTypeSystem())); assertTrue(TypePathExtractor.isValidType( jCas.getTypeSystem().getType("uima.cas.String"), jCas.getTypeSystem())); assertTrue(TypePathExtractor.isValidType( jCas.getTypeSystem().getType("uima.cas.Integer"), jCas.getTypeSystem())); }