@@ -0,0 +1,2022 @@
+/* LanguageTool, a natural language style checker %0D%0A * Copyright (C) 2012 Marcin Mi%C5%82kowski (http://www.languagetool.org)%0D%0A * %0D%0A * This library is free software; you can redistribute it and/or%0D%0A * modify it under the terms of the GNU Lesser General Public%0D%0A * License as published by the Free Software Foundation; either%0D%0A * version 2.1 of the License, or (at your option) any later version.%0D%0A *%0D%0A * This library is distributed in the hope that it will be useful,%0D%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0D%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU%0D%0A * Lesser General Public License for more details.%0D%0A *%0D%0A * You should have received a copy of the GNU Lesser General Public%0D%0A * License along with this library; if not, write to the Free Software%0D%0A * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301%0D%0A * USA%0D%0A */%0D%0A%0D%0A%0D%0Apackage org.languagetool.rules.ru;%0D%0A%0D%0Aimport org.junit.Test;%0D%0Aimport org.languagetool.JLanguageTool;%0D%0Aimport org.languagetool.TestTools;%0D%0Aimport org.languagetool.language.Russian;%0D%0Aimport org.languagetool.rules.RuleMatch;%0D%0A%0D%0Aimport java.io.IOException;%0D%0Aimport java.util.Collections;%0D%0A%0D%0Aimport static org.junit.Assert.assertEquals;%0D%0A%0D%0Apublic class MorfologikRussianSpellerRuleTest %7B%0D%0A%0D%0A    @Test%0D%0A    public void testMorfologikSpeller() throws IOException %7B%0D%0A        MorfologikRussianSpellerRule rule =%0D%0A                new MorfologikRussianSpellerRule (TestTools.getMessages(%22ru%22), new Russian(), null, Collections.emptyList());%0D%0A%0D%0A        RuleMatch%5B%5D matches;%0D%0A        JLanguageTool langTool = new JLanguageTool(new Russian());%0D%0A%0D%0A%0D%0A%0D%0A        // correct word%0D%0A        assertEquals(0, rule.match(langTool.getAnalyzedSentence(%22%D1%80%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9%22)).length);%0D%0A        %0D%0A        // incorrect word with hyphen%0D%0A        assertEquals(1, rule.match(langTool.getAnalyzedSentence(%22%D1%8E%D0%B3%D0%BE-%D0%B7%D0%BF%D0%B4%D0%BD%D1%8B%D0%B9%22)).length);%0D%0A%0D%0A        // correct word with hyphen%0D%0A        assertEquals(0, rule.match(langTool.getAnalyzedSentence(%22%D1%81%D0%B5%D0%B2%D0%B5%D1%80%D0%BE-%D0%B2%D0%BE%D1%81%D1%82%D0%BE%D1%87%D0%BD%D1%8B%D0%B9%22)).length);%0D%0A%0D%0A     %7D%0D%0A%7D%0D%0A

add test for issue #1879