@@ -0,0 +1,2531 @@
+/* LanguageTool, a natural language style checker %0A * Copyright (C) 2006 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 de.danielnaber.languagetool.tagging.ca;%0A%0Aimport java.io.IOException;%0A%0Aimport morfologik.stemming.Dictionary;%0Aimport morfologik.stemming.DictionaryLookup;%0Aimport morfologik.stemming.WordData;%0A%0Aimport junit.framework.TestCase;%0Aimport de.danielnaber.languagetool.TestTools;%0Aimport de.danielnaber.languagetool.tokenizers.WordTokenizer;%0A%0Apublic class CatalanTaggerTest extends TestCase %7B%0A%0A  private CatalanTagger tagger;%0A  private WordTokenizer tokenizer;%0A%0A  public void setUp() %7B%0A    tagger = new CatalanTagger();%0A    tokenizer = new WordTokenizer();%0A  %7D%0A  %0A  public void testDictionary() throws IOException %7B%0A    final Dictionary dictionary = Dictionary.read(%0A        this.getClass().getResource(tagger.getFileName()));%0A    final DictionaryLookup dl = new DictionaryLookup(dictionary);%0A    for (WordData wd : dl) %7B%0A      if (wd.getTag() == null %7C%7C wd.getTag().length() == 0) %7B%0A        System.err.println(%22**** Warning: the word %22 + wd.getWord() + %22/%22 + wd.getStem() +%22 lacks a POS tag in the dictionary.%22);%0A      %7D%0A    %7D    %0A  %7D%0A%0A  public void testTagger() throws IOException %7B%0A    TestTools.myAssert(%22S%C3%B3c un home molt honrat.%22,%0A        %22S%C3%B3c/%5Bser%5DVSIP1S0 -- un/%5Bun%5DDI0MS0%7Cun/%5Bun%5DPI0MS000 -- home/%5Bhome%5DI%7Chome/%5Bhome%5DNCMS000 -- molt/%5Bmolt%5DDI0MS0%7Cmolt/%5Bmolt%5DPI0MS000%7Cmolt/%5Bmolt%5DRG -- honrat/%5Bhonrar%5DVMP00SM%22, tokenizer, tagger);%0A// Need to fix the separator character: al - a+el+SP+DA%0A//    TestTools.myAssert(%22Frase recitada al mat%C3%AD.%22,%0A//        %22Frase/%5Bfrase%5DNCFS000 -- recitada/%5Brecitar%5DVMP00SF -- al/%5Ba%5Del+SP+DA -- mat%C3%AD/%5Bmatar%5DVMIS1S0%7C%5Bmat%C3%AD%5DNCMS000%22, tokenizer, tagger);%0A    TestTools.myAssert(%22blablabla%22,%22blablabla/%5Bnull%5Dnull%22, tokenizer, tagger);        %0A  %7D%0A%7D%0A

add tagger test