// Path: src/test/integration/java/io/aif/common/FileHelper.java
// public abstract class FileHelper {
// 
//   public static String readAllText(final InputStream inputStream) throws IOException {
//     try (final BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
// 
//       final StringBuffer buff = new StringBuffer();
// 
//       String line = null;
// 
//       while ((line = reader.readLine()) != null) {
//         buff.append(line + System.lineSeparator());
//       }
// 
//       return buff.toString();
//     } catch (NullPointerException e) {
//       throw e;
//     }
//   }
// 
// }


import org.apache.log4j.Logger;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import io.aif.common.FileHelper;
import static junit.framework.Assert.assertTrue;
package io.aif.language.sentence;





/**
 * @Test This class gets results made by AIF2NLPSentenceSplitter, OpenNLPSentenceSplitter,
 * StanfordNLPSentenceSplitter classes and compares it with a standard text body. The standard must
 * to be 100% correct and has the exact number of sentences. And if we compare our result with the
 * standard, we will get quality output result.
 *
 * author oakslist
 */
public class SimpleSentenceSplitterQualityTest {

  private static final Double ALLOWED_DEVIATION = 3.0;

  private static final Logger logger = Logger.getLogger(SimpleSentenceSplitterQualityTest.class);

  @DataProvider(name = "texts")
  public TestData[][] getTexts() {
    return new TestData[][]{
        // Tests switched off because we have problems with Russian books during mvn test
        //{new TestData("for_sentence_split_test_4939_mutated.txt", 4939)},
        //{new TestData("/texts/RU/for_sentence_split_test_4939.txt", 4939)},
        {new TestData("/texts/ENG/english.txt", 1000)},
        //{new TestData("/texts/RU/for_sentence_split_test_opencorpora_RU_5000.txt", 5000)}
    };
  }

  @Test(groups = {"integration-tests", "quality-fast"}, dataProvider = "texts")
  public void sentenceSplittersTest(final TestData testData) throws Exception {

    try (final InputStream resourceFile =
             SimpleSentenceSplitterQualityTest.class.getResourceAsStream(testData.getPath())) {

// Path: src/test/integration/java/io/aif/common/FileHelper.java
// public abstract class FileHelper {
// 
//   public static String readAllText(final InputStream inputStream) throws IOException {
//     try (final BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
// 
//       final StringBuffer buff = new StringBuffer();
// 
//       String line = null;
// 
//       while ((line = reader.readLine()) != null) {
//         buff.append(line + System.lineSeparator());
//       }
// 
//       return buff.toString();
//     } catch (NullPointerException e) {
//       throw e;
//     }
//   }
// 
// }


// Path: src/test/integration/java/io/aif/language/sentence/SimpleSentenceSplitterQualityTest.java
import org.apache.log4j.Logger;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import io.aif.common.FileHelper;
import static junit.framework.Assert.assertTrue;

package io.aif.language.sentence;





/**
 * @Test This class gets results made by AIF2NLPSentenceSplitter, OpenNLPSentenceSplitter,
 * StanfordNLPSentenceSplitter classes and compares it with a standard text body. The standard must
 * to be 100% correct and has the exact number of sentences. And if we compare our result with the
 * standard, we will get quality output result.
 *
 * author oakslist
 */
public class SimpleSentenceSplitterQualityTest {

  private static final Double ALLOWED_DEVIATION = 3.0;

  private static final Logger logger = Logger.getLogger(SimpleSentenceSplitterQualityTest.class);

  @DataProvider(name = "texts")
  public TestData[][] getTexts() {
    return new TestData[][]{
        // Tests switched off because we have problems with Russian books during mvn test
        //{new TestData("for_sentence_split_test_4939_mutated.txt", 4939)},
        //{new TestData("/texts/RU/for_sentence_split_test_4939.txt", 4939)},
        {new TestData("/texts/ENG/english.txt", 1000)},
        //{new TestData("/texts/RU/for_sentence_split_test_opencorpora_RU_5000.txt", 5000)}
    };
  }

  @Test(groups = {"integration-tests", "quality-fast"}, dataProvider = "texts")
  public void sentenceSplittersTest(final TestData testData) throws Exception {

    try (final InputStream resourceFile =
             SimpleSentenceSplitterQualityTest.class.getResourceAsStream(testData.getPath())) {

      final String textData = FileHelper.readAllText(resourceFile);