@Test public void testGetEntityTypes() throws Exception { String text = "Hey, Lets meet on this Sunday or MONDAY because i am busy on Saturday"; System.setProperty(NamedEntityParser.SYS_PROP_NER_IMPL, RegexNERecogniser.class.getName()); Tika tika = new Tika(new TikaConfig(NamedEntityParser.class.getResourceAsStream("tika-config.xml"))); Metadata md = new Metadata(); tika.parse(new ByteArrayInputStream(text.getBytes(StandardCharsets.UTF_8)), md); Set<String> days = new HashSet<>(Arrays.asList(md.getValues("NER_WEEK_DAY"))); assertTrue(days.contains("Sunday")); assertTrue(days.contains("MONDAY")); assertTrue(days.contains("Saturday")); assertTrue(days.size() == 3); }
@Override public Set<String> getEntityTypes() { return entityTypes; }
RegexNERecogniser implements NERecogniser { @Override public Set<String> getEntityTypes() { return entityTypes; } }
RegexNERecogniser implements NERecogniser { @Override public Set<String> getEntityTypes() { return entityTypes; } RegexNERecogniser();  RegexNERecogniser(InputStream stream); }
RegexNERecogniser implements NERecogniser { @Override public Set<String> getEntityTypes() { return entityTypes; } RegexNERecogniser();  RegexNERecogniser(InputStream stream); synchronized static RegexNERecogniser getInstance(); @Override boolean isAvailable(); @Override Set<String> getEntityTypes(); Set<String> findMatches(String text, Pattern pattern); @Override Map<String, Set<String>> recognise(String text); }
RegexNERecogniser implements NERecogniser { @Override public Set<String> getEntityTypes() { return entityTypes; } RegexNERecogniser();  RegexNERecogniser(InputStream stream); synchronized static RegexNERecogniser getInstance(); @Override boolean isAvailable(); @Override Set<String> getEntityTypes(); Set<String> findMatches(String text, Pattern pattern); @Override Map<String, Set<String>> recognise(String text); static final String NER_REGEX_FILE; public Set<String> entityTypes; public Map<String, Pattern> patterns; }