@Test public void testClearAdaptiveData() throws IOException { String trainingData = "a\n" + "b\n" + "c\n" + "\n" + "d\n"; ObjectStream<String> untokenizedLineStream = new PlainTextByLineStream( new MockInputStreamFactory(trainingData), StandardCharsets.UTF_8); ObjectStream<NameSample> trainingStream = new NameSampleDataStream(untokenizedLineStream); assertFalse(trainingStream.read().isClearAdaptiveDataSet()); assertFalse(trainingStream.read().isClearAdaptiveDataSet()); assertFalse(trainingStream.read().isClearAdaptiveDataSet()); assertTrue(trainingStream.read().isClearAdaptiveDataSet()); assertNull(trainingStream.read()); trainingStream.close(); }
public NameSample read() throws IOException { String token = samples.read(); boolean isClearAdaptiveData = false; while (token != null && token.trim().length() == 0) { isClearAdaptiveData = true; token = samples.read(); } if (token != null) { return NameSample.parse(token, isClearAdaptiveData); } else { return null; } }
NameSampleDataStream extends FilterObjectStream<String, NameSample> { public NameSample read() throws IOException { String token = samples.read(); boolean isClearAdaptiveData = false; while (token != null && token.trim().length() == 0) { isClearAdaptiveData = true; token = samples.read(); } if (token != null) { return NameSample.parse(token, isClearAdaptiveData); } else { return null; } } }
NameSampleDataStream extends FilterObjectStream<String, NameSample> { public NameSample read() throws IOException { String token = samples.read(); boolean isClearAdaptiveData = false; while (token != null && token.trim().length() == 0) { isClearAdaptiveData = true; token = samples.read(); } if (token != null) { return NameSample.parse(token, isClearAdaptiveData); } else { return null; } } NameSampleDataStream(ObjectStream<String> in); }
NameSampleDataStream extends FilterObjectStream<String, NameSample> { public NameSample read() throws IOException { String token = samples.read(); boolean isClearAdaptiveData = false; while (token != null && token.trim().length() == 0) { isClearAdaptiveData = true; token = samples.read(); } if (token != null) { return NameSample.parse(token, isClearAdaptiveData); } else { return null; } } NameSampleDataStream(ObjectStream<String> in); NameSample read(); }
NameSampleDataStream extends FilterObjectStream<String, NameSample> { public NameSample read() throws IOException { String token = samples.read(); boolean isClearAdaptiveData = false; while (token != null && token.trim().length() == 0) { isClearAdaptiveData = true; token = samples.read(); } if (token != null) { return NameSample.parse(token, isClearAdaptiveData); } else { return null; } } NameSampleDataStream(ObjectStream<String> in); NameSample read(); static final String START_TAG_PREFIX; static final String START_TAG; static final String END_TAG; }