@@ -0,0 +1,2382 @@
+/* LanguageTool, a natural language style checker %0A * Copyright (C) 2014 Daniel Naber (http://www.danielnaber.de)%0A * %0A * This library is free software; you can redistribute it and/or%0A * modify it under the terms of the GNU Lesser General Public%0A * License as published by the Free Software Foundation; either%0A * version 2.1 of the License, or (at your option) any later version.%0A *%0A * This library is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU%0A * Lesser General Public License for more details.%0A *%0A * You should have received a copy of the GNU Lesser General Public%0A * License along with this library; if not, write to the Free Software%0A * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301%0A * USA%0A */%0Apackage org.languagetool.dev.errorcorpus;%0A%0Aimport org.junit.Test;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.net.URL;%0Aimport java.util.Iterator;%0A%0Aimport static junit.framework.TestCase.assertTrue;%0Aimport static org.hamcrest.CoreMatchers.is;%0Aimport static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertThat;%0A%0Apublic class PedlerCorpusTest %7B%0A%0A  @Test%0A  public void testCorpusAccess() throws IOException %7B%0A    URL errors = PedlerCorpusTest.class.getResource(%22/org/languagetool/dev/eval%22);%0A    PedlerCorpus corpus = new PedlerCorpus(new File(errors.getFile()));%0A    Iterator%3CErrorSentence%3E iterator = corpus.iterator();%0A    assertTrue(iterator.hasNext());%0A    ErrorSentence sentence1 = iterator.next();%0A    assertThat(sentence1.getAnnotatedText().getPlainText(),%0A            is(%22But also please not that grammar checkers aren't perfect.%22));%0A    assertThat(sentence1.getMarkupText(),%0A            is(%22But %3CERR targ=foo%3Ealso%3C/ERR%3E please %3CERR targ=note%3Enot%3C/ERR%3E that grammar checkers aren't perfect.%22));%0A%0A    ErrorSentence sentence2 = iterator.next();%0A    assertThat(sentence2.getAnnotatedText().getPlainText(),%0A            is(%22But also also please note note that grammar checkers aren't perfect.%22));%0A    assertThat(sentence2.getMarkupText(),%0A            is(%22But %3CERR targ=bad suggestion%3Ealso also%3C/ERR%3E please %3CERR targ=note%3Enote note%3C/ERR%3E that grammar checkers aren't perfect.%22));%0A%0A    assertTrue(iterator.hasNext());%0A    iterator.next();%0A    assertFalse(iterator.hasNext());%0A  %7D %0A%0A%7D%0A

add test