@Test public void testAllowWhiteSpacesAroundAQuote() throws Exception { List<CSVResult> results = sniff(DELIMITERS, ALLOW_SPACES_BEFORE_QUOTE, StandardCharsets.UTF_8); assertEquals(2, results.size()); assertEquals(new Character(','), results.get(0).getDelimiter()); results = sniff(DELIMITERS, ALLOW_SPACES_AFTER_QUOTE, StandardCharsets.UTF_8); assertEquals(2, results.size()); assertEquals(new Character(','), results.get(0).getDelimiter()); }
List<CSVResult> sniff(Reader reader) throws IOException { if (! reader.markSupported()) { reader = new BufferedReader(reader); } List<CSVResult> ret = new ArrayList<>(); for (char delimiter : delimiters) { reader.mark(markLimit); try { CSVResult result = new Snifflet(delimiter).sniff(reader); ret.add(result); } finally { reader.reset(); } } Collections.sort(ret); return ret; }
CSVSniffer { List<CSVResult> sniff(Reader reader) throws IOException { if (! reader.markSupported()) { reader = new BufferedReader(reader); } List<CSVResult> ret = new ArrayList<>(); for (char delimiter : delimiters) { reader.mark(markLimit); try { CSVResult result = new Snifflet(delimiter).sniff(reader); ret.add(result); } finally { reader.reset(); } } Collections.sort(ret); return ret; } }
CSVSniffer { List<CSVResult> sniff(Reader reader) throws IOException { if (! reader.markSupported()) { reader = new BufferedReader(reader); } List<CSVResult> ret = new ArrayList<>(); for (char delimiter : delimiters) { reader.mark(markLimit); try { CSVResult result = new Snifflet(delimiter).sniff(reader); ret.add(result); } finally { reader.reset(); } } Collections.sort(ret); return ret; } CSVSniffer(char[] delimiters);   CSVSniffer(int markLimit, char[] delimiters, double minConfidence); }
CSVSniffer { List<CSVResult> sniff(Reader reader) throws IOException { if (! reader.markSupported()) { reader = new BufferedReader(reader); } List<CSVResult> ret = new ArrayList<>(); for (char delimiter : delimiters) { reader.mark(markLimit); try { CSVResult result = new Snifflet(delimiter).sniff(reader); ret.add(result); } finally { reader.reset(); } } Collections.sort(ret); return ret; } CSVSniffer(char[] delimiters);   CSVSniffer(int markLimit, char[] delimiters, double minConfidence);  }
CSVSniffer { List<CSVResult> sniff(Reader reader) throws IOException { if (! reader.markSupported()) { reader = new BufferedReader(reader); } List<CSVResult> ret = new ArrayList<>(); for (char delimiter : delimiters) { reader.mark(markLimit); try { CSVResult result = new Snifflet(delimiter).sniff(reader); ret.add(result); } finally { reader.reset(); } } Collections.sort(ret); return ret; } CSVSniffer(char[] delimiters);   CSVSniffer(int markLimit, char[] delimiters, double minConfidence);   }