FastMatcher { protected String processToken(String token) { if (!token.trim().equals("@newline")) { int ind = token.indexOf(" "); if (ind == -1) ind = token.indexOf("\t"); if (ind == -1) return " " + token; else return " " + token.substring(0, ind); } return ""; } FastMatcher();  FastMatcher(File file);  FastMatcher(File file, org.grobid.core.analyzers.Analyzer analyzer);  FastMatcher(File file, org.grobid.core.analyzers.Analyzer analyzer, boolean caseSensitive);  FastMatcher(InputStream is);  FastMatcher(InputStream is, org.grobid.core.analyzers.Analyzer analyzer);  FastMatcher(InputStream is, org.grobid.core.analyzers.Analyzer analyzer, boolean caseSensitive); int loadTerms(File file); int loadTerms(File file, boolean caseSensitive); int loadTerms(File file, org.grobid.core.analyzers.Analyzer analyzer, boolean caseSensitive); int loadTerms(InputStream is, org.grobid.core.analyzers.Analyzer analyzer, boolean caseSensitive); int loadTerm(String term, org.grobid.core.analyzers.Analyzer analyzer); int loadTerm(String term, org.grobid.core.analyzers.Analyzer analyzer, boolean ignoreDelimiters); int loadTerm(String term, org.grobid.core.analyzers.Analyzer analyzer, boolean ignoreDelimiters, boolean caseSensitive); List<OffsetPosition> matchToken(String text); List<OffsetPosition> matchToken(String text, boolean caseSensitive); List<OffsetPosition> matchLayoutToken(List<LayoutToken> tokens); List<OffsetPosition> matchLayoutToken(List<LayoutToken> tokens, boolean ignoreDelimiters, boolean caseSensitive); List<OffsetPosition> matchCharacter(String text); List<OffsetPosition> matchCharacter(String text, boolean caseSensitive); List<OffsetPosition> matchCharacterLayoutToken(List<LayoutToken> tokens); List<OffsetPosition> matchCharacterLayoutToken(List<LayoutToken> tokens, boolean caseSensitive); List<OffsetPosition> matcherPairs(List<Pair<String, String>> tokens); List<OffsetPosition> matcherPairs(List<Pair<String, String>> tokens, boolean caseSensitive);  }
@Test public void testProcessToken_noSpace_shouldReturnToken() throws Exception { FastMatcher fastMatcher = new FastMatcher(); assertThat(fastMatcher.processToken("Hebrew"), is(" Hebrew")); }
@Test public void testProcessToken_space_shouldReturnSpace() throws Exception { FastMatcher fastMatcher = new FastMatcher(); assertThat(fastMatcher.processToken(" "), is(" ")); }
@Test public void testProcessToken_newLine_shouldBeIgnored() throws Exception { FastMatcher fastMatcher = new FastMatcher(); assertThat(fastMatcher.processToken("@newline"), is("")); }
@Test public void testProcessToken_tabulation_shouldBecomeSpace() throws Exception { FastMatcher fastMatcher = new FastMatcher(); assertThat(fastMatcher.processToken("\t"), is(" ")); }